1 /* |
1 /* |
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. |
3 * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * |
5 * |
6 * This code is free software; you can redistribute it and/or modify it |
6 * This code is free software; you can redistribute it and/or modify it |
7 * under the terms of the GNU General Public License version 2 only, as |
7 * under the terms of the GNU General Public License version 2 only, as |
2050 __ bind(dtrace_method_exit_done); |
2050 __ bind(dtrace_method_exit_done); |
2051 } |
2051 } |
2052 |
2052 |
2053 __ reset_last_Java_frame(false); |
2053 __ reset_last_Java_frame(false); |
2054 |
2054 |
2055 // Unpack oop result |
2055 // Unbox oop result, e.g. JNIHandles::resolve result. |
2056 if (ret_type == T_OBJECT || ret_type == T_ARRAY) { |
2056 if (ret_type == T_OBJECT || ret_type == T_ARRAY) { |
2057 Label L; |
2057 Label done, not_weak; |
2058 __ cbz(r0, L); |
2058 __ cbz(r0, done); // Use NULL as-is. |
2059 __ ldr(r0, Address(r0, 0)); |
2059 STATIC_ASSERT(JNIHandles::weak_tag_mask == 1u); |
2060 __ bind(L); |
2060 __ tbz(r0, 0, not_weak); // Test for jweak tag. |
2061 __ verify_oop(r0); |
2061 // Resolve jweak. |
|
2062 __ ldr(r0, Address(r0, -JNIHandles::weak_tag_value)); |
|
2063 __ verify_oop(r0); |
|
2064 #if INCLUDE_ALL_GCS |
|
2065 if (UseG1GC) { |
|
2066 __ g1_write_barrier_pre(noreg /* obj */, |
|
2067 r0 /* pre_val */, |
|
2068 rthread /* thread */, |
|
2069 rscratch1 /* tmp */, |
|
2070 true /* tosca_live */, |
|
2071 true /* expand_call */); |
|
2072 } |
|
2073 #endif // INCLUDE_ALL_GCS |
|
2074 __ b(done); |
|
2075 __ bind(not_weak); |
|
2076 // Resolve (untagged) jobject. |
|
2077 __ ldr(r0, Address(r0, 0)); |
|
2078 __ verify_oop(r0); |
|
2079 __ bind(done); |
2062 } |
2080 } |
2063 |
2081 |
2064 if (CheckJNICalls) { |
2082 if (CheckJNICalls) { |
2065 // clear_pending_jni_exception_check |
2083 // clear_pending_jni_exception_check |
2066 __ str(zr, Address(rthread, JavaThread::pending_jni_exception_check_fn_offset())); |
2084 __ str(zr, Address(rthread, JavaThread::pending_jni_exception_check_fn_offset())); |