Skip to content

Commit a67a679

Browse files
committed
8263679: C1: Remove vtable call
Reviewed-by: vlivanov, kvn
1 parent 11c8c78 commit a67a679

13 files changed

+11
-68
lines changed

src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -2075,13 +2075,6 @@ void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
20752075
add_call_info(code_offset(), op->info());
20762076
}
20772077

2078-
2079-
/* vtable-dispatch is not enabled for aarch64 platform*/
2080-
void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
2081-
ShouldNotReachHere();
2082-
}
2083-
2084-
20852078
void LIR_Assembler::emit_static_call_stub() {
20862079
address call_pc = __ pc();
20872080
address stub = __ start_a_stub(call_stub_size());

src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1941,12 +1941,6 @@ void LIR_Assembler::ic_call(LIR_OpJavaCall *op) {
19411941
add_call_info(code_offset(), op->info());
19421942
}
19431943

1944-
1945-
/* vtable-dispatch is not enabled for arm platforms */
1946-
void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
1947-
ShouldNotReachHere();
1948-
}
1949-
19501944
void LIR_Assembler::emit_static_call_stub() {
19511945
address call_pc = __ pc();
19521946
address stub = __ start_a_stub(call_stub_size());

src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -706,13 +706,6 @@ void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
706706
add_call_info(code_offset(), op->info());
707707
}
708708

709-
710-
/* vtable_call is not enabled for ppc platform */
711-
void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
712-
ShouldNotReachHere(); // ic_call is used instead.
713-
}
714-
715-
716709
void LIR_Assembler::explicit_null_check(Register addr, CodeEmitInfo* info) {
717710
ImplicitNullCheckStub* stub = new ImplicitNullCheckStub(code_offset(), info);
718711
__ null_check(addr, stub->entry());

src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2016, 2019 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -496,7 +496,6 @@ void LIR_Assembler::align_call(LIR_Code code) {
496496
case lir_dynamic_call:
497497
offset += NativeCall::call_far_pcrelative_displacement_offset;
498498
break;
499-
case lir_virtual_call: // currently, sparc-specific for niagara
500499
default: ShouldNotReachHere();
501500
}
502501
if ((offset & (NativeCall::call_far_pcrelative_displacement_alignment-1)) != 0) {
@@ -533,11 +532,6 @@ void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
533532
call(op, relocInfo::none);
534533
}
535534

536-
// not supported
537-
void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
538-
ShouldNotReachHere();
539-
}
540-
541535
void LIR_Assembler::move_regs(Register from_reg, Register to_reg) {
542536
if (from_reg != to_reg) __ z_lgr(to_reg, from_reg);
543537
}

src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -2884,7 +2884,6 @@ void LIR_Assembler::align_call(LIR_Code code) {
28842884
case lir_icvirtual_call:
28852885
offset += NativeCall::displacement_offset + NativeMovConstReg::instruction_size;
28862886
break;
2887-
case lir_virtual_call: // currently, sparc-specific for niagara
28882887
default: ShouldNotReachHere();
28892888
}
28902889
__ align(BytesPerWord, offset);
@@ -2907,12 +2906,6 @@ void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
29072906
}
29082907

29092908

2910-
/* Currently, vtable-dispatch is only enabled for sparc platforms */
2911-
void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
2912-
ShouldNotReachHere();
2913-
}
2914-
2915-
29162909
void LIR_Assembler::emit_static_call_stub() {
29172910
address call_pc = __ pc();
29182911
address stub = __ start_a_stub(call_stub_size());

src/hotspot/share/c1/c1_GraphBuilder.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,6 @@ void GraphBuilder::invoke(Bytecodes::Code code) {
20812081
code == Bytecodes::_invokeinterface;
20822082
Values* args = state()->pop_arguments(target->arg_size_no_receiver() + patching_appendix_arg);
20832083
Value recv = has_receiver ? apop() : NULL;
2084-
int vtable_index = Method::invalid_vtable_index;
20852084

20862085
// A null check is required here (when there is a receiver) for any of the following cases
20872086
// - invokespecial, always need a null check.
@@ -2121,7 +2120,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) {
21212120
}
21222121
}
21232122

2124-
Invoke* result = new Invoke(code, result_type, recv, args, vtable_index, target, state_before);
2123+
Invoke* result = new Invoke(code, result_type, recv, args, target, state_before);
21252124
// push result
21262125
append_split(result);
21272126

src/hotspot/share/c1/c1_Instruction.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -323,12 +323,11 @@ void BlockBegin::state_values_do(ValueVisitor* f) {
323323

324324

325325
Invoke::Invoke(Bytecodes::Code code, ValueType* result_type, Value recv, Values* args,
326-
int vtable_index, ciMethod* target, ValueStack* state_before)
326+
ciMethod* target, ValueStack* state_before)
327327
: StateSplit(result_type, state_before)
328328
, _code(code)
329329
, _recv(recv)
330330
, _args(args)
331-
, _vtable_index(vtable_index)
332331
, _target(target)
333332
{
334333
set_flag(TargetIsLoadedFlag, target->is_loaded());

src/hotspot/share/c1/c1_Instruction.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1248,21 +1248,19 @@ LEAF(Invoke, StateSplit)
12481248
Value _recv;
12491249
Values* _args;
12501250
BasicTypeList* _signature;
1251-
int _vtable_index;
12521251
ciMethod* _target;
12531252

12541253
public:
12551254
// creation
12561255
Invoke(Bytecodes::Code code, ValueType* result_type, Value recv, Values* args,
1257-
int vtable_index, ciMethod* target, ValueStack* state_before);
1256+
ciMethod* target, ValueStack* state_before);
12581257

