Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,6 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
__ b(_continuation);
}

RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _index(index), _array(), _throw_index_out_of_bounds_exception(true) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

void RangeCheckStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
if (_info->deoptimize_on_exception()) {
Expand Down Expand Up @@ -208,14 +196,6 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
assert(_result->as_register() == r0, "result must in r0");
__ b(_continuation);
}
// Implementation of MonitorAccessStubs

MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
: MonitorAccessStub(obj_reg, lock_reg)
{
_info = new CodeEmitInfo(info);
}


void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
assert(__ rsp_offset() == 0, "frame size should be fixed");
Expand Down
7 changes: 6 additions & 1 deletion src/hotspot/cpu/aarch64/c1_Defs_aarch64.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -82,4 +82,9 @@ enum {
pd_two_operand_lir_form = false
};

// the number of stack required by ArrayCopyStub
enum {
pd_arraycopystub_reserved_argument_area_size = 2
};

#endif // CPU_AARCH64_C1_DEFS_AARCH64_HPP
26 changes: 0 additions & 26 deletions src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,6 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
__ b(_continuation);
}


// TODO: ARM - is it possible to inline these stubs into the main code stream?


RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != nullptr, "must have info");
_info = new CodeEmitInfo(info);
}

RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _index(index), _array(), _throw_index_out_of_bounds_exception(true) {
assert(info != nullptr, "must have info");
_info = new CodeEmitInfo(info);
}

void RangeCheckStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);

Expand Down Expand Up @@ -192,16 +176,6 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
__ b(_continuation);
}


// Implementation of MonitorAccessStubs

MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
: MonitorAccessStub(obj_reg, lock_reg)
{
_info = new CodeEmitInfo(info);
}


void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
const Register obj_reg = _obj_reg->as_pointer_register();
Expand Down
7 changes: 6 additions & 1 deletion src/hotspot/cpu/arm/c1_Defs_arm.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -78,6 +78,11 @@ enum {
pd_two_operand_lir_form = false
};

// the number of stack required by ArrayCopyStub
enum {
pd_arraycopystub_reserved_argument_area_size = 2
};

#define PATCHED_ADDR (204)
#define CARDTABLEBARRIERSET_POST_BARRIER_HELPER

Expand Down
19 changes: 0 additions & 19 deletions src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,6 @@ void C1SafepointPollStub::emit_code(LIR_Assembler* ce) {
}
}

RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _index(index), _array(), _throw_index_out_of_bounds_exception(true) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

void RangeCheckStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);

Expand Down Expand Up @@ -282,13 +270,6 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
__ b(_continuation);
}


// Implementation of MonitorAccessStubs
MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
: MonitorAccessStub(obj_reg, lock_reg) {
_info = new CodeEmitInfo(info);
}

void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? Runtime1::monitorenter_id : Runtime1::monitorenter_nofpu_id);
Expand Down
7 changes: 6 additions & 1 deletion src/hotspot/cpu/ppc/c1_Defs_ppc.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -77,4 +77,9 @@ enum {
pd_two_operand_lir_form = false
};

// the number of stack required by ArrayCopyStub
enum {
pd_arraycopystub_reserved_argument_area_size = 2
};

#endif // CPU_PPC_C1_DEFS_PPC_HPP
18 changes: 0 additions & 18 deletions src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,6 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
__ j(_continuation);
}

RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _index(index), _array(), _throw_index_out_of_bounds_exception(true) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

void RangeCheckStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
if (_info->deoptimize_on_exception()) {
Expand Down Expand Up @@ -205,12 +193,6 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
__ j(_continuation);
}

// Implementation of MonitorAccessStubs
MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
: MonitorAccessStub(obj_reg, lock_reg) {
_info = new CodeEmitInfo(info);
}

void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
assert(__ rsp_offset() == 0, "frame size should be fixed");
__ bind(_entry);
Expand Down
7 changes: 6 additions & 1 deletion src/hotspot/cpu/riscv/c1_Defs_riscv.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -85,4 +85,9 @@ enum {
pd_two_operand_lir_form = false
};

// the number of stack required by ArrayCopyStub
enum {
pd_arraycopystub_reserved_argument_area_size = 2
};

#endif // CPU_RISCV_C1_DEFS_RISCV_HPP
17 changes: 0 additions & 17 deletions src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ void C1SafepointPollStub::emit_code(LIR_Assembler* ce) {
ShouldNotReachHere();
}

RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _index(index), _array(), _throw_index_out_of_bounds_exception(true) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

void RangeCheckStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
if (_info->deoptimize_on_exception()) {
Expand Down Expand Up @@ -227,11 +215,6 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
__ z_brul(_continuation);
}

MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
: MonitorAccessStub(obj_reg, lock_reg) {
_info = new CodeEmitInfo(info);
}

void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
Runtime1::StubID enter_id;
Expand Down
7 changes: 6 additions & 1 deletion src/hotspot/cpu/s390/c1_Defs_s390.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -72,4 +72,9 @@ enum {
pd_two_operand_lir_form = true
};

