Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
3144137d
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看板
提交
3144137d
编写于
10月 19, 2012
作者:
Z
zgu
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
ee35bcfa
8c235999
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
52 addition
and
28 deletion
+52
-28
agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java
.../share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java
+11
-8
agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java
agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java
+1
-15
agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java
...classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java
+40
-5
未找到文件。
agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java
浏览文件 @
3144137d
...
...
@@ -272,9 +272,10 @@ public class Bytecodes {
public
static
final
int
_fast_aldc
=
229
;
public
static
final
int
_fast_aldc_w
=
230
;
public
static
final
int
_return_register_finalizer
=
231
;
public
static
final
int
_shouldnotreachhere
=
232
;
// For debugging
public
static
final
int
_invokehandle
=
232
;
public
static
final
int
_shouldnotreachhere
=
233
;
// For debugging
public
static
final
int
number_of_codes
=
23
3
;
public
static
final
int
number_of_codes
=
23
4
;
// Flag bits derived from format strings, can_trap, can_rewrite, etc.:
// semantic flags:
...
...
@@ -787,20 +788,22 @@ public class Bytecodes {
def
(
_fast_aaccess_0
,
"fast_aaccess_0"
,
"b_JJ"
,
null
,
BasicType
.
getTObject
()
,
1
,
true
,
_aload_0
);
def
(
_fast_faccess_0
,
"fast_faccess_0"
,
"b_JJ"
,
null
,
BasicType
.
getTObject
()
,
1
,
true
,
_aload_0
);
def
(
_fast_iload
,
"fast_iload"
,
"bi"
,
null
,
BasicType
.
getTInt
()
,
1
,
false
,
_iload
);
def
(
_fast_iload2
,
"fast_iload2"
,
"bi_i"
,
null
,
BasicType
.
getTInt
()
,
2
,
false
,
_iload
);
def
(
_fast_icaload
,
"fast_icaload"
,
"bi_"
,
null
,
BasicType
.
getTInt
()
,
0
,
false
,
_iload
);
def
(
_fast_iload
,
"fast_iload"
,
"bi"
,
null
,
BasicType
.
getTInt
()
,
1
,
false
,
_iload
);
def
(
_fast_iload2
,
"fast_iload2"
,
"bi_i"
,
null
,
BasicType
.
getTInt
()
,
2
,
false
,
_iload
);
def
(
_fast_icaload
,
"fast_icaload"
,
"bi_"
,
null
,
BasicType
.
getTInt
()
,
0
,
false
,
_iload
);
// Faster method invocation.
def
(
_fast_invokevfinal
,
"fast_invokevfinal"
,
"bJJ"
,
null
,
BasicType
.
getTIllegal
(),
-
1
,
true
,
_invokevirtual
);
def
(
_fast_invokevfinal
,
"fast_invokevfinal"
,
"bJJ"
,
null
,
BasicType
.
getTIllegal
(),
-
1
,
true
,
_invokevirtual
);
def
(
_fast_linearswitch
,
"fast_linearswitch"
,
""
,
null
,
BasicType
.
getTVoid
()
,
-
1
,
false
,
_lookupswitch
);
def
(
_fast_binaryswitch
,
"fast_binaryswitch"
,
""
,
null
,
BasicType
.
getTVoid
()
,
-
1
,
false
,
_lookupswitch
);
def
(
_fast_aldc
,
"fast_aldc"
,
"bj"
,
null
,
BasicType
.
getTObject
(),
1
,
true
,
_ldc
);
def
(
_fast_aldc_w
,
"fast_aldc_w"
,
"bJJ"
,
null
,
BasicType
.
getTObject
(),
1
,
true
,
_ldc_w
);
def
(
_return_register_finalizer
,
"return_register_finalizer"
,
"b"
,
null
,
BasicType
.
getTVoid
()
,
0
,
true
,
_return
);
def
(
_fast_aldc
,
"fast_aldc"
,
"bj"
,
null
,
BasicType
.
getTObject
(),
1
,
true
,
_ldc
);
def
(
_
fast_aldc_w
,
"fast_aldc_w"
,
"bJJ"
,
null
,
BasicType
.
getTObject
(),
1
,
true
,
_ldc_w
);
// special handling of signature-polymorphic methods
def
(
_
invokehandle
,
"invokehandle"
,
"bJJ"
,
null
,
BasicType
.
getTIllegal
(),
-
1
,
true
,
_invokevirtual
);
def
(
_shouldnotreachhere
,
"_shouldnotreachhere"
,
"b"
,
null
,
BasicType
.
getTVoid
()
,
0
,
false
);
...
...
agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java
浏览文件 @
3144137d
...
...
@@ -30,24 +30,10 @@ import sun.jvm.hotspot.utilities.PlatformInfo;
/** Encapsulates some byte-swapping operations defined in the VM */
public
class
Bytes
{
// swap if client platform is different from server's.
private
boolean
swap
;
public
Bytes
(
MachineDescription
machDesc
)
{
String
cpu
=
PlatformInfo
.
getCPU
();
if
(
cpu
.
equals
(
"sparc"
))
{
if
(
machDesc
.
isBigEndian
())
{
swap
=
false
;
}
else
{
swap
=
true
;
}
}
else
{
// intel
if
(
machDesc
.
isBigEndian
())
{
swap
=
true
;
}
else
{
swap
=
false
;
}
}
swap
=
!
machDesc
.
isBigEndian
();
}
/** Should only swap if the hardware's underlying byte order is
...
...
agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java
浏览文件 @
3144137d
...
...
@@ -29,6 +29,11 @@ import sun.jvm.hotspot.interpreter.*;
import
sun.jvm.hotspot.utilities.*
;
import
sun.jvm.hotspot.debugger.*
;
import
sun.jvm.hotspot.runtime.*
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
import
java.security.AccessControlContext
;
import
java.security.PrivilegedExceptionAction
;
import
java.security.PrivilegedActionException
;
public
class
ByteCodeRewriter
{
...
...
@@ -38,8 +43,20 @@ public class ByteCodeRewriter
private
byte
[]
code
;
private
Bytes
bytes
;
public
static
final
boolean
DEBUG
=
false
;
private
static
final
int
jintSize
=
4
;
public
static
final
boolean
DEBUG
;
static
{
String
debug
=
(
String
)
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
return
System
.
getProperty
(
"sun.jvm.hotspot.tools.jcore.ByteCodeRewriter.DEBUG"
);
}
}
);
DEBUG
=
(
debug
!=
null
?
debug
.
equalsIgnoreCase
(
"true"
)
:
false
);
}
protected
void
debugMessage
(
String
message
)
{
System
.
out
.
println
(
message
);
...
...
@@ -54,6 +71,18 @@ public class ByteCodeRewriter
}
protected
short
getConstantPoolIndexFromRefMap
(
int
rawcode
,
int
bci
)
{
int
refIndex
;
String
fmt
=
Bytecodes
.
format
(
rawcode
);
switch
(
fmt
.
length
())
{
case
2
:
refIndex
=
0xFF
&
method
.
getBytecodeByteArg
(
bci
);
break
;
case
3
:
refIndex
=
0xFFFF
&
bytes
.
swapShort
(
method
.
getBytecodeShortArg
(
bci
));
break
;
default
:
throw
new
IllegalArgumentException
();
}
return
(
short
)
cpool
.
objectToCPIndex
(
refIndex
);
}
protected
short
getConstantPoolIndex
(
int
rawcode
,
int
bci
)
{
// get ConstantPool index from ConstantPoolCacheIndex at given bci
String
fmt
=
Bytecodes
.
format
(
rawcode
);
...
...
@@ -95,6 +124,12 @@ public class ByteCodeRewriter
int
hotspotcode
=
Bytecodes
.
_illegal
;
int
len
=
0
;
if
(
DEBUG
)
{
String
msg
=
method
.
getMethodHolder
().
getName
().
asString
()
+
"."
+
method
.
getName
().
asString
()
+
method
.
getSignature
().
asString
();
debugMessage
(
msg
);
}
for
(
int
bci
=
0
;
bci
<
code
.
length
;)
{
hotspotcode
=
Bytecodes
.
codeAt
(
method
,
bci
);
bytecode
=
Bytecodes
.
javaCode
(
hotspotcode
);
...
...
@@ -133,15 +168,15 @@ public class ByteCodeRewriter
case
Bytecodes
.
_ldc_w
:
if
(
hotspotcode
!=
bytecode
)
{
// fast_aldc_w puts constant in
CP cache
cpoolIndex
=
getConstantPoolIndex
(
hotspotcode
,
bci
+
1
);
// fast_aldc_w puts constant in
reference map
cpoolIndex
=
getConstantPoolIndex
FromRefMap
(
hotspotcode
,
bci
+
1
);
writeShort
(
code
,
bci
+
1
,
cpoolIndex
);
}
break
;
case
Bytecodes
.
_ldc
:
if
(
hotspotcode
!=
bytecode
)
{
// fast_aldc puts constant in
CP cache
cpoolIndex
=
getConstantPoolIndex
(
hotspotcode
,
bci
+
1
);
// fast_aldc puts constant in
reference map
cpoolIndex
=
getConstantPoolIndex
FromRefMap
(
hotspotcode
,
bci
+
1
);
code
[
bci
+
1
]
=
(
byte
)(
cpoolIndex
);
}
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录