1 Star 0 Fork 72

kuneking_org/openjdk-11

forked from src-openEuler/openjdk-11 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
8248336-AArch64-C2-offset-overflow-in-BoxLockNode-em.patch 1.57 KB
一键复制 编辑 原始数据 按行查看 历史
From 3070d796490221304ef226560ad2a837c3de4401 Mon Sep 17 00:00:00 2001
Date: Sat, 31 Oct 2020 14:17:53 +0800
Subject: [PATCH] 8248336: AArch64: C2: offset overflow in BoxLockNode::emit
Summary: <C2>: offset overflow in BoxLockNode::emit
LLT: jtreg
Bug url: https://bugs.openjdk.java.net/browse/JDK-8248336
---
src/hotspot/cpu/aarch64/aarch64.ad | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad
index 827ec9e..617b2b8 100644
--- a/src/hotspot/cpu/aarch64/aarch64.ad
+++ b/src/hotspot/cpu/aarch64/aarch64.ad
@@ -2071,16 +2071,20 @@ void BoxLockNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
int offset = ra_->reg2offset(in_RegMask(0).find_first_elem());
int reg = ra_->get_encode(this);
- if (Assembler::operand_valid_for_add_sub_immediate(offset)) {
- __ add(as_Register(reg), sp, offset);
- } else {
- ShouldNotReachHere();
- }
+ // This add will handle any 24-bit signed offset. 24 bits allows an
+ // 8 megabyte stack frame.
+ __ add(as_Register(reg), sp, offset);
}
uint BoxLockNode::size(PhaseRegAlloc *ra_) const {
// BoxLockNode is not a MachNode, so we can't just call MachNode::size(ra_).
- return 4;
+ int offset = ra_->reg2offset(in_RegMask(0).find_first_elem());
+
+ if (Assembler::operand_valid_for_add_sub_immediate(offset)) {
+ return NativeInstruction::instruction_size;
+ } else {
+ return 2 * NativeInstruction::instruction_size;
+ }
}
//=============================================================================
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/kuenking/openjdk-11.git
git@gitee.com:kuenking/openjdk-11.git
kuenking
openjdk-11
openjdk-11
master

搜索帮助