Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
39568aea
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
39568aea
编写于
12月 14, 2015
作者:
L
lbourges
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8145055: Marlin renderer causes unaligned write accesses
Reviewed-by: flar, prr
上级
32a26a30
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
6 deletion
+21
-6
src/share/classes/sun/java2d/marlin/MarlinCache.java
src/share/classes/sun/java2d/marlin/MarlinCache.java
+19
-6
src/share/classes/sun/java2d/marlin/MarlinConst.java
src/share/classes/sun/java2d/marlin/MarlinConst.java
+2
-0
未找到文件。
src/share/classes/sun/java2d/marlin/MarlinCache.java
浏览文件 @
39568aea
...
...
@@ -156,8 +156,6 @@ public final class MarlinCache implements MarlinConst {
// rewritten to avoid division:
||
(
width
*
heightSubPixel
)
>
((
edgeSumDeltaY
-
heightSubPixel
)
<<
BLOCK_SIZE_LG
);
// ((edgeSumDeltaY - heightSubPixel) * RLE_THRESHOLD);
// ((edgeSumDeltaY - heightSubPixel) << BLOCK_TH_LG);
if
(
doTrace
&&
!
useRLE
)
{
final
float
meanCrossings
...
...
@@ -293,8 +291,10 @@ public final class MarlinCache implements MarlinConst {
// update row index to current position:
rowAAChunkIndex
[
row
]
=
pos
;
// determine need array size (may overflow):
final
long
needSize
=
pos
+
(
px_bbox1
-
px0
);
// determine need array size:
// for RLE encoding, position must be aligned to 4 bytes (int):
// align - 1 = 3 so add +3 and round-off by mask ~3 = -4
final
long
needSize
=
pos
+
((
px_bbox1
-
px0
+
3
)
&
-
4
);
// update next position (bytes):
rowAAChunkPos
=
needSize
;
...
...
@@ -401,8 +401,7 @@ public final class MarlinCache implements MarlinConst {
// determine need array size:
// pessimistic: max needed size = deltaX x 4 (1 int)
final
int
maxLen
=
(
to
-
from
);
final
long
needSize
=
initialPos
+
(
maxLen
<<
2
);
final
long
needSize
=
initialPos
+
((
to
-
from
)
<<
2
);
// update row data:
OffHeapArray
_rowAAChunk
=
rowAAChunk
;
...
...
@@ -465,6 +464,13 @@ public final class MarlinCache implements MarlinConst {
// note: last pixel exclusive (>= 0)
// note: it should check X is smaller than 23bits (overflow)!
// check address alignment to 4 bytes:
if
(
doCheckUnsafe
)
{
if
((
addr_off
&
3
)
!=
0
)
{
MarlinUtils
.
logInfo
(
"Misaligned Unsafe address: "
+
addr_off
);
}
}
// special case to encode entries into a single int:
if
(
val
==
0
)
{
_unsafe
.
putInt
(
addr_off
,
...
...
@@ -521,6 +527,13 @@ public final class MarlinCache implements MarlinConst {
// note: last pixel exclusive (>= 0)
// note: it should check X is smaller than 23bits (overflow)!
// check address alignment to 4 bytes:
if
(
doCheckUnsafe
)
{
if
((
addr_off
&
3
)
!=
0
)
{
MarlinUtils
.
logInfo
(
"Misaligned Unsafe address: "
+
addr_off
);
}
}
// special case to encode entries into a single int:
if
(
val
==
0
)
{
_unsafe
.
putInt
(
addr_off
,
...
...
src/share/classes/sun/java2d/marlin/MarlinConst.java
浏览文件 @
39568aea
...
...
@@ -40,6 +40,8 @@ interface MarlinConst {
// log misc.Unsafe alloc/realloc/free
static
final
boolean
logUnsafeMalloc
=
enableLogs
&&
MarlinProperties
.
isLogUnsafeMalloc
();
// do check unsafe alignment:
static
final
boolean
doCheckUnsafe
=
false
;
// do statistics
static
final
boolean
doStats
=
enableLogs
&&
MarlinProperties
.
isDoStats
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录