Revert^2 "Add verifier fallback for JVMTI Get/SetLocalVariable"

This reverts commit 99cbfb55fc7ac0f65b1ccdc7076219fcee383b92.

This unreverts commit e48fd0b4780efadc6b3433fe7a56aa5be2a84325.

We were incorrectly bounds-checking the register number. We were
treating it as unsigned when it was actual signed. Previously this
wouldn't matter since normally the debug-info won't have any
information for negative slots but by falling back to the verifier
we hit some check failures.

Reason for revert: Fixed underlying issue with bad bounds check.
Bug: 131711256

Change-Id: I0b859ce322f3b23f937b72d735db8f6870c40602
diff --git a/test/1966-get-set-local-objects-no-table/build b/test/1966-get-set-local-objects-no-table/build
new file mode 100644
index 0000000..6631df9
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/build
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Copyright 2019 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
+
+if [[ $@ != *"--jvm"* ]]; then
+  mv jasmin jasmin-unused
+else
+  mv smali smali-unused
+fi
+./default-build "$@" 
diff --git a/test/1966-get-set-local-objects-no-table/expected.txt b/test/1966-get-set-local-objects-no-table/expected.txt
new file mode 100644
index 0000000..f24dfe7
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/expected.txt
@@ -0,0 +1,162 @@
+Running public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) with "GetGetObject" on remote thread.
+"GetGetObject" on public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) got value: TestClass1("ObjectMethod")
+	Value is 'TestClass1("ObjectMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) with "SetNull" on remote thread.
+"SetNull" on public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) set value: null
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) with "SetTestClass1" on remote thread.
+"SetTestClass1" on public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) set value: TestClass1("Set TestClass1")
+	Value is 'TestClass1("Set TestClass1")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) with "SetTestClass1ext" on remote thread.
+"SetTestClass1ext" on public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) set value: TestClass1ext("TestClass1("Set TestClass1ext")")
+	Value is 'TestClass1ext("TestClass1("Set TestClass1ext")")' (class: class art.Test1966$TestClass1ext)
+Running public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) with "SetTestClass2" on remote thread.
+"SetTestClass2" on public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) set value: TestClass2("Set TestClass2")
+	Value is 'TestClass2("Set TestClass2")' (class: class art.Test1966$TestClass2)
+Running public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) with "SetTestClass2impl" on remote thread.
+"SetTestClass2impl" on public static void art_test.TestCases1966.ObjectMethod(java.util.function.IntConsumer) set value: TestClass2impl("TestClass2("Set TestClass2impl")")
+	Value is 'TestClass2impl("TestClass2("Set TestClass2impl")")' (class: class art.Test1966$TestClass2impl)
+Running public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) with "GetGetObject" on remote thread.
+"GetGetObject" on public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) got value: TestClass1("ObjectMethod")
+	Value is 'TestClass1("ObjectMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) with "SetNull" on remote thread.
+"SetNull" on public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) set value: null
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) with "SetTestClass1" on remote thread.
+"SetTestClass1" on public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) set value: TestClass1("Set TestClass1")
+	Value is 'TestClass1("Set TestClass1")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) with "SetTestClass1ext" on remote thread.
+"SetTestClass1ext" on public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) set value: TestClass1ext("TestClass1("Set TestClass1ext")")
+	Value is 'TestClass1ext("TestClass1("Set TestClass1ext")")' (class: class art.Test1966$TestClass1ext)
+Running public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) with "SetTestClass2" on remote thread.
+"SetTestClass2" on public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) failed to set value TestClass2("Set TestClass2") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is 'TestClass1("ObjectMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) with "SetTestClass2impl" on remote thread.
+"SetTestClass2impl" on public static void art_test.TestCases1966.CastInterfaceMethod(java.util.function.IntConsumer) failed to set value TestClass2impl("TestClass2("Set TestClass2impl")") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is 'TestClass1("ObjectMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) with "GetGetObject" on remote thread.
+"GetGetObject" on public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) got value: TestClass1("ObjectMethod")
+	Value is 'TestClass1("ObjectMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) with "SetNull" on remote thread.
+"SetNull" on public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) set value: null
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) with "SetTestClass1" on remote thread.
+"SetTestClass1" on public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) set value: TestClass1("Set TestClass1")
+	Value is 'TestClass1("Set TestClass1")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) with "SetTestClass1ext" on remote thread.
+"SetTestClass1ext" on public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) set value: TestClass1ext("TestClass1("Set TestClass1ext")")
+	Value is 'TestClass1ext("TestClass1("Set TestClass1ext")")' (class: class art.Test1966$TestClass1ext)
+Running public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) with "SetTestClass2" on remote thread.
+"SetTestClass2" on public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) failed to set value TestClass2("Set TestClass2") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is 'TestClass1("ObjectMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) with "SetTestClass2impl" on remote thread.
+"SetTestClass2impl" on public static void art_test.TestCases1966.CastExactMethod(java.util.function.IntConsumer) failed to set value TestClass2impl("TestClass2("Set TestClass2impl")") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is 'TestClass1("ObjectMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) with "GetGetObject" on remote thread.
+"GetGetObject" on public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) got value: TestClass1("InterfaceMethod")
+	Value is 'TestClass1("InterfaceMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) with "SetNull" on remote thread.
+"SetNull" on public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) set value: null
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) with "SetTestClass1" on remote thread.
+"SetTestClass1" on public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) set value: TestClass1("Set TestClass1")
+	Value is 'TestClass1("Set TestClass1")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) with "SetTestClass1ext" on remote thread.
+"SetTestClass1ext" on public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) set value: TestClass1ext("TestClass1("Set TestClass1ext")")
+	Value is 'TestClass1ext("TestClass1("Set TestClass1ext")")' (class: class art.Test1966$TestClass1ext)
+Running public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) with "SetTestClass2" on remote thread.
+"SetTestClass2" on public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) failed to set value TestClass2("Set TestClass2") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is 'TestClass1("InterfaceMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) with "SetTestClass2impl" on remote thread.
+"SetTestClass2impl" on public static void art_test.TestCases1966.InterfaceMethod(java.util.function.IntConsumer) set value: TestClass2impl("TestClass2("Set TestClass2impl")")
+	Value is 'TestClass2impl("TestClass2("Set TestClass2impl")")' (class: class art.Test1966$TestClass2impl)
+Running public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) with "GetGetObject" on remote thread.
+"GetGetObject" on public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) got value: TestClass1("SpecificClassMethod")
+	Value is 'TestClass1("SpecificClassMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) with "SetNull" on remote thread.
+"SetNull" on public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) set value: null
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) with "SetTestClass1" on remote thread.
+"SetTestClass1" on public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) set value: TestClass1("Set TestClass1")
+	Value is 'TestClass1("Set TestClass1")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) with "SetTestClass1ext" on remote thread.
+"SetTestClass1ext" on public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) set value: TestClass1ext("TestClass1("Set TestClass1ext")")
+	Value is 'TestClass1ext("TestClass1("Set TestClass1ext")")' (class: class art.Test1966$TestClass1ext)
+Running public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) with "SetTestClass2" on remote thread.
+"SetTestClass2" on public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) failed to set value TestClass2("Set TestClass2") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is 'TestClass1("SpecificClassMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) with "SetTestClass2impl" on remote thread.
+"SetTestClass2impl" on public static void art_test.TestCases1966.ExactClassMethod(java.util.function.IntConsumer) failed to set value TestClass2impl("TestClass2("Set TestClass2impl")") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is 'TestClass1("SpecificClassMethod")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) with "GetGetObject" on remote thread.
+"GetGetObject" on public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) failed due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is '42' (class: class java.lang.Integer)
+Running public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) with "SetNull" on remote thread.
+"SetNull" on public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) failed to set value null due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is '42' (class: class java.lang.Integer)
+Running public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) with "SetTestClass1" on remote thread.
+"SetTestClass1" on public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) failed to set value TestClass1("Set TestClass1") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is '42' (class: class java.lang.Integer)
+Running public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) with "SetTestClass1ext" on remote thread.
+"SetTestClass1ext" on public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) failed to set value TestClass1ext("TestClass1("Set TestClass1ext")") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is '42' (class: class java.lang.Integer)
+Running public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) with "SetTestClass2" on remote thread.
+"SetTestClass2" on public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) failed to set value TestClass2("Set TestClass2") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is '42' (class: class java.lang.Integer)
+Running public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) with "SetTestClass2impl" on remote thread.
+"SetTestClass2impl" on public static void art_test.TestCases1966.PrimitiveMethod(java.util.function.IntConsumer) failed to set value TestClass2impl("TestClass2("Set TestClass2impl")") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is '42' (class: class java.lang.Integer)
+Running public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) with "GetGetObject" on remote thread.
+"GetGetObject" on public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) got value: null
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) with "SetNull" on remote thread.
+"SetNull" on public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) set value: null
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) with "SetTestClass1" on remote thread.
+"SetTestClass1" on public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) failed to set value TestClass1("Set TestClass1") due to JVMTI_ERROR_INTERNAL
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) with "SetTestClass1ext" on remote thread.
+"SetTestClass1ext" on public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) failed to set value TestClass1ext("TestClass1("Set TestClass1ext")") due to JVMTI_ERROR_INTERNAL
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) with "SetTestClass2" on remote thread.
+"SetTestClass2" on public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) failed to set value TestClass2("Set TestClass2") due to JVMTI_ERROR_INTERNAL
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) with "SetTestClass2impl" on remote thread.
+"SetTestClass2impl" on public static void art_test.TestCases1966.NullMethod(java.util.function.IntConsumer) failed to set value TestClass2impl("TestClass2("Set TestClass2impl")") due to JVMTI_ERROR_INTERNAL
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) with "GetGetObject" on remote thread.
+"GetGetObject" on public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) got value: null
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) with "SetNull" on remote thread.
+"SetNull" on public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) set value: null
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) with "SetTestClass1" on remote thread.
+"SetTestClass1" on public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) set value: TestClass1("Set TestClass1")
+	Value is 'TestClass1("Set TestClass1")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) with "SetTestClass1ext" on remote thread.
+"SetTestClass1ext" on public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) set value: TestClass1ext("TestClass1("Set TestClass1ext")")
+	Value is 'TestClass1ext("TestClass1("Set TestClass1ext")")' (class: class art.Test1966$TestClass1ext)
+Running public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) with "SetTestClass2" on remote thread.
+"SetTestClass2" on public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) failed to set value TestClass2("Set TestClass2") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) with "SetTestClass2impl" on remote thread.
+"SetTestClass2impl" on public static void art_test.TestCases1966.CastExactNullMethod(java.util.function.IntConsumer) failed to set value TestClass2impl("TestClass2("Set TestClass2impl")") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) with "GetGetObject" on remote thread.
+"GetGetObject" on public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) got value: null
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) with "SetNull" on remote thread.
+"SetNull" on public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) set value: null
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) with "SetTestClass1" on remote thread.
+"SetTestClass1" on public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) set value: TestClass1("Set TestClass1")
+	Value is 'TestClass1("Set TestClass1")' (class: class art.Test1966$TestClass1)
+Running public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) with "SetTestClass1ext" on remote thread.
+"SetTestClass1ext" on public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) set value: TestClass1ext("TestClass1("Set TestClass1ext")")
+	Value is 'TestClass1ext("TestClass1("Set TestClass1ext")")' (class: class art.Test1966$TestClass1ext)
+Running public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) with "SetTestClass2" on remote thread.
+"SetTestClass2" on public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) failed to set value TestClass2("Set TestClass2") due to JVMTI_ERROR_TYPE_MISMATCH
+	Value is 'null' (class: NULL)
+Running public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) with "SetTestClass2impl" on remote thread.
+"SetTestClass2impl" on public static void art_test.TestCases1966.CastInterfaceNullMethod(java.util.function.IntConsumer) set value: TestClass2impl("TestClass2("Set TestClass2impl")")
+	Value is 'TestClass2impl("TestClass2("Set TestClass2impl")")' (class: class art.Test1966$TestClass2impl)
diff --git a/test/1966-get-set-local-objects-no-table/info.txt b/test/1966-get-set-local-objects-no-table/info.txt
new file mode 100644
index 0000000..86ac743
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/info.txt
@@ -0,0 +1,2 @@
+Tests for jvmti get and set local variable object.
+
diff --git a/test/1966-get-set-local-objects-no-table/jasmin/TestCases1966.j b/test/1966-get-set-local-objects-no-table/jasmin/TestCases1966.j
new file mode 100644
index 0000000..721f7ce
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/jasmin/TestCases1966.j
@@ -0,0 +1,161 @@
+; Copyright (C) 2019 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 art_test/TestCases1966
+.super java/lang/Object
+.inner class public static TestClass1 inner art/Test1966$TestClass1 outer art/Test1966
+.inner interface public static abstract TestInterface inner art/Test1966$TestInterface outer art/Test1966
+
+.method public <init>()V
+  .limit stack 1
+  .limit locals 1
+  0: aload_0
+  1: invokespecial java/lang/Object/<init>()V
+  4: return
+.end method
+
+.method public static PrimitiveMethod(Ljava/util/function/IntConsumer;)V
+  .limit stack 2
+  .limit locals 2
+  0: bipush 42
+  2: istore_1
+  3: aload_0
+  4: sipush 1
+  7: invokeinterface java/util/function/IntConsumer/accept(I)V 2
+  12: iload_1
+  13: invokestatic java/lang/Integer/valueOf(I)Ljava/lang/Integer;
+  16: invokestatic art/Test1966/reportValue(Ljava/lang/Object;)V
+  19: return
+.end method
+
+.method public static CastInterfaceMethod(Ljava/util/function/IntConsumer;)V
+  .limit stack 2
+  .limit locals 3
+  0: ldc "ObjectMethod"
+  2: invokestatic art/Test1966$TestClass1/create(Ljava/lang/String;)Ljava/lang/Object;
+  5: astore_1
+  6: aload_1
+  7: checkcast art/Test1966$TestClass1
+  10: astore_2
+  11: aload_0
+  12: sipush 2
+  15: invokeinterface java/util/function/IntConsumer/accept(I)V 2
+  20: aload_2
+  21: invokestatic art/Test1966/reportValue(Ljava/lang/Object;)V
+  24: return
+.end method
+
+.method public static CastExactMethod(Ljava/util/function/IntConsumer;)V
+  .limit stack 2
+  .limit locals 3
+  0: ldc "ObjectMethod"
+  2: invokestatic art/Test1966$TestClass1/create(Ljava/lang/String;)Ljava/lang/Object;
+  5: astore_1
+  6: aload_1
+  7: checkcast art/Test1966$TestClass1
+  10: astore_2
+  11: aload_0
+  12: sipush 2
+  15: invokeinterface java/util/function/IntConsumer/accept(I)V 2
+  20: aload_2
+  21: invokestatic art/Test1966/reportValue(Ljava/lang/Object;)V
+  24: return
+.end method
+
+.method public static ObjectMethod(Ljava/util/function/IntConsumer;)V
+  .limit stack 2
+  .limit locals 2
+  0: ldc "ObjectMethod"
+  2: invokestatic art/Test1966$TestClass1/create(Ljava/lang/String;)Ljava/lang/Object;
+  5: astore_1
+  6: aload_0
+  7: sipush 1
+  10: invokeinterface java/util/function/IntConsumer/accept(I)V 2
+  15: aload_1
+  16: invokestatic art/Test1966/reportValue(Ljava/lang/Object;)V
+  19: return
+.end method
+
+.method public static InterfaceMethod(Ljava/util/function/IntConsumer;)V
+  .limit stack 2
+  .limit locals 2
+  0: ldc "InterfaceMethod"
+  2: invokestatic art/Test1966$TestClass1/createInterface(Ljava/lang/String;)Lart/Test1966$TestInterface;
+  5: astore_1
+  6: aload_0
+  7: sipush 1
+  10: invokeinterface java/util/function/IntConsumer/accept(I)V 2
+  15: aload_1
+  16: invokestatic art/Test1966/reportValue(Ljava/lang/Object;)V
+  19: return
+.end method
+
+.method public static ExactClassMethod(Ljava/util/function/IntConsumer;)V
+  .limit stack 2
+  .limit locals 2
+  0: ldc "SpecificClassMethod"
+  2: invokestatic art/Test1966$TestClass1/createExact(Ljava/lang/String;)Lart/Test1966$TestClass1;
+  5: astore_1
+  6: aload_0
+  7: sipush 1
+  10: invokeinterface java/util/function/IntConsumer/accept(I)V 2
+  15: aload_1
+  16: invokestatic art/Test1966/reportValue(Ljava/lang/Object;)V
+  19: return
+.end method
+
+.method public static CastExactNullMethod(Ljava/util/function/IntConsumer;)V
+  .limit stack 2
+  .limit locals 3
+  0: aconst_null
+  1: astore_1
+  2: aload_1
+  3: checkcast art/Test1966$TestClass1
+  6: astore_2
+  7: aload_0
+  8: sipush 2
+  11: invokeinterface java/util/function/IntConsumer/accept(I)V 2
+  16: aload_2
+  17: invokestatic art/Test1966/reportValue(Ljava/lang/Object;)V
+  20: return
+.end method
+
+.method public static CastInterfaceNullMethod(Ljava/util/function/IntConsumer;)V
+  .limit stack 2
+  .limit locals 3
+  0: aconst_null
+  1: astore_1
+  2: aload_1
+  3: checkcast art/Test1966$TestInterface
+  6: astore_2
+  7: aload_0
+  8: sipush 2
+  11: invokeinterface java/util/function/IntConsumer/accept(I)V 2
+  16: aload_2
+  17: invokestatic art/Test1966/reportValue(Ljava/lang/Object;)V
+  20: return
+.end method
+
+.method public static NullMethod(Ljava/util/function/IntConsumer;)V
+  .limit stack 2
+  .limit locals 2
+  0: aconst_null
+  1: astore_1
+  2: aload_0
+  3: sipush 1
+  6: invokeinterface java/util/function/IntConsumer/accept(I)V 2
+  11: aload_1
+  12: invokestatic art/Test1966/reportValue(Ljava/lang/Object;)V
+  15: return
+.end method
diff --git a/test/1966-get-set-local-objects-no-table/run b/test/1966-get-set-local-objects-no-table/run
new file mode 100755
index 0000000..9b741ee
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/run
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# Copyright 2019 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 we compile the .oat files non-debuggable we could end up with dex2dex running over the files
+# which will cause some instructions to be removed from smali/TestCases1966.smali. This test relies
+# on the instructions being exactly as written so pass --debuggable to 'dex2oat' only to prevent
+# this from happening.
+./default-run "$@" --jvmti --compiler-only-option --debuggable
diff --git a/test/1966-get-set-local-objects-no-table/smali/TestCases1966.smali b/test/1966-get-set-local-objects-no-table/smali/TestCases1966.smali
new file mode 100644
index 0000000..d460dcd
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/smali/TestCases1966.smali
@@ -0,0 +1,121 @@
+# Copyright (C) 2019 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 Lart_test/TestCases1966;
+.super Ljava/lang/Object;
+
+# direct methods
+.method public constructor <init>()V
+    .registers 1
+    invoke-direct {p0}, Ljava/lang/Object;-><init>()V
+    return-void
+.end method
+
+.method public static CastExactMethod(Ljava/util/function/IntConsumer;)V
+    .registers 3
+    const-string v0, "ObjectMethod"
+    invoke-static {v0}, Lart/Test1966$TestClass1;->create(Ljava/lang/String;)Ljava/lang/Object;
+    move-result-object v0
+    check-cast v0, Lart/Test1966$TestClass1;
+    const/16 v1, 0x0
+    invoke-interface {p0, v1}, Ljava/util/function/IntConsumer;->accept(I)V
+    invoke-static {v0}, Lart/Test1966;->reportValue(Ljava/lang/Object;)V
+    return-void
+.end method
+
+.method public static CastInterfaceMethod(Ljava/util/function/IntConsumer;)V
+    .registers 3
+    const-string v0, "ObjectMethod"
+    invoke-static {v0}, Lart/Test1966$TestClass1;->create(Ljava/lang/String;)Ljava/lang/Object;
+    move-result-object v0
+    check-cast v0, Lart/Test1966$TestClass1;
+    const/16 v1, 0x0
+    invoke-interface {p0, v1}, Ljava/util/function/IntConsumer;->accept(I)V
+    invoke-static {v0}, Lart/Test1966;->reportValue(Ljava/lang/Object;)V
+    return-void
+.end method
+
+.method public static ExactClassMethod(Ljava/util/function/IntConsumer;)V
+    .registers 3
+    const-string v0, "SpecificClassMethod"
+    invoke-static {v0}, Lart/Test1966$TestClass1;->createExact(Ljava/lang/String;)Lart/Test1966$TestClass1;
+    move-result-object v0
+    const/16 v1, 0x0
+    invoke-interface {p0, v1}, Ljava/util/function/IntConsumer;->accept(I)V
+    invoke-static {v0}, Lart/Test1966;->reportValue(Ljava/lang/Object;)V
+    return-void
+.end method
+
+.method public static InterfaceMethod(Ljava/util/function/IntConsumer;)V
+    .registers 3
+    const-string v0, "InterfaceMethod"
+    invoke-static {v0}, Lart/Test1966$TestClass1;->createInterface(Ljava/lang/String;)Lart/Test1966$TestInterface;
+    move-result-object v0
+    const/16 v1, 0x0
+    invoke-interface {p0, v1}, Ljava/util/function/IntConsumer;->accept(I)V
+    invoke-static {v0}, Lart/Test1966;->reportValue(Ljava/lang/Object;)V
+    return-void
+.end method
+
+.method public static ObjectMethod(Ljava/util/function/IntConsumer;)V
+    .registers 3
+    const-string v0, "ObjectMethod"
+    invoke-static {v0}, Lart/Test1966$TestClass1;->create(Ljava/lang/String;)Ljava/lang/Object;
+    move-result-object v0
+    const/16 v1, 0x0
+    invoke-interface {p0, v1}, Ljava/util/function/IntConsumer;->accept(I)V
+    invoke-static {v0}, Lart/Test1966;->reportValue(Ljava/lang/Object;)V
+    return-void
+.end method
+
+.method public static PrimitiveMethod(Ljava/util/function/IntConsumer;)V
+    .registers 3
+    const/16 v0, 0x2a
+    const/16 v1, 0x0
+    invoke-interface {p0, v1}, Ljava/util/function/IntConsumer;->accept(I)V
+    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
+    move-result-object p0
+    invoke-static {p0}, Lart/Test1966;->reportValue(Ljava/lang/Object;)V
+    return-void
+.end method
+
+.method public static NullMethod(Ljava/util/function/IntConsumer;)V
+    .registers 3
+    const/4 v0, 0x0
+    const/16 v1, 0x0
+    invoke-interface {p0, v1}, Ljava/util/function/IntConsumer;->accept(I)V
+    invoke-static {v0}, Lart/Test1966;->reportValue(Ljava/lang/Object;)V
+    return-void
+.end method
+
+.method public static CastInterfaceNullMethod(Ljava/util/function/IntConsumer;)V
+    .registers 3
+    const/4 v0, 0x0
+    check-cast v0, Lart/Test1966$TestInterface;
+    const/16 v1, 0x0
+    invoke-interface {p0, v1}, Ljava/util/function/IntConsumer;->accept(I)V
+    invoke-static {v0}, Lart/Test1966;->reportValue(Ljava/lang/Object;)V
+    return-void
+.end method
+
+.method public static CastExactNullMethod(Ljava/util/function/IntConsumer;)V
+    .registers 3
+    const/4 v0, 0x0
+    check-cast v0, Lart/Test1966$TestClass1;
+    const/16 v1, 0x0
+    invoke-interface {p0, v1}, Ljava/util/function/IntConsumer;->accept(I)V
+    invoke-static {v0}, Lart/Test1966;->reportValue(Ljava/lang/Object;)V
+    return-void
+.end method
\ No newline at end of file
diff --git a/test/1966-get-set-local-objects-no-table/src/Main.java b/test/1966-get-set-local-objects-no-table/src/Main.java
new file mode 100644
index 0000000..198f319
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/src/Main.java
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+public class Main {
+  public static void main(String[] args) throws Exception {
+    art.Test1966.run();
+  }
+}
diff --git a/test/1966-get-set-local-objects-no-table/src/art/Breakpoint.java b/test/1966-get-set-local-objects-no-table/src/art/Breakpoint.java
new file mode 120000
index 0000000..3673916
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/src/art/Breakpoint.java
@@ -0,0 +1 @@
+../../../jvmti-common/Breakpoint.java
\ No newline at end of file
diff --git a/test/1966-get-set-local-objects-no-table/src/art/Locals.java b/test/1966-get-set-local-objects-no-table/src/art/Locals.java
new file mode 120000
index 0000000..2998386
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/src/art/Locals.java
@@ -0,0 +1 @@
+../../../jvmti-common/Locals.java
\ No newline at end of file
diff --git a/test/1966-get-set-local-objects-no-table/src/art/StackTrace.java b/test/1966-get-set-local-objects-no-table/src/art/StackTrace.java
new file mode 120000
index 0000000..e1a08aa
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/src/art/StackTrace.java
@@ -0,0 +1 @@
+../../../jvmti-common/StackTrace.java
\ No newline at end of file
diff --git a/test/1966-get-set-local-objects-no-table/src/art/Suspension.java b/test/1966-get-set-local-objects-no-table/src/art/Suspension.java
new file mode 120000
index 0000000..bcef96f
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/src/art/Suspension.java
@@ -0,0 +1 @@
+../../../jvmti-common/Suspension.java
\ No newline at end of file
diff --git a/test/1966-get-set-local-objects-no-table/src/art/Test1966.java b/test/1966-get-set-local-objects-no-table/src/art/Test1966.java
new file mode 100644
index 0000000..00f3c4e
--- /dev/null
+++ b/test/1966-get-set-local-objects-no-table/src/art/Test1966.java
@@ -0,0 +1,237 @@
+/*
+ * 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.
+ */
+
+package art;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Executable;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.Semaphore;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.function.IntConsumer;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+public class Test1966 {
+  public static final String TARGET_VAR = "TARGET";
+
+  public static interface TestInterface {
+    public default void doNothing() {}
+  }
+  public static class TestClass1 implements TestInterface {
+    public String id;
+    public TestClass1(String id) {
+      this.id = id;
+    }
+    public String toString() {
+      return String.format("TestClass1(\"%s\")", id);
+    }
+
+    public static TestInterface createInterface(String id) {
+      return new TestClass1(id);
+    }
+    public static TestClass1 createExact(String id) {
+      return new TestClass1(id);
+    }
+    public static Object create(String id) {
+      return new TestClass1(id);
+    }
+  }
+
+  public static class TestClass1ext extends TestClass1 {
+    public TestClass1ext(String id) {
+      super(id);
+    }
+    public String toString() {
+      return String.format("TestClass1ext(\"%s\")", super.toString());
+    }
+  }
+  public static class TestClass2 {
+    public String id;
+    public TestClass2(String id) {
+      this.id = id;
+    }
+    public String toString() {
+      return String.format("TestClass2(\"%s\")", id);
+    }
+  }
+  public static class TestClass2impl extends TestClass2 implements TestInterface {
+    public TestClass2impl(String id) {
+      super(id);
+    }
+    public String toString() {
+      return String.format("TestClass2impl(\"%s\")", super.toString());
+    }
+  }
+
+  public static void reportValue(Object val) {
+    System.out.println("\tValue is '" + val +
+                       "' (class: " + (val != null ? val.getClass() : "NULL") + ")");
+  }
+
+  public static interface SafepointFunction {
+    public void invoke(Thread thread, Method target, int slot, int depth) throws Exception;
+  }
+
+  public static interface SetterFunction {
+    public void SetVar(Thread t, int depth, int slot, Object v);
+  }
+
+  public static interface GetterFunction { public Object GetVar(Thread t, int depth, int slot); }
+
+  public static SafepointFunction
+  NamedSet(final String type, final SetterFunction get, final Object v) {
+    return new SafepointFunction() {
+      public void invoke(Thread t, Method method, int slot, int depth) {
+        try {
+          get.SetVar(t, depth, slot, v);
+          System.out.println(this + " on " + method + " set value: " + v);
+        } catch (Exception e) {
+          System.out.println(this + " on " + method + " failed to set value " + v + " due to " +
+                             e.getMessage());
+        }
+      }
+      public String toString() {
+        return "\"Set" + type + "\"";
+      }
+    };
+  }
+
+  public static SafepointFunction NamedGet(final String type, final GetterFunction get) {
+    return new SafepointFunction() {
+      public void invoke(Thread t, Method method, int slot, int depth) {
+        try {
+          Object res = get.GetVar(t, depth, slot);
+          System.out.println(this + " on " + method + " got value: " + res);
+        } catch (Exception e) {
+          System.out.println(this + " on " + method + " failed due to " + e.getMessage());
+        }
+      }
+      public String toString() {
+        return "\"Get" + type + "\"";
+      }
+    };
+  }
+
+  public static class TestCase {
+    public final Method target;
+
+    public TestCase(Method target) {
+      this.target = target;
+    }
+
+    public static class ThreadPauser implements IntConsumer {
+      public final Semaphore sem_wakeup_main;
+      public final Semaphore sem_wait;
+      public int slot = -1;
+
+      public ThreadPauser() {
+        sem_wakeup_main = new Semaphore(0);
+        sem_wait = new Semaphore(0);
+      }
+
+      public void accept(int i) {
+        try {
+          slot = i;
+          sem_wakeup_main.release();
+          sem_wait.acquire();
+        } catch (Exception e) {
+          throw new Error("Error with semaphores!", e);
+        }
+      }
+
+      public void waitForOtherThreadToPause() throws Exception {
+        sem_wakeup_main.acquire();
+      }
+
+      public void wakeupOtherThread() throws Exception {
+        sem_wait.release();
+      }
+    }
+
+    public void exec(final SafepointFunction safepoint) throws Exception {
+      System.out.println("Running " + target + " with " + safepoint + " on remote thread.");
+      final ThreadPauser pause = new ThreadPauser();
+      Thread remote = new Thread(() -> {
+        try {
+          target.invoke(null, pause);
+        } catch (Exception e) {
+          throw new Error("Error invoking remote thread " + Thread.currentThread(), e);
+        }
+      }, "remote thread for " + target + " with " + safepoint);
+      remote.start();
+      pause.waitForOtherThreadToPause();
+      try {
+        Suspension.suspend(remote);
+        StackTrace.StackFrameData frame = findStackFrame(remote);
+        safepoint.invoke(remote, target, pause.slot, frame.depth);
+      } finally {
+        Suspension.resume(remote);
+        pause.wakeupOtherThread();
+        remote.join();
+      }
+    }
+
+    private StackTrace.StackFrameData findStackFrame(Thread thr) {
+      for (StackTrace.StackFrameData frame : StackTrace.GetStackTrace(thr)) {
+        if (frame.method.equals(target)) {
+          return frame;
+        }
+      }
+      throw new Error("Unable to find stack frame in method " + target + " on thread " + thr);
+    }
+  }
+  public static Method getMethod(String name) throws Exception {
+    return Class.forName("art_test.TestCases1966").getDeclaredMethod(name, IntConsumer.class);
+  }
+
+  public static void run() throws Exception {
+    Locals.EnableLocalVariableAccess();
+    final TestCase[] MAIN_TEST_CASES = new TestCase[] {
+      new TestCase(getMethod("ObjectMethod")),
+      new TestCase(getMethod("CastInterfaceMethod")),
+      new TestCase(getMethod("CastExactMethod")),
+      new TestCase(getMethod("InterfaceMethod")),
+      new TestCase(getMethod("ExactClassMethod")),
+      new TestCase(getMethod("PrimitiveMethod")),
+      new TestCase(getMethod("NullMethod")),
+      new TestCase(getMethod("CastExactNullMethod")),
+      new TestCase(getMethod("CastInterfaceNullMethod")),
+    };
+
+    final SetterFunction set_obj = Locals::SetLocalVariableObject;
+    final SafepointFunction[] SAFEPOINTS = new SafepointFunction[] {
+      NamedGet("GetObject", Locals::GetLocalVariableObject),
+      NamedSet("Null", set_obj, null),
+      NamedSet("TestClass1", set_obj, new TestClass1("Set TestClass1")),
+      NamedSet("TestClass1ext", set_obj, new TestClass1ext("Set TestClass1ext")),
+      NamedSet("TestClass2", set_obj, new TestClass2("Set TestClass2")),
+      NamedSet("TestClass2impl", set_obj, new TestClass2impl("Set TestClass2impl")),
+    };
+
+    for (TestCase t : MAIN_TEST_CASES) {
+      for (SafepointFunction s : SAFEPOINTS) {
+        t.exec(s);
+      }
+    }
+  }
+}