Ensure invoking obsolete methods throws errors.

This sets the entrypoint for obsolete methods to a special stub that
will ensure that calling them results in an Error being thrown.
Previously we were allowing obsolete methods to be run if they could
reach the appropriate places in the runtime.

Getting into the state where this is possible is extremely difficult
since one can only get an jmethodID to an obsolete method by snatching
it off the stack (or by inspecting internal runtime data). From there
normally invoking it will do lookup on the receiver which will get you
the original version.

Bug: 36867251
Bug: 31455788

Test: ./test.py --host -j40
Test: (with aosp_marlin-userdebug device) ./test.py --target -j4

Change-Id: I2ca0503966a4e3de18dd89cb7ff224eba1459b49
diff --git a/runtime/openjdkjvmti/ti_redefine.cc b/runtime/openjdkjvmti/ti_redefine.cc
index 6e0d9a0..7d95de8 100644
--- a/runtime/openjdkjvmti/ti_redefine.cc
+++ b/runtime/openjdkjvmti/ti_redefine.cc
@@ -186,6 +186,7 @@
         DCHECK_EQ(new_obsolete_method->GetDeclaringClass(), old_method->GetDeclaringClass());
         new_obsolete_method->SetIsObsolete();
         new_obsolete_method->SetDontCompile();
+        cl->SetEntryPointsForObsoleteMethod(new_obsolete_method);
         obsolete_maps_->RecordObsolete(old_method, new_obsolete_method);
         // Update JIT Data structures to point to the new method.
         art::jit::Jit* jit = art::Runtime::Current()->GetJit();