1.1 --- a/src/cpu/sparc/vm/vtableStubs_sparc.cpp Tue Aug 08 12:02:01 2017 +0100 1.2 +++ b/src/cpu/sparc/vm/vtableStubs_sparc.cpp Fri Sep 29 14:30:05 2017 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -27,6 +27,7 @@ 1.11 #include "code/vtableStubs.hpp" 1.12 #include "interp_masm_sparc.hpp" 1.13 #include "memory/resourceArea.hpp" 1.14 +#include "oops/compiledICHolder.hpp" 1.15 #include "oops/instanceKlass.hpp" 1.16 #include "oops/klassVtable.hpp" 1.17 #include "runtime/sharedRuntime.hpp" 1.18 @@ -140,7 +141,8 @@ 1.19 MacroAssembler* masm = new MacroAssembler(&cb); 1.20 1.21 Register G3_Klass = G3_scratch; 1.22 - Register G5_interface = G5; // Passed in as an argument 1.23 + Register G5_icholder = G5; // Passed in as an argument 1.24 + Register G4_interface = G4_scratch; 1.25 Label search; 1.26 1.27 // Entry arguments: 1.28 @@ -164,14 +166,26 @@ 1.29 } 1.30 #endif /* PRODUCT */ 1.31 1.32 - Label throw_icce; 1.33 + Label L_no_such_interface; 1.34 1.35 Register L5_method = L5; 1.36 + 1.37 + // Receiver subtype check against REFC. 1.38 + __ ld_ptr(G5_icholder, CompiledICHolder::holder_klass_offset(), G4_interface); 1.39 __ lookup_interface_method(// inputs: rec. class, interface, itable index 1.40 - G3_Klass, G5_interface, itable_index, 1.41 + G3_Klass, G4_interface, itable_index, 1.42 + // outputs: scan temp. reg1, scan temp. reg2 1.43 + L5_method, L2, L3, 1.44 + L_no_such_interface, 1.45 + /*return_method=*/ false); 1.46 + 1.47 + // Get Method* and entrypoint for compiler 1.48 + __ ld_ptr(G5_icholder, CompiledICHolder::holder_metadata_offset(), G4_interface); 1.49 + __ lookup_interface_method(// inputs: rec. class, interface, itable index 1.50 + G3_Klass, G4_interface, itable_index, 1.51 // outputs: method, scan temp. reg 1.52 L5_method, L2, L3, 1.53 - throw_icce); 1.54 + L_no_such_interface); 1.55 1.56 #ifndef PRODUCT 1.57 if (DebugVtables) { 1.58 @@ -197,7 +211,7 @@ 1.59 __ JMP(G3_scratch, 0); 1.60 __ delayed()->nop(); 1.61 1.62 - __ bind(throw_icce); 1.63 + __ bind(L_no_such_interface); 1.64 AddressLiteral icce(StubRoutines::throw_IncompatibleClassChangeError_entry()); 1.65 __ jump_to(icce, G3_scratch); 1.66 __ delayed()->restore(); 1.67 @@ -232,7 +246,7 @@ 1.68 MacroAssembler::instr_size_for_decode_klass_not_null() : 0); 1.69 return basic + slop; 1.70 } else { 1.71 - const int basic = (28 LP64_ONLY(+ 6)) * BytesPerInstWord + 1.72 + const int basic = (48 LP64_ONLY(+ 6)) * BytesPerInstWord + 1.73 // shift;add for load_klass (only shift with zero heap based) 1.74 (UseCompressedClassPointers ? 1.75 MacroAssembler::instr_size_for_decode_klass_not_null() : 0);