Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
be31a761
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
be31a761
编写于
8月 22, 2013
作者:
S
sla
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
7d811172
37ff0669
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
62 addition
and
28 deletion
+62
-28
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
+62
-28
未找到文件。
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
浏览文件 @
be31a761
...
...
@@ -35,8 +35,9 @@ sapkg.c1 = sapkg.hotspot.c1;
sapkg
.
code
=
sapkg
.
hotspot
.
code
;
sapkg
.
compiler
=
sapkg
.
hotspot
.
compiler
;
// 'debugger' is a JavaScript keyword :-(
// sapkg.debugger = sapkg.hotspot.debugger;
// 'debugger' is a JavaScript keyword, but ES5 relaxes the
// restriction of using keywords as property name
sapkg
.
debugger
=
sapkg
.
hotspot
.
debugger
;
sapkg
.
interpreter
=
sapkg
.
hotspot
.
interpreter
;
sapkg
.
jdi
=
sapkg
.
hotspot
.
jdi
;
...
...
@@ -116,27 +117,36 @@ function main(globals, jvmarg) {
return
args
;
}
// Handle __has__ specially to avoid metacircularity problems
// when called from __get__.
// Calling
// this.__has__(name)
// will in turn call
// this.__call__('__has__', name)
// which is not handled below
function
__has__
(
name
)
{
if
(
typeof
(
name
)
==
'
number
'
)
{
return
so
[
"
has(int)
"
](
name
);
}
else
{
if
(
name
==
'
__wrapped__
'
)
{
return
true
;
}
else
if
(
so
[
"
has(java.lang.String)
"
](
name
))
{
return
true
;
}
else
if
(
name
.
equals
(
'
toString
'
))
{
return
true
;
}
else
{
return
false
;
}
}
}
if
(
so
instanceof
sapkg
.
utilities
.
soql
.
ScriptObject
)
{
return
new
JSAdapter
()
{
__getIds__
:
function
()
{
return
so
.
getIds
();
__getIds__
:
function
()
{
return
so
.
getIds
();
},
__has__
:
function
(
name
)
{
if
(
typeof
(
name
)
==
'
number
'
)
{
return
so
[
"
has(int)
"
](
name
);
}
else
{
if
(
name
==
'
__wrapped__
'
)
{
return
true
;
}
else
if
(
so
[
"
has(java.lang.String)
"
](
name
))
{
return
true
;
}
else
if
(
name
.
equals
(
'
toString
'
))
{
return
true
;
}
else
{
return
false
;
}
}
},
__has__
:
__has__
,
__delete__
:
function
(
name
)
{
if
(
typeof
(
name
)
==
'
number
'
)
{
...
...
@@ -147,7 +157,8 @@ function main(globals, jvmarg) {
},
__get__
:
function
(
name
)
{
if
(
!
this
.
__has__
(
name
))
{
// don't call this.__has__(name); see comments above function __has__
if
(
!
__has__
.
call
(
this
,
name
))
{
return
undefined
;
}
if
(
typeof
(
name
)
==
'
number
'
)
{
...
...
@@ -162,7 +173,7 @@ function main(globals, jvmarg) {
var
args
=
prepareArgsArray
(
arguments
);
var
r
;
try
{
r
=
value
.
call
(
args
);
r
=
value
.
call
(
Java
.
to
(
args
,
'
java.lang.Object[]
'
)
);
}
catch
(
e
)
{
println
(
"
call to
"
+
name
+
"
failed!
"
);
throw
e
;
...
...
@@ -204,6 +215,18 @@ function main(globals, jvmarg) {
}
// define "writeln" and "write" if not defined
if
(
typeof
(
println
)
==
'
undefined
'
)
{
println
=
function
(
str
)
{
java
.
lang
.
System
.
out
.
println
(
String
(
str
));
}
}
if
(
typeof
(
print
)
==
'
undefined
'
)
{
print
=
function
(
str
)
{
java
.
lang
.
System
.
out
.
print
(
String
(
str
));
}
}
if
(
typeof
(
writeln
)
==
'
undefined
'
)
{
writeln
=
println
;
}
...
...
@@ -235,7 +258,7 @@ function main(globals, jvmarg) {
this
.
jclasses
=
function
()
{
forEachKlass
(
function
(
clazz
)
{
writeln
(
clazz
.
getName
().
asString
()
+
"
@
"
+
clazz
.
get
Handle
().
toString
());
writeln
(
clazz
.
getName
().
asString
()
+
"
@
"
+
clazz
.
get
Address
().
toString
());
});
}
registerCommand
(
"
classes
"
,
"
classes
"
,
"
jclasses
"
);
...
...
@@ -490,14 +513,14 @@ function systemLoader() {
function
forEachKlass
(
callback
)
{
var
VisitorClass
=
sapkg
.
memory
.
SystemDictionary
.
ClassVisitor
;
var
visitor
=
new
VisitorClass
()
{
visit
:
callback
};
sa
.
sysDict
[
"
classesDo(sun.jvm.hotspot.memory.SystemDictionary
$
ClassVisitor)
"
](
visitor
);
sa
.
sysDict
[
"
classesDo(sun.jvm.hotspot.memory.SystemDictionary
.
ClassVisitor)
"
](
visitor
);
}
// iterate system dictionary for each 'Klass' and initiating loader
function
forEachKlassAndLoader
(
callback
)
{
var
VisitorClass
=
sapkg
.
memory
.
SystemDictionary
.
ClassAndLoaderVisitor
;
var
visitor
=
new
VisitorClass
()
{
visit
:
callback
};
sa
.
sysDict
[
"
classesDo(sun.jvm.hotspot.memory.SystemDictionary
$
ClassAndLoaderVisitor)
"
](
visitor
);
sa
.
sysDict
[
"
classesDo(sun.jvm.hotspot.memory.SystemDictionary
.
ClassAndLoaderVisitor)
"
](
visitor
);
}
// iterate system dictionary for each primitive array klass
...
...
@@ -522,7 +545,12 @@ function obj2oop(obj) {
// iterates Java heap for each Oop
function
forEachOop
(
callback
)
{
sa
.
objHeap
.
iterate
(
new
sapkg
.
oops
.
HeapVisitor
()
{
doObj
:
callback
});
function
empty
()
{
}
sa
.
objHeap
.
iterate
(
new
sapkg
.
oops
.
HeapVisitor
()
{
prologue
:
empty
,
doObj
:
callback
,
epilogue
:
empty
});
}
// iterates Java heap for each Oop of given 'klass'.
...
...
@@ -536,8 +564,14 @@ function forEachOopOfKlass(callback, klass, includeSubtypes) {
if
(
includeSubtypes
==
undefined
)
{
includeSubtypes
=
true
;
}
function
empty
()
{
}
sa
.
objHeap
.
iterateObjectsOfKlass
(
new
sapkg
.
oops
.
HeapVisitor
()
{
doObj
:
callback
},
new
sapkg
.
oops
.
HeapVisitor
()
{
prologue
:
empty
,
doObj
:
callback
,
epilogue
:
empty
},
klass
,
includeSubtypes
);
}
...
...
@@ -746,9 +780,9 @@ while (tmp.itr.hasNext()) {
// ignore;
continue
;
}
else
{
// some type names have ':'
. replace to make it as a
// some type names have ':'
, '<', '>', '*', ' '. replace to make it as a
// JavaScript identifier
tmp
.
name
=
tmp
.
name
.
replace
(
'
:
'
,
'
_
'
).
replace
(
'
<
'
,
'
_
'
).
replace
(
'
>
'
,
'
_
'
).
replace
(
'
*
'
,
'
_
'
).
replace
(
'
'
,
'
_
'
);
tmp
.
name
=
(
""
+
tmp
.
name
).
replace
(
/
[
:<>*
]
/g
,
'
_
'
);
eval
(
"
function read
"
+
tmp
.
name
+
"
(addr) {
"
+
"
return readVMType('
"
+
tmp
.
name
+
"
', addr);}
"
);
eval
(
"
function print
"
+
tmp
.
name
+
"
(addr) {
"
+
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录