1 /* |
1 /* |
2 * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2016, 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. |
503 receiver_type, is_virtual, |
503 receiver_type, is_virtual, |
504 call_does_dispatch, vtable_index); // out-parameters |
504 call_does_dispatch, vtable_index); // out-parameters |
505 speculative_receiver_type = receiver_type != NULL ? receiver_type->speculative_type() : NULL; |
505 speculative_receiver_type = receiver_type != NULL ? receiver_type->speculative_type() : NULL; |
506 } |
506 } |
507 |
507 |
|
508 // invoke-super-special |
|
509 if (iter().cur_bc_raw() == Bytecodes::_invokespecial && !orig_callee->is_object_initializer()) { |
|
510 ciInstanceKlass* calling_klass = method()->holder(); |
|
511 ciInstanceKlass* sender_klass = |
|
512 calling_klass->is_anonymous() ? calling_klass->host_klass() : |
|
513 calling_klass; |
|
514 if (sender_klass->is_interface()) { |
|
515 Node* receiver_node = stack(sp() - nargs); |
|
516 Node* cls_node = makecon(TypeKlassPtr::make(sender_klass)); |
|
517 Node* bad_type_ctrl = NULL; |
|
518 Node* casted_receiver = gen_checkcast(receiver_node, cls_node, &bad_type_ctrl); |
|
519 if (bad_type_ctrl != NULL) { |
|
520 PreserveJVMState pjvms(this); |
|
521 set_control(bad_type_ctrl); |
|
522 uncommon_trap(Deoptimization::Reason_class_check, |
|
523 Deoptimization::Action_none); |
|
524 } |
|
525 if (stopped()) { |
|
526 return; // MUST uncommon-trap? |
|
527 } |
|
528 set_stack(sp() - nargs, casted_receiver); |
|
529 } |
|
530 } |
|
531 |
508 // Note: It's OK to try to inline a virtual call. |
532 // Note: It's OK to try to inline a virtual call. |
509 // The call generator will not attempt to inline a polymorphic call |
533 // The call generator will not attempt to inline a polymorphic call |
510 // unless it knows how to optimize the receiver dispatch. |
534 // unless it knows how to optimize the receiver dispatch. |
511 bool try_inline = (C->do_inlining() || InlineAccessors); |
535 bool try_inline = (C->do_inlining() || InlineAccessors); |
512 |
536 |