1 /*
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
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
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
346 }
347 BLOCK_COMMENT("} check_receiver");
348 }
349 if (iid == vmIntrinsics::_linkToSpecial ||
350 iid == vmIntrinsics::_linkToStatic) {
351 DEBUG_ONLY(temp1_recv_klass = noreg); // these guys didn't load the recv_klass
352 }
353
354 // Live registers at this point:
355 // member_reg - MemberName that was the trailing argument
356 // temp1_recv_klass - klass of stacked receiver, if needed
357 // O5_savedSP - interpreter linkage (if interpreted)
358 // O0..O5 - compiler arguments (if compiled)
359
360 Label L_incompatible_class_change_error;
361 switch (iid) {
362 case vmIntrinsics::_linkToSpecial:
363 if (VerifyMethodHandles) {
364 verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp2);
365 }
366 __ load_heap_oop(member_reg, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), member_reg);
367 __ ld(R19_method, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes()), member_reg);
368 break;
369
370 case vmIntrinsics::_linkToStatic:
371 if (VerifyMethodHandles) {
372 verify_ref_kind(_masm, JVM_REF_invokeStatic, member_reg, temp2);
373 }
374 __ load_heap_oop(member_reg, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), member_reg);
375 __ ld(R19_method, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes()), member_reg);
376 break;
377
378 case vmIntrinsics::_linkToVirtual:
379 {
380 // same as TemplateTable::invokevirtual,
381 // minus the CP setup and profiling:
382
383 if (VerifyMethodHandles) {
384 verify_ref_kind(_masm, JVM_REF_invokeVirtual, member_reg, temp2);
385 }
386
387 // pick out the vtable index from the MemberName, and then we can discard it:
388 Register temp2_index = temp2;
389 __ ld(temp2_index, NONZERO(java_lang_invoke_MemberName::vmindex_offset_in_bytes()), member_reg);
390
391 if (VerifyMethodHandles) {
392 Label L_index_ok;
393 __ cmpdi(CCR1, temp2_index, 0);
394 __ bge(CCR1, L_index_ok);
395 __ stop("no virtual index");
|
1 /*
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2012, 2017 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
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
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
346 }
347 BLOCK_COMMENT("} check_receiver");
348 }
349 if (iid == vmIntrinsics::_linkToSpecial ||
350 iid == vmIntrinsics::_linkToStatic) {
351 DEBUG_ONLY(temp1_recv_klass = noreg); // these guys didn't load the recv_klass
352 }
353
354 // Live registers at this point:
355 // member_reg - MemberName that was the trailing argument
356 // temp1_recv_klass - klass of stacked receiver, if needed
357 // O5_savedSP - interpreter linkage (if interpreted)
358 // O0..O5 - compiler arguments (if compiled)
359
360 Label L_incompatible_class_change_error;
361 switch (iid) {
362 case vmIntrinsics::_linkToSpecial:
363 if (VerifyMethodHandles) {
364 verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp2);
365 }
366 __ load_heap_oop(R19_method, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), member_reg);
367 __ ld(R19_method, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes()), R19_method);
368 break;
369
370 case vmIntrinsics::_linkToStatic:
371 if (VerifyMethodHandles) {
372 verify_ref_kind(_masm, JVM_REF_invokeStatic, member_reg, temp2);
373 }
374 __ load_heap_oop(R19_method, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), member_reg);
375 __ ld(R19_method, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes()), R19_method);
376 break;
377
378 case vmIntrinsics::_linkToVirtual:
379 {
380 // same as TemplateTable::invokevirtual,
381 // minus the CP setup and profiling:
382
383 if (VerifyMethodHandles) {
384 verify_ref_kind(_masm, JVM_REF_invokeVirtual, member_reg, temp2);
385 }
386
387 // pick out the vtable index from the MemberName, and then we can discard it:
388 Register temp2_index = temp2;
389 __ ld(temp2_index, NONZERO(java_lang_invoke_MemberName::vmindex_offset_in_bytes()), member_reg);
390
391 if (VerifyMethodHandles) {
392 Label L_index_ok;
393 __ cmpdi(CCR1, temp2_index, 0);
394 __ bge(CCR1, L_index_ok);
395 __ stop("no virtual index");
|