equal
deleted
inserted
replaced
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 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
692 if (_set && slot_type == T_OBJECT && jobj != NULL) { // NULL reference is allowed |
692 if (_set && slot_type == T_OBJECT && jobj != NULL) { // NULL reference is allowed |
693 // Check that the jobject class matches the return type signature. |
693 // Check that the jobject class matches the return type signature. |
694 JavaThread* cur_thread = JavaThread::current(); |
694 JavaThread* cur_thread = JavaThread::current(); |
695 HandleMark hm(cur_thread); |
695 HandleMark hm(cur_thread); |
696 |
696 |
697 Handle obj = Handle(cur_thread, JNIHandles::resolve_external_guard(jobj)); |
697 Handle obj(cur_thread, JNIHandles::resolve_external_guard(jobj)); |
698 NULL_CHECK(obj, (_result = JVMTI_ERROR_INVALID_OBJECT, false)); |
698 NULL_CHECK(obj, (_result = JVMTI_ERROR_INVALID_OBJECT, false)); |
699 KlassHandle ob_kh = KlassHandle(cur_thread, obj->klass()); |
699 KlassHandle ob_kh = KlassHandle(cur_thread, obj->klass()); |
700 NULL_CHECK(ob_kh, (_result = JVMTI_ERROR_INVALID_OBJECT, false)); |
700 NULL_CHECK(ob_kh, (_result = JVMTI_ERROR_INVALID_OBJECT, false)); |
701 |
701 |
702 if (!is_assignable(signature, ob_kh(), cur_thread)) { |
702 if (!is_assignable(signature, ob_kh(), cur_thread)) { |
775 case T_INT: locals->set_int_at (_index, _value.i); break; |
775 case T_INT: locals->set_int_at (_index, _value.i); break; |
776 case T_LONG: locals->set_long_at (_index, _value.j); break; |
776 case T_LONG: locals->set_long_at (_index, _value.j); break; |
777 case T_FLOAT: locals->set_float_at (_index, _value.f); break; |
777 case T_FLOAT: locals->set_float_at (_index, _value.f); break; |
778 case T_DOUBLE: locals->set_double_at(_index, _value.d); break; |
778 case T_DOUBLE: locals->set_double_at(_index, _value.d); break; |
779 case T_OBJECT: { |
779 case T_OBJECT: { |
780 Handle ob_h(JNIHandles::resolve_external_guard(_value.l)); |
780 Handle ob_h(Thread::current(), JNIHandles::resolve_external_guard(_value.l)); |
781 locals->set_obj_at (_index, ob_h); |
781 locals->set_obj_at (_index, ob_h); |
782 break; |
782 break; |
783 } |
783 } |
784 default: ShouldNotReachHere(); |
784 default: ShouldNotReachHere(); |
785 } |
785 } |