12591258
// accessors
12601259
Bytecodes::Code code() const { return _code; }
12611260
Value receiver() const { return _recv; }
12621261
bool has_receiver() const { return receiver() != NULL; }
12631262
int number_of_arguments() const { return _args->length(); }
12641263
Value argument_at(int i) const { return _args->at(i); }
1265-
int vtable_index() const { return _vtable_index; }
12661264
BasicTypeList* signature() const { return _signature; }
12671265
ciMethod* target() const { return _target; }
12681266

src/hotspot/share/c1/c1_LIR.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,6 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
705705
case lir_static_call:
706706
case lir_optvirtual_call:
707707
case lir_icvirtual_call:
708-
case lir_virtual_call:
709708
case lir_dynamic_call: {
710709
LIR_OpJavaCall* opJavaCall = op->as_OpJavaCall();
711710
assert(opJavaCall != NULL, "must be");
@@ -1701,7 +1700,6 @@ const char * LIR_Op::name() const {
17011700
case lir_static_call: s = "static"; break;
17021701
case lir_optvirtual_call: s = "optvirtual"; break;
17031702
case lir_icvirtual_call: s = "icvirtual"; break;
1704-
case lir_virtual_call: s = "virtual"; break;
17051703
case lir_dynamic_call: s = "dynamic"; break;
17061704
// LIR_OpArrayCopy
17071705
case lir_arraycopy: s = "arraycopy"; break;

src/hotspot/share/c1/c1_LIR.hpp

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -961,7 +961,6 @@ enum LIR_Code {
961961
, lir_static_call
962962
, lir_optvirtual_call
963963
, lir_icvirtual_call
964-
, lir_virtual_call
965964
, lir_dynamic_call
966965
, end_opJavaCall
967966
, begin_opArrayCopy
@@ -1205,11 +1204,6 @@ class LIR_OpJavaCall: public LIR_OpCall {
12051204
method()->is_method_handle_intrinsic(); // JVM-generated MH intrinsic
12061205
}
12071206

1208-
intptr_t vtable_offset() const {
1209-
assert(_code == lir_virtual_call, "only have vtable for real vcall");
1210-
return (intptr_t) addr();
1211-
}
1212-
12131207
virtual void emit_code(LIR_Assembler* masm);
12141208
virtual LIR_OpJavaCall* as_OpJavaCall() { return this; }
12151209
virtual void print_instr(outputStream* out) const PRODUCT_RETURN;
@@ -2054,10 +2048,6 @@ class LIR_List: public CompilationResourceObj {
20542048
address dest, LIR_OprList* arguments, CodeEmitInfo* info) {
20552049
append(new LIR_OpJavaCall(lir_icvirtual_call, method, receiver, result, dest, arguments, info));
20562050
}
2057-
void call_virtual(ciMethod* method, LIR_Opr receiver, LIR_Opr result,
2058-
intptr_t vtable_offset, LIR_OprList* arguments, CodeEmitInfo* info) {
2059-
append(new LIR_OpJavaCall(lir_virtual_call, method, receiver, result, vtable_offset, arguments, info));
2060-
}
20612051
void call_dynamic(ciMethod* method, LIR_Opr receiver, LIR_Opr result,
20622052
address dest, LIR_OprList* arguments, CodeEmitInfo* info) {
20632053
append(new LIR_OpJavaCall(lir_dynamic_call, method, receiver, result, dest, arguments, info));

src/hotspot/share/c1/c1_LIRAssembler.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,6 @@ void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
468468
case lir_icvirtual_call:
469469
ic_call(op);
470470
break;
471-
case lir_virtual_call:
472-
vtable_call(op);
473-
break;
474471
default:
475472
fatal("unexpected op code: %s", op->name());
476473
break;

src/hotspot/share/c1/c1_LIRGenerator.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -2958,14 +2958,10 @@ void LIRGenerator::do_Invoke(Invoke* x) {
29582958
__ call_opt_virtual(target, receiver, result_register,
29592959
SharedRuntime::get_resolve_opt_virtual_call_stub(),
29602960
arg_list, info);
2961-
} else if (x->vtable_index() < 0) {
2961+
} else {
29622962
__ call_icvirtual(target, receiver, result_register,
29632963
SharedRuntime::get_resolve_virtual_call_stub(),
29642964
arg_list, info);
2965-
} else {
2966-
int entry_offset = in_bytes(Klass::vtable_start_offset()) + x->vtable_index() * vtableEntry::size_in_bytes();
2967-
int vtable_offset = entry_offset + vtableEntry::method_offset_in_bytes();
2968-
__ call_virtual(target, receiver, result_register, vtable_offset, arg_list, info);
29692965
}
29702966
break;
29712967
case Bytecodes::_invokedynamic: {

src/hotspot/share/c1/c1_LinearScan.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -6660,8 +6660,7 @@ void LinearScanStatistic::collect(LinearScan* allocator) {
66606660

66616661
case lir_rtcall:
66626662
case lir_static_call:
6663-
case lir_optvirtual_call:
6664-
case lir_virtual_call: inc_counter(counter_call); break;
6663+
case lir_optvirtual_call: inc_counter(counter_call); break;
66656664

66666665
case lir_move: {
66676666
inc_counter(counter_move);

0 commit comments

Comments
 (0)