Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
84521fd4
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看板
提交
84521fd4
编写于
12月 10, 2015
作者:
L
lbourges
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8144654: Improve Marlin logging
Reviewed-by: prr, flar
上级
bbb70c58
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
27 addition
and
42 deletion
+27
-42
src/share/classes/sun/java2d/marlin/ByteArrayCache.java
src/share/classes/sun/java2d/marlin/ByteArrayCache.java
+2
-2
src/share/classes/sun/java2d/marlin/FloatArrayCache.java
src/share/classes/sun/java2d/marlin/FloatArrayCache.java
+2
-2
src/share/classes/sun/java2d/marlin/IntArrayCache.java
src/share/classes/sun/java2d/marlin/IntArrayCache.java
+2
-2
src/share/classes/sun/java2d/marlin/MarlinConst.java
src/share/classes/sun/java2d/marlin/MarlinConst.java
+5
-4
src/share/classes/sun/java2d/marlin/MarlinProperties.java
src/share/classes/sun/java2d/marlin/MarlinProperties.java
+4
-0
src/share/classes/sun/java2d/marlin/MarlinUtils.java
src/share/classes/sun/java2d/marlin/MarlinUtils.java
+4
-18
src/share/classes/sun/java2d/marlin/RendererContext.java
src/share/classes/sun/java2d/marlin/RendererContext.java
+8
-14
未找到文件。
src/share/classes/sun/java2d/marlin/ByteArrayCache.java
浏览文件 @
84521fd4
...
...
@@ -74,7 +74,7 @@ final class ByteArrayCache implements MarlinConst {
void
putDirtyArray
(
final
byte
[]
array
,
final
int
length
)
{
if
(
length
!=
arraySize
)
{
if
(
doChecks
)
{
System
.
out
.
println
(
"ArrayCache: bad length = "
+
length
);
MarlinUtils
.
logInfo
(
"ArrayCache: bad length = "
+
length
);
}
return
;
}
...
...
@@ -98,7 +98,7 @@ final class ByteArrayCache implements MarlinConst {
{
if
(
length
!=
arraySize
)
{
if
(
doChecks
)
{
System
.
out
.
println
(
"ArrayCache: bad length = "
+
length
);
MarlinUtils
.
logInfo
(
"ArrayCache: bad length = "
+
length
);
}
return
;
}
...
...
src/share/classes/sun/java2d/marlin/FloatArrayCache.java
浏览文件 @
84521fd4
...
...
@@ -75,7 +75,7 @@ final class FloatArrayCache implements MarlinConst {
void
putDirtyArray
(
final
float
[]
array
,
final
int
length
)
{
if
(
length
!=
arraySize
)
{
if
(
doChecks
)
{
System
.
out
.
println
(
"ArrayCache: bad length = "
+
length
);
MarlinUtils
.
logInfo
(
"ArrayCache: bad length = "
+
length
);
}
return
;
}
...
...
@@ -99,7 +99,7 @@ final class FloatArrayCache implements MarlinConst {
{
if
(
length
!=
arraySize
)
{
if
(
doChecks
)
{
System
.
out
.
println
(
"ArrayCache: bad length = "
+
length
);
MarlinUtils
.
logInfo
(
"ArrayCache: bad length = "
+
length
);
}
return
;
}
...
...
src/share/classes/sun/java2d/marlin/IntArrayCache.java
浏览文件 @
84521fd4
...
...
@@ -74,7 +74,7 @@ final class IntArrayCache implements MarlinConst {
void
putDirtyArray
(
final
int
[]
array
,
final
int
length
)
{
if
(
length
!=
arraySize
)
{
if
(
doChecks
)
{
System
.
out
.
println
(
"ArrayCache: bad length = "
+
length
);
MarlinUtils
.
logInfo
(
"ArrayCache: bad length = "
+
length
);
}
return
;
}
...
...
@@ -98,7 +98,7 @@ final class IntArrayCache implements MarlinConst {
{
if
(
length
!=
arraySize
)
{
if
(
doChecks
)
{
System
.
out
.
println
(
"ArrayCache: bad length = "
+
length
);
MarlinUtils
.
logInfo
(
"ArrayCache: bad length = "
+
length
);
}
return
;
}
...
...
src/share/classes/sun/java2d/marlin/MarlinConst.java
浏览文件 @
84521fd4
...
...
@@ -30,8 +30,8 @@ package sun.java2d.marlin;
*/
interface
MarlinConst
{
// enable Logs (logger or stdout)
static
final
boolean
enableLogs
=
false
;
//
enable Logger
static
final
boolean
enableLogs
=
MarlinProperties
.
isLoggingEnabled
()
;
//
use Logger instead of stdout
static
final
boolean
useLogger
=
enableLogs
&&
MarlinProperties
.
isUseLogger
();
// log new RendererContext
...
...
@@ -47,9 +47,10 @@ interface MarlinConst {
static
final
boolean
doStats
=
enableLogs
&&
MarlinProperties
.
isDoStats
();
// do monitors
// disabled to reduce byte-code size a bit...
static
final
boolean
doMonitors
=
enableLogs
&&
false
;
// MarlinProperties.isDoMonitors();
static
final
boolean
doMonitors
=
false
;
// static final boolean doMonitors = enableLogs && MarlinProperties.isDoMonitors();
// do checks
static
final
boolean
doChecks
=
false
;
//
MarlinProperties.isDoChecks();
static
final
boolean
doChecks
=
enableLogs
&&
MarlinProperties
.
isDoChecks
();
// do AA range checks: disable when algorithm / code is stable
static
final
boolean
DO_AA_RANGE_CHECK
=
false
;
...
...
src/share/classes/sun/java2d/marlin/MarlinProperties.java
浏览文件 @
84521fd4
...
...
@@ -136,6 +136,10 @@ public final class MarlinProperties {
// logging parameters
public
static
boolean
isLoggingEnabled
()
{
return
getBoolean
(
"sun.java2d.renderer.log"
,
"false"
);
}
public
static
boolean
isUseLogger
()
{
return
getBoolean
(
"sun.java2d.renderer.useLogger"
,
"false"
);
}
...
...
src/share/classes/sun/java2d/marlin/MarlinUtils.java
浏览文件 @
84521fd4
...
...
@@ -27,12 +27,12 @@ package sun.java2d.marlin;
public
final
class
MarlinUtils
{
//
TODO: use sun.util.logging.PlatformLogger once in JDK9
private
static
final
java
.
util
.
logging
.
Logger
log
;
//
Marlin logger
private
static
final
sun
.
util
.
logging
.
Platform
Logger
log
;
static
{
if
(
MarlinConst
.
useLogger
)
{
log
=
java
.
util
.
logging
.
Logger
.
getLogger
(
"sun.java2d.marlin"
);
log
=
sun
.
util
.
logging
.
Platform
Logger
.
getLogger
(
"sun.java2d.marlin"
);
}
else
{
log
=
null
;
}
...
...
@@ -53,25 +53,11 @@ public final class MarlinUtils {
public
static
void
logException
(
final
String
msg
,
final
Throwable
th
)
{
if
(
MarlinConst
.
useLogger
)
{
// log.warning(msg, th);
log
.
log
(
java
.
util
.
logging
.
Level
.
WARNING
,
msg
,
th
);
log
.
warning
(
msg
,
th
);
}
else
if
(
MarlinConst
.
enableLogs
)
{
System
.
out
.
print
(
"WARNING: "
);
System
.
out
.
println
(
msg
);
th
.
printStackTrace
(
System
.
err
);
}
}
// Returns the caller's class and method's name; best effort
// if cannot infer, return the logger's name.
static
String
getCallerInfo
(
String
className
)
{
String
sourceClassName
=
null
;
String
sourceMethodName
=
null
;
if
(
sourceClassName
!=
null
)
{
return
sourceClassName
+
" "
+
sourceMethodName
;
}
else
{
return
"unknown"
;
}
}
}
src/share/classes/sun/java2d/marlin/RendererContext.java
浏览文件 @
84521fd4
...
...
@@ -31,7 +31,6 @@ import java.lang.ref.WeakReference;
import
java.util.concurrent.atomic.AtomicInteger
;
import
static
sun
.
java2d
.
marlin
.
ArrayCache
.*;
import
sun.java2d.marlin.MarlinRenderingEngine.NormalizingPathIterator
;
import
static
sun
.
java2d
.
marlin
.
MarlinUtils
.
getCallerInfo
;
import
static
sun
.
java2d
.
marlin
.
MarlinUtils
.
logInfo
;
/**
...
...
@@ -39,7 +38,6 @@ import static sun.java2d.marlin.MarlinUtils.logInfo;
*/
final
class
RendererContext
implements
MarlinConst
{
private
static
final
String
className
=
RendererContext
.
class
.
getName
();
// RendererContext creation counter
private
static
final
AtomicInteger
contextCount
=
new
AtomicInteger
(
1
);
// RendererContext statistics
...
...
@@ -214,8 +212,7 @@ final class RendererContext implements MarlinConst {
}
if
(
doLogOverSize
)
{
logInfo
(
"getDirtyByteArray[oversize]: length=\t"
+
length
+
"\tfrom=\t"
+
getCallerInfo
(
className
));
logInfo
(
"getDirtyByteArray[oversize]: length=\t"
+
length
);
}
return
new
byte
[
length
];
...
...
@@ -254,7 +251,7 @@ final class RendererContext implements MarlinConst {
if
(
doLogWidenArray
)
{
logInfo
(
"widenDirtyByteArray["
+
res
.
length
+
"]: usedSize=\t"
+
usedSize
+
"\tlength=\t"
+
length
+
"\tneeded length=\t"
+
needSize
+
"\tfrom=\t"
+
getCallerInfo
(
className
)
);
+
needSize
);
}
return
res
;
}
...
...
@@ -275,8 +272,7 @@ final class RendererContext implements MarlinConst {
}
if
(
doLogOverSize
)
{
logInfo
(
"getIntArray[oversize]: length=\t"
+
length
+
"\tfrom=\t"
+
getCallerInfo
(
className
));
logInfo
(
"getIntArray[oversize]: length=\t"
+
length
);
}
return
new
int
[
length
];
...
...
@@ -306,7 +302,7 @@ final class RendererContext implements MarlinConst {
if
(
doLogWidenArray
)
{
logInfo
(
"widenIntArray["
+
res
.
length
+
"]: usedSize=\t"
+
usedSize
+
"\tlength=\t"
+
length
+
"\tneeded length=\t"
+
needSize
+
"\tfrom=\t"
+
getCallerInfo
(
className
)
);
+
needSize
);
}
return
res
;
}
...
...
@@ -338,8 +334,7 @@ final class RendererContext implements MarlinConst {
}
if
(
doLogOverSize
)
{
logInfo
(
"getDirtyIntArray[oversize]: length=\t"
+
length
+
"\tfrom=\t"
+
getCallerInfo
(
className
));
logInfo
(
"getDirtyIntArray[oversize]: length=\t"
+
length
);
}
return
new
int
[
length
];
...
...
@@ -369,7 +364,7 @@ final class RendererContext implements MarlinConst {
if
(
doLogWidenArray
)
{
logInfo
(
"widenDirtyIntArray["
+
res
.
length
+
"]: usedSize=\t"
+
usedSize
+
"\tlength=\t"
+
length
+
"\tneeded length=\t"
+
needSize
+
"\tfrom=\t"
+
getCallerInfo
(
className
)
);
+
needSize
);
}
return
res
;
}
...
...
@@ -399,8 +394,7 @@ final class RendererContext implements MarlinConst {
}
if
(
doLogOverSize
)
{
logInfo
(
"getDirtyFloatArray[oversize]: length=\t"
+
length
+
"\tfrom=\t"
+
getCallerInfo
(
className
));
logInfo
(
"getDirtyFloatArray[oversize]: length=\t"
+
length
);
}
return
new
float
[
length
];
...
...
@@ -430,7 +424,7 @@ final class RendererContext implements MarlinConst {
if
(
doLogWidenArray
)
{
logInfo
(
"widenDirtyFloatArray["
+
res
.
length
+
"]: usedSize=\t"
+
usedSize
+
"\tlength=\t"
+
length
+
"\tneeded length=\t"
+
needSize
+
"\tfrom=\t"
+
getCallerInfo
(
className
)
);
+
needSize
);
}
return
res
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录