Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
9dcc6c97
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看板
提交
9dcc6c97
编写于
3月 18, 2013
作者:
R
roland
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
33fe8ef6
7dbd7cfa
变更
16
显示空白变更内容
内联
并排
Showing
16 changed file
with
172 addition
and
119 deletion
+172
-119
src/cpu/sparc/vm/macroAssembler_sparc.cpp
src/cpu/sparc/vm/macroAssembler_sparc.cpp
+21
-17
src/cpu/x86/vm/macroAssembler_x86.cpp
src/cpu/x86/vm/macroAssembler_x86.cpp
+21
-7
src/share/vm/asm/assembler.cpp
src/share/vm/asm/assembler.cpp
+7
-3
src/share/vm/asm/assembler.hpp
src/share/vm/asm/assembler.hpp
+2
-0
src/share/vm/asm/codeBuffer.cpp
src/share/vm/asm/codeBuffer.cpp
+75
-51
src/share/vm/asm/codeBuffer.hpp
src/share/vm/asm/codeBuffer.hpp
+15
-10
src/share/vm/code/codeBlob.cpp
src/share/vm/code/codeBlob.cpp
+1
-1
src/share/vm/code/codeBlob.hpp
src/share/vm/code/codeBlob.hpp
+4
-4
src/share/vm/code/icBuffer.hpp
src/share/vm/code/icBuffer.hpp
+1
-1
src/share/vm/code/stubs.cpp
src/share/vm/code/stubs.cpp
+8
-8
src/share/vm/code/stubs.hpp
src/share/vm/code/stubs.hpp
+5
-5
src/share/vm/compiler/disassembler.cpp
src/share/vm/compiler/disassembler.cpp
+6
-6
src/share/vm/compiler/disassembler.hpp
src/share/vm/compiler/disassembler.hpp
+1
-1
src/share/vm/interpreter/interpreter.cpp
src/share/vm/interpreter/interpreter.cpp
+1
-1
src/share/vm/interpreter/interpreter.hpp
src/share/vm/interpreter/interpreter.hpp
+3
-3
src/share/vm/runtime/stubCodeGenerator.cpp
src/share/vm/runtime/stubCodeGenerator.cpp
+1
-1
未找到文件。
src/cpu/sparc/vm/macroAssembler_sparc.cpp
浏览文件 @
9dcc6c97
...
...
@@ -1385,13 +1385,13 @@ void MacroAssembler::_verify_oop(Register reg, const char* msg, const char * fil
}
#endif
int
len
=
strlen
(
file
)
+
strlen
(
msg
)
+
1
+
4
;
sprintf
(
buffer
,
"%d"
,
line
);
len
+=
strlen
(
buffer
)
;
sprintf
(
buffer
,
" at offset %d "
,
offset
())
;
len
+=
strlen
(
buffer
);
char
*
real_msg
=
new
char
[
len
]
;
sprintf
(
real_msg
,
"%s%s(%s:%d)"
,
msg
,
buffer
,
file
,
line
);
const
char
*
real_msg
=
NULL
;
{
ResourceMark
rm
;
stringStream
ss
;
ss
.
print
(
"%s at offset %d (%s:%d)"
,
msg
,
offset
(),
file
,
line
);
real_msg
=
code_string
(
ss
.
as_string
())
;
}
// Call indirectly to solve generation ordering problem
AddressLiteral
a
(
StubRoutines
::
verify_oop_subroutine_entry_address
());
...
...
@@ -1423,13 +1423,13 @@ void MacroAssembler::_verify_oop_addr(Address addr, const char* msg, const char
// plausibility check for oops
if
(
!
VerifyOops
)
return
;
c
har
buffer
[
64
]
;
sprintf
(
buffer
,
"%d"
,
line
);
int
len
=
strlen
(
file
)
+
strlen
(
msg
)
+
1
+
4
+
strlen
(
buffer
)
;
sprintf
(
buffer
,
" at SP+%d "
,
addr
.
disp
())
;
len
+=
strlen
(
buffer
);
char
*
real_msg
=
new
char
[
len
]
;
sprintf
(
real_msg
,
"%s at SP+%d (%s:%d)"
,
msg
,
addr
.
disp
(),
file
,
line
);
c
onst
char
*
real_msg
=
NULL
;
{
ResourceMark
rm
;
stringStream
ss
;
ss
.
print
(
"%s at SP+%d (%s:%d)"
,
msg
,
addr
.
disp
(),
file
,
line
);
real_msg
=
code_string
(
ss
.
as_string
())
;
}
// Call indirectly to solve generation ordering problem
AddressLiteral
a
(
StubRoutines
::
verify_oop_subroutine_entry_address
());
...
...
@@ -1622,9 +1622,13 @@ void MacroAssembler::untested(const char* what) {
// in order to run automated test scripts on the VM
// Use the flag ShowMessageBoxOnError
char
*
b
=
new
char
[
1024
];
sprintf
(
b
,
"untested: %s"
,
what
);
const
char
*
b
=
NULL
;
{
ResourceMark
rm
;
stringStream
ss
;
ss
.
print
(
"untested: %s"
,
what
);
b
=
code_string
(
ss
.
as_string
());
}
if
(
ShowMessageBoxOnError
)
{
STOP
(
b
);
}
else
{
warn
(
b
);
}
}
...
...
src/cpu/x86/vm/macroAssembler_x86.cpp
浏览文件 @
9dcc6c97
...
...
@@ -4262,8 +4262,13 @@ void MacroAssembler::verify_oop(Register reg, const char* s) {
if
(
!
VerifyOops
)
return
;
// Pass register number to verify_oop_subroutine
char
*
b
=
new
char
[
strlen
(
s
)
+
50
];
sprintf
(
b
,
"verify_oop: %s: %s"
,
reg
->
name
(),
s
);
const
char
*
b
=
NULL
;
{
ResourceMark
rm
;
stringStream
ss
;
ss
.
print
(
"verify_oop: %s: %s"
,
reg
->
name
(),
s
);
b
=
code_string
(
ss
.
as_string
());
}
BLOCK_COMMENT
(
"verify_oop {"
);
#ifdef _LP64
push
(
rscratch1
);
// save r10, trashed by movptr()
...
...
@@ -4297,9 +4302,14 @@ RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_ad
{
Label
L
;
testptr
(
tmp
,
tmp
);
if
(
WizardMode
)
{
const
char
*
buf
=
NULL
;
{
ResourceMark
rm
;
stringStream
ss
;
ss
.
print
(
"DelayedValue="
INTPTR_FORMAT
,
delayed_value_addr
[
1
]);
buf
=
code_string
(
ss
.
as_string
());
}
jcc
(
Assembler
::
notZero
,
L
);
char
*
buf
=
new
char
[
40
];
sprintf
(
buf
,
"DelayedValue="
INTPTR_FORMAT
,
delayed_value_addr
[
1
]);
STOP
(
buf
);
}
else
{
jccb
(
Assembler
::
notZero
,
L
);
...
...
@@ -4343,9 +4353,13 @@ void MacroAssembler::verify_oop_addr(Address addr, const char* s) {
// Address adjust(addr.base(), addr.index(), addr.scale(), addr.disp() + BytesPerWord);
// Pass register number to verify_oop_subroutine
char
*
b
=
new
char
[
strlen
(
s
)
+
50
];
sprintf
(
b
,
"verify_oop_addr: %s"
,
s
);
const
char
*
b
=
NULL
;
{
ResourceMark
rm
;
stringStream
ss
;
ss
.
print
(
"verify_oop_addr: %s"
,
s
);
b
=
code_string
(
ss
.
as_string
());
}
#ifdef _LP64
push
(
rscratch1
);
// save r10, trashed by movptr()
#endif
...
...
src/share/vm/asm/assembler.cpp
浏览文件 @
9dcc6c97
...
...
@@ -284,15 +284,19 @@ void AbstractAssembler::update_delayed_values() {
DelayedConstant
::
update_all
();
}
void
AbstractAssembler
::
block_comment
(
const
char
*
comment
)
{
if
(
sect
()
==
CodeBuffer
::
SECT_INSTS
)
{
code_section
()
->
outer
()
->
block_comment
(
offset
(),
comment
);
}
}
const
char
*
AbstractAssembler
::
code_string
(
const
char
*
str
)
{
if
(
sect
()
==
CodeBuffer
::
SECT_INSTS
||
sect
()
==
CodeBuffer
::
SECT_STUBS
)
{
return
code_section
()
->
outer
()
->
code_string
(
str
);
}
return
NULL
;
}
bool
MacroAssembler
::
needs_explicit_null_check
(
intptr_t
offset
)
{
// Exception handler checks the nmethod's implicit null checks table
// only when this method returns false.
...
...
src/share/vm/asm/assembler.hpp
浏览文件 @
9dcc6c97
...
...
@@ -336,6 +336,8 @@ class AbstractAssembler : public ResourceObj {
// along with the disassembly when printing nmethods. Currently
// only supported in the instruction section of the code buffer.
void
block_comment
(
const
char
*
comment
);
// Copy str to a buffer that has the same lifetime as the CodeBuffer
const
char
*
code_string
(
const
char
*
str
);
// Label functions
void
bind
(
Label
&
L
);
// binds an unbound label L to the current code position
...
...
src/share/vm/asm/codeBuffer.cpp
浏览文件 @
9dcc6c97
...
...
@@ -703,8 +703,8 @@ void CodeBuffer::copy_code_to(CodeBlob* dest_blob) {
this
->
compute_final_layout
(
&
dest
);
relocate_code_to
(
&
dest
);
// transfer comments from buffer to blob
dest_blob
->
set_
comments
(
_comment
s
);
// transfer
strings and
comments from buffer to blob
dest_blob
->
set_
strings
(
_string
s
);
// Done moving code bytes; were they the right size?
assert
(
round_to
(
dest
.
total_content_size
(),
oopSize
)
==
dest_blob
->
content_size
(),
"sanity"
);
...
...
@@ -1003,58 +1003,78 @@ void CodeSection::decode() {
void
CodeBuffer
::
block_comment
(
intptr_t
offset
,
const
char
*
comment
)
{
_
comment
s
.
add_comment
(
offset
,
comment
);
_
string
s
.
add_comment
(
offset
,
comment
);
}
class
CodeComment
:
public
CHeapObj
<
mtCode
>
{
const
char
*
CodeBuffer
::
code_string
(
const
char
*
str
)
{
return
_strings
.
add_string
(
str
);
}
class
CodeString
:
public
CHeapObj
<
mtCode
>
{
private:
friend
class
CodeComments
;
friend
class
CodeStrings
;
const
char
*
_string
;
CodeString
*
_next
;
intptr_t
_offset
;
const
char
*
_comment
;
CodeComment
*
_next
;
~
Code
Comment
()
{
~
Code
String
()
{
assert
(
_next
==
NULL
,
"wrong interface for freeing list"
);
os
::
free
((
void
*
)
_
comment
,
mtCode
);
os
::
free
((
void
*
)
_
string
,
mtCode
);
}
bool
is_comment
()
const
{
return
_offset
>=
0
;
}
public:
CodeComment
(
intptr_t
offset
,
const
char
*
comment
)
{
_offset
=
offset
;
_comment
=
os
::
strdup
(
comment
,
mtCode
);
_next
=
NULL
;
CodeString
(
const
char
*
string
,
intptr_t
offset
=
-
1
)
:
_next
(
NULL
),
_offset
(
offset
)
{
_string
=
os
::
strdup
(
string
,
mtCode
);
}
intptr_t
offset
()
const
{
return
_offset
;
}
const
char
*
comment
()
const
{
return
_comment
;
}
Code
Comment
*
next
()
{
return
_next
;
}
const
char
*
string
()
const
{
return
_string
;
}
intptr_t
offset
()
const
{
assert
(
_offset
>=
0
,
"offset for non comment?"
);
return
_offset
;
}
Code
String
*
next
()
const
{
return
_next
;
}
void
set_next
(
Code
Comment
*
next
)
{
_next
=
next
;
}
void
set_next
(
Code
String
*
next
)
{
_next
=
next
;
}
CodeComment
*
find
(
intptr_t
offset
)
{
CodeComment
*
a
=
this
;
while
(
a
!=
NULL
&&
a
->
_offset
!=
offset
)
{
a
=
a
->
_next
;
CodeString
*
first_comment
()
{
if
(
is_comment
())
{
return
this
;
}
else
{
return
next_comment
();
}
return
a
;
}
CodeString
*
next_comment
()
const
{
CodeString
*
s
=
_next
;
while
(
s
!=
NULL
&&
!
s
->
is_comment
())
{
s
=
s
->
_next
;
}
return
s
;
}
};
CodeString
*
CodeStrings
::
find
(
intptr_t
offset
)
const
{
CodeString
*
a
=
_strings
->
first_comment
();
while
(
a
!=
NULL
&&
a
->
offset
()
!=
offset
)
{
a
=
a
->
next_comment
();
}
return
a
;
}
// Convenience for add_comment.
CodeComment
*
find_last
(
intptr_t
offset
)
{
CodeComment
*
a
=
find
(
offset
);
// Convenience for add_comment.
CodeString
*
CodeStrings
::
find_last
(
intptr_t
offset
)
const
{
CodeString
*
a
=
find
(
offset
);
if
(
a
!=
NULL
)
{
while
((
a
->
_next
!=
NULL
)
&&
(
a
->
_next
->
_offset
==
offset
))
{
a
=
a
->
_next
;
CodeString
*
c
=
NULL
;
while
(((
c
=
a
->
next_comment
())
!=
NULL
)
&&
(
c
->
offset
()
==
offset
))
{
a
=
c
;
}
}
return
a
;
}
};
}
void
Code
Comment
s
::
add_comment
(
intptr_t
offset
,
const
char
*
comment
)
{
Code
Comment
*
c
=
new
CodeComment
(
offset
,
commen
t
);
Code
Comment
*
inspos
=
(
_comments
==
NULL
)
?
NULL
:
_comments
->
find_last
(
offset
);
void
Code
String
s
::
add_comment
(
intptr_t
offset
,
const
char
*
comment
)
{
Code
String
*
c
=
new
CodeString
(
comment
,
offse
t
);
Code
String
*
inspos
=
(
_strings
==
NULL
)
?
NULL
:
find_last
(
offset
);
if
(
inspos
)
{
// insert after already existing comments with same offset
...
...
@@ -1062,43 +1082,47 @@ void CodeComments::add_comment(intptr_t offset, const char * comment) {
inspos
->
set_next
(
c
);
}
else
{
// no comments with such offset, yet. Insert before anything else.
c
->
set_next
(
_
comment
s
);
_
comment
s
=
c
;
c
->
set_next
(
_
string
s
);
_
string
s
=
c
;
}
}
void
CodeComments
::
assign
(
CodeComments
&
other
)
{
_comments
=
other
.
_comments
;
void
CodeStrings
::
assign
(
CodeStrings
&
other
)
{
_strings
=
other
.
_strings
;
}
void
CodeComments
::
print_block_comment
(
outputStream
*
stream
,
intptr_t
offset
)
const
{
if
(
_comments
!=
NULL
)
{
CodeComment
*
c
=
_comments
->
find
(
offset
);
void
CodeStrings
::
print_block_comment
(
outputStream
*
stream
,
intptr_t
offset
)
const
{
if
(
_strings
!=
NULL
)
{
CodeString
*
c
=
find
(
offset
);
while
(
c
&&
c
->
offset
()
==
offset
)
{
stream
->
bol
();
stream
->
print
(
" ;; "
);
stream
->
print_cr
(
c
->
comment
());
c
=
c
->
next
();
stream
->
print_cr
(
c
->
string
());
c
=
c
->
next
_comment
();
}
}
}
void
Code
Comment
s
::
free
()
{
Code
Comment
*
n
=
_comment
s
;
void
Code
String
s
::
free
()
{
Code
String
*
n
=
_string
s
;
while
(
n
)
{
// unlink the node from the list saving a pointer to the next
Code
Comment
*
p
=
n
->
_next
;
n
->
_next
=
NULL
;
Code
String
*
p
=
n
->
next
()
;
n
->
set_next
(
NULL
)
;
delete
n
;
n
=
p
;
}
_
comment
s
=
NULL
;
_
string
s
=
NULL
;
}
const
char
*
CodeStrings
::
add_string
(
const
char
*
string
)
{
CodeString
*
s
=
new
CodeString
(
string
);
s
->
set_next
(
_strings
);
_strings
=
s
;
assert
(
s
->
string
()
!=
NULL
,
"should have a string"
);
return
s
->
string
();
}
void
CodeBuffer
::
decode
()
{
ttyLocker
ttyl
;
...
...
src/share/vm/asm/codeBuffer.hpp
浏览文件 @
9dcc6c97
...
...
@@ -28,7 +28,7 @@
#include "code/oopRecorder.hpp"
#include "code/relocInfo.hpp"
class
Code
Comment
s
;
class
Code
String
s
;
class
PhaseCFG
;
class
Compile
;
class
BufferBlob
;
...
...
@@ -240,27 +240,31 @@ class CodeSection VALUE_OBJ_CLASS_SPEC {
#endif //PRODUCT
};
class
Code
Comment
;
class
Code
Comment
s
VALUE_OBJ_CLASS_SPEC
{
class
Code
String
;
class
Code
String
s
VALUE_OBJ_CLASS_SPEC
{
private:
#ifndef PRODUCT
Code
Comment
*
_comment
s
;
Code
String
*
_string
s
;
#endif
CodeString
*
find
(
intptr_t
offset
)
const
;
CodeString
*
find_last
(
intptr_t
offset
)
const
;
public:
Code
Comment
s
()
{
Code
String
s
()
{
#ifndef PRODUCT
_
comment
s
=
NULL
;
_
string
s
=
NULL
;
#endif
}
const
char
*
add_string
(
const
char
*
string
)
PRODUCT_RETURN_
(
return
NULL
;);
void
add_comment
(
intptr_t
offset
,
const
char
*
comment
)
PRODUCT_RETURN
;
void
print_block_comment
(
outputStream
*
stream
,
intptr_t
offset
)
const
PRODUCT_RETURN
;
void
assign
(
Code
Comment
s
&
other
)
PRODUCT_RETURN
;
void
assign
(
Code
String
s
&
other
)
PRODUCT_RETURN
;
void
free
()
PRODUCT_RETURN
;
};
// A CodeBuffer describes a memory space into which assembly
// code is generated. This memory space usually occupies the
// interior of a single BufferBlob, but in some cases it may be
...
...
@@ -326,7 +330,7 @@ class CodeBuffer: public StackObj {
csize_t
_total_size
;
// size in bytes of combined memory buffer
OopRecorder
*
_oop_recorder
;
Code
Comments
_comment
s
;
Code
Strings
_string
s
;
OopRecorder
_default_oop_recorder
;
// override with initialize_oop_recorder
Arena
*
_overflow_arena
;
...
...
@@ -527,7 +531,7 @@ class CodeBuffer: public StackObj {
void
initialize_oop_recorder
(
OopRecorder
*
r
);
OopRecorder
*
oop_recorder
()
const
{
return
_oop_recorder
;
}
Code
Comments
&
comments
()
{
return
_comment
s
;
}
Code
Strings
&
strings
()
{
return
_string
s
;
}
// Code generation
void
relocate
(
address
at
,
RelocationHolder
const
&
rspec
,
int
format
=
0
)
{
...
...
@@ -556,6 +560,7 @@ class CodeBuffer: public StackObj {
address
transform_address
(
const
CodeBuffer
&
cb
,
address
addr
)
const
;
void
block_comment
(
intptr_t
offset
,
const
char
*
comment
)
PRODUCT_RETURN
;
const
char
*
code_string
(
const
char
*
str
)
PRODUCT_RETURN_
(
return
NULL
;);
// Log a little info about section usage in the CodeBuffer
void
log_section_sizes
(
const
char
*
name
);
...
...
src/share/vm/code/codeBlob.cpp
浏览文件 @
9dcc6c97
...
...
@@ -186,7 +186,7 @@ void CodeBlob::flush() {
FREE_C_HEAP_ARRAY
(
unsigned
char
,
_oop_maps
,
mtCode
);
_oop_maps
=
NULL
;
}
_
comment
s
.
free
();
_
string
s
.
free
();
}
...
...
src/share/vm/code/codeBlob.hpp
浏览文件 @
9dcc6c97
...
...
@@ -66,7 +66,7 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC {
int
_data_offset
;
// offset to where data region begins
int
_frame_size
;
// size of stack frame
OopMapSet
*
_oop_maps
;
// OopMap for this CodeBlob
Code
Comments
_comment
s
;
Code
Strings
_string
s
;
public:
// Returns the space needed for CodeBlob
...
...
@@ -186,12 +186,12 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC {
// Print the comment associated with offset on stream, if there is one
virtual
void
print_block_comment
(
outputStream
*
stream
,
address
block_begin
)
const
{
intptr_t
offset
=
(
intptr_t
)(
block_begin
-
code_begin
());
_
comment
s
.
print_block_comment
(
stream
,
offset
);
_
string
s
.
print_block_comment
(
stream
,
offset
);
}
// Transfer ownership of comments to this CodeBlob
void
set_
comments
(
CodeComments
&
comment
s
)
{
_
comments
.
assign
(
comment
s
);
void
set_
strings
(
CodeStrings
&
string
s
)
{
_
strings
.
assign
(
string
s
);
}
};
...
...
src/share/vm/code/icBuffer.hpp
浏览文件 @
9dcc6c97
...
...
@@ -50,7 +50,7 @@ class ICStub: public Stub {
friend
class
ICStubInterface
;
// This will be called only by ICStubInterface
void
initialize
(
int
size
,
Code
Comments
comments
)
{
_size
=
size
;
_ic_site
=
NULL
;
}
Code
Strings
strings
)
{
_size
=
size
;
_ic_site
=
NULL
;
}
void
finalize
();
// called when a method is removed
// General info
...
...
src/share/vm/code/stubs.cpp
浏览文件 @
9dcc6c97
...
...
@@ -101,8 +101,8 @@ Stub* StubQueue::stub_containing(address pc) const {
Stub
*
StubQueue
::
request_committed
(
int
code_size
)
{
Stub
*
s
=
request
(
code_size
);
Code
Comments
comment
s
;
if
(
s
!=
NULL
)
commit
(
code_size
,
comment
s
);
Code
Strings
string
s
;
if
(
s
!=
NULL
)
commit
(
code_size
,
string
s
);
return
s
;
}
...
...
@@ -119,8 +119,8 @@ Stub* StubQueue::request(int requested_code_size) {
assert
(
_buffer_limit
==
_buffer_size
,
"buffer must be fully usable"
);
if
(
_queue_end
+
requested_size
<=
_buffer_size
)
{
// code fits in at the end => nothing to do
Code
Comments
comment
s
;
stub_initialize
(
s
,
requested_size
,
comment
s
);
Code
Strings
string
s
;
stub_initialize
(
s
,
requested_size
,
string
s
);
return
s
;
}
else
{
// stub doesn't fit in at the queue end
...
...
@@ -137,8 +137,8 @@ Stub* StubQueue::request(int requested_code_size) {
// Queue: |XXX|.......|XXXXXXX|.......|
// ^0 ^end ^begin ^limit ^size
s
=
current_stub
();
Code
Comments
comment
s
;
stub_initialize
(
s
,
requested_size
,
comment
s
);
Code
Strings
string
s
;
stub_initialize
(
s
,
requested_size
,
string
s
);
return
s
;
}
// Not enough space left
...
...
@@ -147,12 +147,12 @@ Stub* StubQueue::request(int requested_code_size) {
}
void
StubQueue
::
commit
(
int
committed_code_size
,
Code
Comments
&
comment
s
)
{
void
StubQueue
::
commit
(
int
committed_code_size
,
Code
Strings
&
string
s
)
{
assert
(
committed_code_size
>
0
,
"committed_code_size must be > 0"
);
int
committed_size
=
round_to
(
stub_code_size_to_size
(
committed_code_size
),
CodeEntryAlignment
);
Stub
*
s
=
current_stub
();
assert
(
committed_size
<=
stub_size
(
s
),
"committed size must not exceed requested size"
);
stub_initialize
(
s
,
committed_size
,
comment
s
);
stub_initialize
(
s
,
committed_size
,
string
s
);
_queue_end
+=
committed_size
;
_number_of_stubs
++
;
if
(
_mutex
!=
NULL
)
_mutex
->
unlock
();
...
...
src/share/vm/code/stubs.hpp
浏览文件 @
9dcc6c97
...
...
@@ -73,7 +73,7 @@ class Stub VALUE_OBJ_CLASS_SPEC {
public:
// Initialization/finalization
void
initialize
(
int
size
,
Code
Comments
&
comments
)
{
ShouldNotCallThis
();
}
// called to initialize/specify the stub's size
Code
Strings
&
strings
)
{
ShouldNotCallThis
();
}
// called to initialize/specify the stub's size
void
finalize
()
{
ShouldNotCallThis
();
}
// called before the stub is deallocated
// General info/converters
...
...
@@ -107,7 +107,7 @@ class StubInterface: public CHeapObj<mtCode> {
public:
// Initialization/finalization
virtual
void
initialize
(
Stub
*
self
,
int
size
,
Code
Comments
&
comments
)
=
0
;
// called after creation (called twice if allocated via (request, commit))
Code
Strings
&
strings
)
=
0
;
// called after creation (called twice if allocated via (request, commit))
virtual
void
finalize
(
Stub
*
self
)
=
0
;
// called before deallocation
// General info/converters
...
...
@@ -136,7 +136,7 @@ class StubInterface: public CHeapObj<mtCode> {
public: \
/* Initialization/finalization */
\
virtual void initialize(Stub* self, int size, \
Code
Comments& comments) { cast(self)->initialize(size, comment
s); } \
Code
Strings& strings) { cast(self)->initialize(size, string
s); } \
virtual void finalize(Stub* self) { cast(self)->finalize(); } \
\
/* General info */
\
...
...
@@ -176,7 +176,7 @@ class StubQueue: public CHeapObj<mtCode> {
// Stub functionality accessed via interface
void
stub_initialize
(
Stub
*
s
,
int
size
,
Code
Comments
&
comments
)
{
assert
(
size
%
CodeEntryAlignment
==
0
,
"size not aligned"
);
_stub_interface
->
initialize
(
s
,
size
,
comment
s
);
}
Code
Strings
&
strings
)
{
assert
(
size
%
CodeEntryAlignment
==
0
,
"size not aligned"
);
_stub_interface
->
initialize
(
s
,
size
,
string
s
);
}
void
stub_finalize
(
Stub
*
s
)
{
_stub_interface
->
finalize
(
s
);
}
int
stub_size
(
Stub
*
s
)
const
{
return
_stub_interface
->
size
(
s
);
}
bool
stub_contains
(
Stub
*
s
,
address
pc
)
const
{
return
_stub_interface
->
code_begin
(
s
)
<=
pc
&&
pc
<
_stub_interface
->
code_end
(
s
);
}
...
...
@@ -206,7 +206,7 @@ class StubQueue: public CHeapObj<mtCode> {
Stub
*
request_committed
(
int
code_size
);
// request a stub that provides exactly code_size space for code
Stub
*
request
(
int
requested_code_size
);
// request a stub with a (maximum) code space - locks the queue
void
commit
(
int
committed_code_size
,
Code
Comments
&
comments
);
// commit the previously requested stub - unlocks the queue
Code
Strings
&
strings
);
// commit the previously requested stub - unlocks the queue
// Stub deallocation
void
remove_first
();
// remove the first stub in the queue
...
...
src/share/vm/compiler/disassembler.cpp
浏览文件 @
9dcc6c97
...
...
@@ -158,7 +158,7 @@ class decode_env {
private:
nmethod
*
_nm
;
CodeBlob
*
_code
;
Code
Comments
_comment
s
;
Code
Strings
_string
s
;
outputStream
*
_output
;
address
_start
,
_end
;
...
...
@@ -198,7 +198,7 @@ class decode_env {
void
print_address
(
address
value
);
public:
decode_env
(
CodeBlob
*
code
,
outputStream
*
output
,
Code
Comments
c
=
CodeComment
s
());
decode_env
(
CodeBlob
*
code
,
outputStream
*
output
,
Code
Strings
c
=
CodeString
s
());
address
decode_instructions
(
address
start
,
address
end
);
...
...
@@ -242,13 +242,13 @@ class decode_env {
const
char
*
options
()
{
return
_option_buf
;
}
};
decode_env
::
decode_env
(
CodeBlob
*
code
,
outputStream
*
output
,
Code
Comment
s
c
)
{
decode_env
::
decode_env
(
CodeBlob
*
code
,
outputStream
*
output
,
Code
String
s
c
)
{
memset
(
this
,
0
,
sizeof
(
*
this
));
_output
=
output
?
output
:
tty
;
_code
=
code
;
if
(
code
!=
NULL
&&
code
->
is_nmethod
())
_nm
=
(
nmethod
*
)
code
;
_
comment
s
.
assign
(
c
);
_
string
s
.
assign
(
c
);
// by default, output pc but not bytes:
_print_pc
=
true
;
...
...
@@ -370,7 +370,7 @@ void decode_env::print_insn_labels() {
if
(
cb
!=
NULL
)
{
cb
->
print_block_comment
(
st
,
p
);
}
_
comment
s
.
print_block_comment
(
st
,
(
intptr_t
)(
p
-
_start
));
_
string
s
.
print_block_comment
(
st
,
(
intptr_t
)(
p
-
_start
));
if
(
_print_pc
)
{
st
->
print
(
" "
PTR_FORMAT
": "
,
p
);
}
...
...
@@ -498,7 +498,7 @@ void Disassembler::decode(CodeBlob* cb, outputStream* st) {
env
.
decode_instructions
(
cb
->
code_begin
(),
cb
->
code_end
());
}
void
Disassembler
::
decode
(
address
start
,
address
end
,
outputStream
*
st
,
Code
Comment
s
c
)
{
void
Disassembler
::
decode
(
address
start
,
address
end
,
outputStream
*
st
,
Code
String
s
c
)
{
if
(
!
load_library
())
return
;
decode_env
env
(
CodeCache
::
find_blob_unsafe
(
start
),
st
,
c
);
env
.
decode_instructions
(
start
,
end
);
...
...
src/share/vm/compiler/disassembler.hpp
浏览文件 @
9dcc6c97
...
...
@@ -100,7 +100,7 @@ class Disassembler {
}
static
void
decode
(
CodeBlob
*
cb
,
outputStream
*
st
=
NULL
);
static
void
decode
(
nmethod
*
nm
,
outputStream
*
st
=
NULL
);
static
void
decode
(
address
begin
,
address
end
,
outputStream
*
st
=
NULL
,
Code
Comments
c
=
CodeComment
s
());
static
void
decode
(
address
begin
,
address
end
,
outputStream
*
st
=
NULL
,
Code
Strings
c
=
CodeString
s
());
};
#endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP
src/share/vm/interpreter/interpreter.cpp
浏览文件 @
9dcc6c97
...
...
@@ -76,7 +76,7 @@ void InterpreterCodelet::print_on(outputStream* st) const {
if
(
PrintInterpreter
)
{
st
->
cr
();
Disassembler
::
decode
(
code_begin
(),
code_end
(),
st
,
DEBUG_ONLY
(
_
comments
)
NOT_DEBUG
(
CodeComment
s
()));
Disassembler
::
decode
(
code_begin
(),
code_end
(),
st
,
DEBUG_ONLY
(
_
strings
)
NOT_DEBUG
(
CodeString
s
()));
}
}
...
...
src/share/vm/interpreter/interpreter.hpp
浏览文件 @
9dcc6c97
...
...
@@ -48,12 +48,12 @@ class InterpreterCodelet: public Stub {
int
_size
;
// the size in bytes
const
char
*
_description
;
// a description of the codelet, for debugging & printing
Bytecodes
::
Code
_bytecode
;
// associated bytecode if any
DEBUG_ONLY
(
Code
Comments
_comments
;)
// Comments for annotating assembler output.
DEBUG_ONLY
(
Code
Strings
_strings
;)
// Comments for annotating assembler output.
public:
// Initialization/finalization
void
initialize
(
int
size
,
Code
Comments
&
comments
)
{
_size
=
size
;
DEBUG_ONLY
(
_comments
.
assign
(
comment
s
);)
}
Code
Strings
&
strings
)
{
_size
=
size
;
DEBUG_ONLY
(
_strings
.
assign
(
string
s
);)
}
void
finalize
()
{
ShouldNotCallThis
();
}
// General info/converters
...
...
@@ -131,7 +131,7 @@ class CodeletMark: ResourceMark {
// commit Codelet
AbstractInterpreter
::
code
()
->
commit
((
*
_masm
)
->
code
()
->
pure_insts_size
(),
(
*
_masm
)
->
code
()
->
comment
s
());
AbstractInterpreter
::
code
()
->
commit
((
*
_masm
)
->
code
()
->
pure_insts_size
(),
(
*
_masm
)
->
code
()
->
string
s
());
// make sure nobody can use _masm outside a CodeletMark lifespan
*
_masm
=
NULL
;
}
...
...
src/share/vm/runtime/stubCodeGenerator.cpp
浏览文件 @
9dcc6c97
...
...
@@ -87,7 +87,7 @@ StubCodeGenerator::~StubCodeGenerator() {
CodeBuffer
*
cbuf
=
_masm
->
code
();
CodeBlob
*
blob
=
CodeCache
::
find_blob_unsafe
(
cbuf
->
insts
()
->
start
());
if
(
blob
!=
NULL
)
{
blob
->
set_
comments
(
cbuf
->
comment
s
());
blob
->
set_
strings
(
cbuf
->
string
s
());
}
bool
saw_first
=
false
;
StubCodeDesc
*
toprint
[
1000
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录