bool Mir2Lir::GenInlinedCurrentThread(CallInfo* info) {
RegLocation rl_dest = InlineTarget(info);
+
+ // Early exit if the result is unused.
+ if (rl_dest.orig_sreg < 0) {
+ return true;
+ }
+
RegLocation rl_result = EvalLoc(rl_dest, kRefReg, true);
switch (cu_->instruction_set) {
test_String_indexOf();
test_String_isEmpty();
test_String_length();
+ test_Thread_currentThread();
}
/*
return (b - a) < maxDelta;
}
+ /**
+ * Will test inlining Thread.currentThread().
+ */
+ public static void test_Thread_currentThread() {
+ // 1. Do not use result.
+ Thread.currentThread();
+
+ // 2. Result should not be null.
+ Assert.assertNotNull(Thread.currentThread());
+ }
+
public static void test_String_length() {
String str0 = "";
String str1 = "x";