// the number of stack required by ArrayCopyStub
enum {
pd_arraycopystub_reserved_argument_area_size = 2
};

#endif // CPU_S390_C1_DEFS_S390_HPP
22 changes: 0 additions & 22 deletions src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,6 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
__ jmp(_continuation);
}

RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _index(index), _array(), _throw_index_out_of_bounds_exception(true) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

void RangeCheckStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
if (_info->deoptimize_on_exception()) {
Expand Down Expand Up @@ -254,16 +242,6 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
__ jmp(_continuation);
}


// Implementation of MonitorAccessStubs

MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
: MonitorAccessStub(obj_reg, lock_reg)
{
_info = new CodeEmitInfo(info);
}


void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
assert(__ rsp_offset() == 0, "frame size should be fixed");
__ bind(_entry);
Expand Down
7 changes: 6 additions & 1 deletion src/hotspot/cpu/x86/c1_Defs_x86.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -79,4 +79,9 @@ enum {
pd_two_operand_lir_form = true
};

// the number of stack required by ArrayCopyStub
enum {
pd_arraycopystub_reserved_argument_area_size = 5
};

#endif // CPU_X86_C1_DEFS_X86_HPP
39 changes: 33 additions & 6 deletions src/hotspot/share/c1/c1_CodeStubs.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -110,6 +110,8 @@ class CounterOverflowStub: public CodeStub {

public:
CounterOverflowStub(CodeEmitInfo* info, int bci, LIR_Opr method) : _info(info), _bci(bci), _method(method) {
FrameMap* f = Compilation::current()->frame_map();
f->update_reserved_argument_area_size(2 * BytesPerWord);
}

virtual void emit_code(LIR_Assembler* e);
Expand Down Expand Up @@ -166,9 +168,21 @@ class RangeCheckStub: public CodeStub {

public:
// For ArrayIndexOutOfBoundsException.
RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array);
RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
FrameMap* f = Compilation::current()->frame_map();
f->update_reserved_argument_area_size(2 * BytesPerWord);
}
// For IndexOutOfBoundsException.
RangeCheckStub(CodeEmitInfo* info, LIR_Opr index);
RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _index(index), _array(), _throw_index_out_of_bounds_exception(true) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
FrameMap* f = Compilation::current()->frame_map();
f->update_reserved_argument_area_size(2 * BytesPerWord);
}
virtual void emit_code(LIR_Assembler* e);
virtual CodeEmitInfo* info() const { return _info; }
virtual bool is_exception_throw_stub() const { return true; }
Expand Down Expand Up @@ -335,7 +349,12 @@ class MonitorEnterStub: public MonitorAccessStub {
CodeEmitInfo* _info;

public:
MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info);
MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
: MonitorAccessStub(obj_reg, lock_reg) {
_info = new CodeEmitInfo(info);
FrameMap* f = Compilation::current()->frame_map();
f->update_reserved_argument_area_size(2 * BytesPerWord);
}

virtual void emit_code(LIR_Assembler* e);
virtual CodeEmitInfo* info() const { return _info; }
Expand Down Expand Up @@ -476,7 +495,10 @@ class DeoptimizeStub : public CodeStub {

public:
DeoptimizeStub(CodeEmitInfo* info, Deoptimization::DeoptReason reason, Deoptimization::DeoptAction action) :
_info(new CodeEmitInfo(info)), _trap_request(Deoptimization::make_trap_request(reason, action)) {}
_info(new CodeEmitInfo(info)), _trap_request(Deoptimization::make_trap_request(reason, action)) {
FrameMap* f = Compilation::current()->frame_map();
f->update_reserved_argument_area_size(2 * BytesPerWord);
}

virtual void emit_code(LIR_Assembler* e);
virtual CodeEmitInfo* info() const { return _info; }
Expand All @@ -499,6 +521,8 @@ class SimpleExceptionStub: public CodeStub {
public:
SimpleExceptionStub(Runtime1::StubID stub, LIR_Opr obj, CodeEmitInfo* info):
_obj(obj), _stub(stub), _info(info) {
FrameMap* f = Compilation::current()->frame_map();
f->update_reserved_argument_area_size(2 * BytesPerWord);
}

void set_obj(LIR_Opr obj) {
Expand Down Expand Up @@ -534,7 +558,10 @@ class ArrayCopyStub: public CodeStub {
LIR_OpArrayCopy* _op;

public:
ArrayCopyStub(LIR_OpArrayCopy* op): _op(op) { }
ArrayCopyStub(LIR_OpArrayCopy* op): _op(op) {
FrameMap* f = Compilation::current()->frame_map();
f->update_reserved_argument_area_size(arraycopystub_reserved_argument_area_size * BytesPerWord);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about moving the CPU-specific value to CPU-specific code? Maybe c1_Defs_<cpu>.hpp?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


LIR_Opr src() const { return _op->src(); }
LIR_Opr src_pos() const { return _op->src_pos(); }
Expand Down
Loading