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. |
475 receiver_type, is_virtual, |
475 receiver_type, is_virtual, |
476 call_does_dispatch, vtable_index); // out-parameters |
476 call_does_dispatch, vtable_index); // out-parameters |
477 speculative_receiver_type = receiver_type != NULL ? receiver_type->speculative_type() : NULL; |
477 speculative_receiver_type = receiver_type != NULL ? receiver_type->speculative_type() : NULL; |
478 } |
478 } |
479 |
479 |
|
480 // invoke-super-special |
|
481 if (iter().cur_bc_raw() == Bytecodes::_invokespecial && !orig_callee->is_object_initializer()) { |
|
482 ciInstanceKlass* calling_klass = method()->holder(); |
|
483 ciInstanceKlass* sender_klass = |
|
484 calling_klass->is_anonymous() ? calling_klass->host_klass() : |
|
485 calling_klass; |
|
486 if (sender_klass->is_interface()) { |
|
487 Node* receiver_node = stack(sp() - nargs); |
|
488 Node* cls_node = makecon(TypeKlassPtr::make(sender_klass)); |
|
489 Node* bad_type_ctrl = NULL; |
|
490 Node* casted_receiver = gen_checkcast(receiver_node, cls_node, &bad_type_ctrl); |
|
491 if (bad_type_ctrl != NULL) { |
|
492 PreserveJVMState pjvms(this); |
|
493 set_control(bad_type_ctrl); |
|
494 uncommon_trap(Deoptimization::Reason_class_check, |
|
495 Deoptimization::Action_none); |
|
496 } |
|
497 if (stopped()) { |
|
498 return; // MUST uncommon-trap? |
|
499 } |
|
500 set_stack(sp() - nargs, casted_receiver); |
|
501 } |
|
502 } |
|
503 |
480 // Note: It's OK to try to inline a virtual call. |
504 // Note: It's OK to try to inline a virtual call. |
481 // The call generator will not attempt to inline a polymorphic call |
505 // The call generator will not attempt to inline a polymorphic call |
482 // unless it knows how to optimize the receiver dispatch. |
506 // unless it knows how to optimize the receiver dispatch. |
483 bool try_inline = (C->do_inlining() || InlineAccessors); |
507 bool try_inline = (C->do_inlining() || InlineAccessors); |
484 |
508 |