Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
6d938636
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看板
提交
6d938636
编写于
9年前
作者:
D
dholmes
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
f5a393f7
f698d6fb
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
134 addition
and
88 deletion
+134
-88
agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java
...rc/share/classes/com/sun/java/swing/ui/CommonToolBar.java
+1
-1
agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java
agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java
+20
-15
src/share/vm/classfile/classLoaderData.cpp
src/share/vm/classfile/classLoaderData.cpp
+0
-30
src/share/vm/classfile/javaClasses.cpp
src/share/vm/classfile/javaClasses.cpp
+56
-36
src/share/vm/classfile/javaClasses.hpp
src/share/vm/classfile/javaClasses.hpp
+7
-6
src/share/vm/oops/instanceKlass.cpp
src/share/vm/oops/instanceKlass.cpp
+47
-0
src/share/vm/oops/instanceKlass.hpp
src/share/vm/oops/instanceKlass.hpp
+3
-0
未找到文件。
agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java
浏览文件 @
6d938636
...
...
@@ -46,7 +46,7 @@ public abstract class CommonToolBar extends JToolBar
{
this
.
manager
=
manager
;
statusBar
=
status
;
buttonSize
=
new
Dimension
(
CommonUI
.
buttconPrefSize
);
buttonSize
=
new
Dimension
(
CommonUI
.
getButtconPrefSize
()
);
buttonInsets
=
new
Insets
(
0
,
0
,
0
,
0
);
addComponents
();
}
...
...
This diff is collapsed.
Click to expand it.
agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java
浏览文件 @
6d938636
...
...
@@ -373,20 +373,25 @@ public class CommonUI
comp
.
setCursor
(
Cursor
.
getPredefinedCursor
(
0
));
}
public
static
final
int
BUTTON_WIDTH
=
100
;
public
static
final
int
BUTTON_HEIGHT
=
26
;
public
static
final
int
BUTTCON_WIDTH
=
28
;
public
static
final
int
BUTTCON_HEIGHT
=
28
;
public
static
final
int
SM_BUTTON_WIDTH
=
72
;
public
static
final
int
SM_BUTTON_HEIGHT
=
26
;
public
static
final
int
LABEL_WIDTH
=
100
;
public
static
final
int
LABEL_HEIGHT
=
20
;
public
static
final
int
TEXT_WIDTH
=
150
;
public
static
final
int
TEXT_HEIGHT
=
20
;
public
static
Dimension
buttonPrefSize
=
new
Dimension
(
100
,
26
);
public
static
Dimension
buttconPrefSize
=
new
Dimension
(
28
,
28
);
public
static
Dimension
smbuttonPrefSize
=
new
Dimension
(
72
,
26
);
public
static
Dimension
labelPrefSize
=
new
Dimension
(
100
,
20
);
public
static
Dimension
textPrefSize
=
new
Dimension
(
150
,
20
);
public
static
Dimension
getButtconPrefSize
()
{
return
buttconPrefSize
;
}
private
static
final
int
BUTTON_WIDTH
=
100
;
private
static
final
int
BUTTON_HEIGHT
=
26
;
private
static
final
int
BUTTCON_WIDTH
=
28
;
private
static
final
int
BUTTCON_HEIGHT
=
28
;
private
static
final
int
SM_BUTTON_WIDTH
=
72
;
private
static
final
int
SM_BUTTON_HEIGHT
=
26
;
private
static
final
int
LABEL_WIDTH
=
100
;
private
static
final
int
LABEL_HEIGHT
=
20
;
private
static
final
int
TEXT_WIDTH
=
150
;
private
static
final
int
TEXT_HEIGHT
=
20
;
private
static
final
Dimension
buttonPrefSize
=
new
Dimension
(
100
,
26
);
private
static
final
Dimension
buttconPrefSize
=
new
Dimension
(
28
,
28
);
private
static
final
Dimension
smbuttonPrefSize
=
new
Dimension
(
72
,
26
);
private
static
final
Dimension
labelPrefSize
=
new
Dimension
(
100
,
20
);
private
static
final
Dimension
textPrefSize
=
new
Dimension
(
150
,
20
);
}
This diff is collapsed.
Click to expand it.
src/share/vm/classfile/classLoaderData.cpp
浏览文件 @
6d938636
...
...
@@ -320,27 +320,6 @@ void ClassLoaderData::unload() {
}
}
#ifdef ASSERT
class
AllAliveClosure
:
public
OopClosure
{
BoolObjectClosure
*
_is_alive_closure
;
bool
_found_dead
;
public:
AllAliveClosure
(
BoolObjectClosure
*
is_alive_closure
)
:
_is_alive_closure
(
is_alive_closure
),
_found_dead
(
false
)
{}
template
<
typename
T
>
void
do_oop_work
(
T
*
p
)
{
T
heap_oop
=
oopDesc
::
load_heap_oop
(
p
);
if
(
!
oopDesc
::
is_null
(
heap_oop
))
{
oop
obj
=
oopDesc
::
decode_heap_oop_not_null
(
heap_oop
);
if
(
!
_is_alive_closure
->
do_object_b
(
obj
))
{
_found_dead
=
true
;
}
}
}
void
do_oop
(
oop
*
p
)
{
do_oop_work
<
oop
>
(
p
);
}
void
do_oop
(
narrowOop
*
p
)
{
do_oop_work
<
narrowOop
>
(
p
);
}
bool
found_dead
()
{
return
_found_dead
;
}
};
#endif
oop
ClassLoaderData
::
keep_alive_object
()
const
{
assert
(
!
keep_alive
(),
"Don't use with CLDs that are artificially kept alive"
);
return
is_anonymous
()
?
_klasses
->
java_mirror
()
:
class_loader
();
...
...
@@ -350,15 +329,6 @@ bool ClassLoaderData::is_alive(BoolObjectClosure* is_alive_closure) const {
bool
alive
=
keep_alive
()
// null class loader and incomplete anonymous klasses.
||
is_alive_closure
->
do_object_b
(
keep_alive_object
());
#ifdef ASSERT
if
(
alive
)
{
AllAliveClosure
all_alive_closure
(
is_alive_closure
);
KlassToOopClosure
klass_closure
(
&
all_alive_closure
);
const_cast
<
ClassLoaderData
*>
(
this
)
->
oops_do
(
&
all_alive_closure
,
&
klass_closure
,
false
);
assert
(
!
all_alive_closure
.
found_dead
(),
err_msg
(
"Found dead oop in alive cld: "
PTR_FORMAT
,
p2i
(
this
)));
}
#endif
return
alive
;
}
...
...
This diff is collapsed.
Click to expand it.
src/share/vm/classfile/javaClasses.cpp
浏览文件 @
6d938636
/*
* Copyright (c) 1997, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
5
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -1278,7 +1278,8 @@ static inline int version_at(unsigned int merged) {
}
static
inline
bool
version_matches
(
Method
*
method
,
int
version
)
{
return
(
method
->
constants
()
->
version
()
==
version
&&
version
<
MAX_VERSION
);
assert
(
version
<
MAX_VERSION
,
"version is too big"
);
return
method
!=
NULL
&&
(
method
->
constants
()
->
version
()
==
version
);
}
static
inline
int
get_line_number
(
Method
*
method
,
int
bci
)
{
...
...
@@ -1308,6 +1309,7 @@ class BacktraceBuilder: public StackObj {
typeArrayOop
_methods
;
typeArrayOop
_bcis
;
objArrayOop
_mirrors
;
typeArrayOop
_cprefs
;
// needed to insulate method name against redefinition
int
_index
;
No_Safepoint_Verifier
_nsv
;
...
...
@@ -1315,8 +1317,9 @@ class BacktraceBuilder: public StackObj {
enum
{
trace_methods_offset
=
java_lang_Throwable
::
trace_methods_offset
,
trace_bcis_offset
=
java_lang_Throwable
::
trace_bcis_offset
,
trace_bcis_offset
=
java_lang_Throwable
::
trace_bcis_offset
,
trace_mirrors_offset
=
java_lang_Throwable
::
trace_mirrors_offset
,
trace_cprefs_offset
=
java_lang_Throwable
::
trace_cprefs_offset
,
trace_next_offset
=
java_lang_Throwable
::
trace_next_offset
,
trace_size
=
java_lang_Throwable
::
trace_size
,
trace_chunk_size
=
java_lang_Throwable
::
trace_chunk_size
...
...
@@ -1338,9 +1341,14 @@ class BacktraceBuilder: public StackObj {
assert
(
mirrors
!=
NULL
,
"mirror array should be initialized in backtrace"
);
return
mirrors
;
}
static
typeArrayOop
get_cprefs
(
objArrayHandle
chunk
)
{
typeArrayOop
cprefs
=
typeArrayOop
(
chunk
->
obj_at
(
trace_cprefs_offset
));
assert
(
cprefs
!=
NULL
,
"cprefs array should be initialized in backtrace"
);
return
cprefs
;
}
// constructor for new backtrace
BacktraceBuilder
(
TRAPS
)
:
_methods
(
NULL
),
_bcis
(
NULL
),
_head
(
NULL
),
_mirrors
(
NULL
)
{
BacktraceBuilder
(
TRAPS
)
:
_methods
(
NULL
),
_bcis
(
NULL
),
_head
(
NULL
),
_mirrors
(
NULL
)
,
_cprefs
(
NULL
)
{
expand
(
CHECK
);
_backtrace
=
_head
;
_index
=
0
;
...
...
@@ -1350,6 +1358,7 @@ class BacktraceBuilder: public StackObj {
_methods
=
get_methods
(
backtrace
);
_bcis
=
get_bcis
(
backtrace
);
_mirrors
=
get_mirrors
(
backtrace
);
_cprefs
=
get_cprefs
(
backtrace
);
assert
(
_methods
->
length
()
==
_bcis
->
length
()
&&
_methods
->
length
()
==
_mirrors
->
length
(),
"method and source information arrays should match"
);
...
...
@@ -1375,17 +1384,22 @@ class BacktraceBuilder: public StackObj {
objArrayOop
mirrors
=
oopFactory
::
new_objectArray
(
trace_chunk_size
,
CHECK
);
objArrayHandle
new_mirrors
(
THREAD
,
mirrors
);
typeArrayOop
cprefs
=
oopFactory
::
new_shortArray
(
trace_chunk_size
,
CHECK
);
typeArrayHandle
new_cprefs
(
THREAD
,
cprefs
);
if
(
!
old_head
.
is_null
())
{
old_head
->
obj_at_put
(
trace_next_offset
,
new_head
());
}
new_head
->
obj_at_put
(
trace_methods_offset
,
new_methods
());
new_head
->
obj_at_put
(
trace_bcis_offset
,
new_bcis
());
new_head
->
obj_at_put
(
trace_mirrors_offset
,
new_mirrors
());
new_head
->
obj_at_put
(
trace_cprefs_offset
,
new_cprefs
());
_head
=
new_head
();
_methods
=
new_methods
();
_bcis
=
new_bcis
();
_mirrors
=
new_mirrors
();
_cprefs
=
new_cprefs
();
_index
=
0
;
}
...
...
@@ -1405,8 +1419,9 @@ class BacktraceBuilder: public StackObj {
method
=
mhandle
();
}
_methods
->
short_at_put
(
_index
,
method
->
method_idnum
());
_methods
->
short_at_put
(
_index
,
method
->
orig_
method_idnum
());
_bcis
->
int_at_put
(
_index
,
merge_bci_and_version
(
bci
,
method
->
constants
()
->
version
()));
_cprefs
->
short_at_put
(
_index
,
method
->
name_index
());
// We need to save the mirrors in the backtrace to keep the class
// from being unloaded while we still have this stack trace.
...
...
@@ -1419,27 +1434,26 @@ class BacktraceBuilder: public StackObj {
// Print stack trace element to resource allocated buffer
char
*
java_lang_Throwable
::
print_stack_element_to_buffer
(
Handle
mirror
,
int
method_id
,
int
version
,
int
bci
)
{
int
method_id
,
int
version
,
int
bci
,
int
cpref
)
{
// Get strings and string lengths
InstanceKlass
*
holder
=
InstanceKlass
::
cast
(
java_lang_Class
::
as_Klass
(
mirror
()));
const
char
*
klass_name
=
holder
->
external_name
();
int
buf_len
=
(
int
)
strlen
(
klass_name
);
// The method id may point to an obsolete method, can't get more stack information
Method
*
method
=
holder
->
method_with_idnum
(
method_id
);
if
(
method
==
NULL
)
{
char
*
buf
=
NEW_RESOURCE_ARRAY
(
char
,
buf_len
+
64
);
// This is what the java code prints in this case - added Redefined
sprintf
(
buf
,
"
\t
at %s.null (Redefined)"
,
klass_name
);
return
buf
;
}
Method
*
method
=
holder
->
method_with_orig_idnum
(
method_id
,
version
);
char
*
method_name
=
method
->
name
()
->
as_C_string
();
// The method can be NULL if the requested class version is gone
Symbol
*
sym
=
(
method
!=
NULL
)
?
method
->
name
()
:
holder
->
constants
()
->
symbol_at
(
cpref
);
char
*
method_name
=
sym
->
as_C_string
();
buf_len
+=
(
int
)
strlen
(
method_name
);
// Use a specific ik version as a holder since the mirror might
// refer to a version that is now obsolete and no longer accessible
// via the previous versions list.
holder
=
holder
->
get_klass_version
(
version
);
char
*
source_file_name
=
NULL
;
if
(
version_matches
(
method
,
version
)
)
{
if
(
holder
!=
NULL
)
{
Symbol
*
source
=
holder
->
source_file_name
();
if
(
source
!=
NULL
)
{
source_file_name
=
source
->
as_C_string
();
...
...
@@ -1481,17 +1495,18 @@ char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror,
}
void
java_lang_Throwable
::
print_stack_element
(
outputStream
*
st
,
Handle
mirror
,
int
method_id
,
int
version
,
int
bci
)
{
int
method_id
,
int
version
,
int
bci
,
int
cpref
)
{
ResourceMark
rm
;
char
*
buf
=
print_stack_element_to_buffer
(
mirror
,
method_id
,
version
,
bci
);
char
*
buf
=
print_stack_element_to_buffer
(
mirror
,
method_id
,
version
,
bci
,
cpref
);
st
->
print_cr
(
"%s"
,
buf
);
}
void
java_lang_Throwable
::
print_stack_element
(
outputStream
*
st
,
methodHandle
method
,
int
bci
)
{
Handle
mirror
=
method
->
method_holder
()
->
java_mirror
();
int
method_id
=
method
->
method_idnum
();
int
method_id
=
method
->
orig_
method_idnum
();
int
version
=
method
->
constants
()
->
version
();
print_stack_element
(
st
,
mirror
,
method_id
,
version
,
bci
);
int
cpref
=
method
->
name_index
();
print_stack_element
(
st
,
mirror
,
method_id
,
version
,
bci
,
cpref
);
}
const
char
*
java_lang_Throwable
::
no_stack_trace_message
()
{
...
...
@@ -1516,6 +1531,7 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
typeArrayHandle
methods
(
THREAD
,
BacktraceBuilder
::
get_methods
(
result
));
typeArrayHandle
bcis
(
THREAD
,
BacktraceBuilder
::
get_bcis
(
result
));
objArrayHandle
mirrors
(
THREAD
,
BacktraceBuilder
::
get_mirrors
(
result
));
typeArrayHandle
cprefs
(
THREAD
,
BacktraceBuilder
::
get_cprefs
(
result
));
int
length
=
methods
()
->
length
();
for
(
int
index
=
0
;
index
<
length
;
index
++
)
{
...
...
@@ -1525,7 +1541,8 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
int
method
=
methods
->
short_at
(
index
);
int
version
=
version_at
(
bcis
->
int_at
(
index
));
int
bci
=
bci_at
(
bcis
->
int_at
(
index
));
print_stack_element
(
st
,
mirror
,
method
,
version
,
bci
);
int
cpref
=
cprefs
->
short_at
(
index
);
print_stack_element
(
st
,
mirror
,
method
,
version
,
bci
,
cpref
);
}
result
=
objArrayHandle
(
THREAD
,
objArrayOop
(
result
->
obj_at
(
trace_next_offset
)));
}
...
...
@@ -1809,29 +1826,30 @@ oop java_lang_Throwable::get_stack_trace_element(oop throwable, int index, TRAPS
if
(
chunk
==
NULL
)
{
THROW_
(
vmSymbols
::
java_lang_IndexOutOfBoundsException
(),
NULL
);
}
// Get method id, bci, version
and mirror
from chunk
// Get method id, bci, version
, mirror and cpref
from chunk
typeArrayOop
methods
=
BacktraceBuilder
::
get_methods
(
chunk
);
typeArrayOop
bcis
=
BacktraceBuilder
::
get_bcis
(
chunk
);
objArrayOop
mirrors
=
BacktraceBuilder
::
get_mirrors
(
chunk
);
typeArrayOop
cprefs
=
BacktraceBuilder
::
get_cprefs
(
chunk
);
assert
(
methods
!=
NULL
&&
bcis
!=
NULL
&&
mirrors
!=
NULL
,
"sanity check"
);
int
method
=
methods
->
short_at
(
chunk_index
);
int
version
=
version_at
(
bcis
->
int_at
(
chunk_index
));
int
bci
=
bci_at
(
bcis
->
int_at
(
chunk_index
));
int
cpref
=
cprefs
->
short_at
(
chunk_index
);
Handle
mirror
(
THREAD
,
mirrors
->
obj_at
(
chunk_index
));
// Chunk can be partial full
if
(
mirror
.
is_null
())
{
THROW_
(
vmSymbols
::
java_lang_IndexOutOfBoundsException
(),
NULL
);
}
oop
element
=
java_lang_StackTraceElement
::
create
(
mirror
,
method
,
version
,
bci
,
CHECK_0
);
oop
element
=
java_lang_StackTraceElement
::
create
(
mirror
,
method
,
version
,
bci
,
cpref
,
CHECK_0
);
return
element
;
}
oop
java_lang_StackTraceElement
::
create
(
Handle
mirror
,
int
method_id
,
int
version
,
int
bci
,
TRAPS
)
{
int
version
,
int
bci
,
int
cpref
,
TRAPS
)
{
// Allocate java.lang.StackTraceElement instance
Klass
*
k
=
SystemDictionary
::
StackTraceElement_klass
();
assert
(
k
!=
NULL
,
"must be loaded in 1.4+"
);
...
...
@@ -1848,17 +1866,13 @@ oop java_lang_StackTraceElement::create(Handle mirror, int method_id,
oop
classname
=
StringTable
::
intern
((
char
*
)
str
,
CHECK_0
);
java_lang_StackTraceElement
::
set_declaringClass
(
element
(),
classname
);
Method
*
method
=
holder
->
method_with_idnum
(
method_id
);
// Method on stack may be obsolete because it was redefined so cannot be
// found by idnum.
if
(
method
==
NULL
)
{
// leave name and fileName null
java_lang_StackTraceElement
::
set_lineNumber
(
element
(),
-
1
);
return
element
();
}
Method
*
method
=
holder
->
method_with_orig_idnum
(
method_id
,
version
);
// The method can be NULL if the requested class version is gone
Symbol
*
sym
=
(
method
!=
NULL
)
?
method
->
name
()
:
holder
->
constants
()
->
symbol_at
(
cpref
);
// Fill in method name
oop
methodname
=
StringTable
::
intern
(
method
->
name
()
,
CHECK_0
);
oop
methodname
=
StringTable
::
intern
(
sym
,
CHECK_0
);
java_lang_StackTraceElement
::
set_methodName
(
element
(),
methodname
);
if
(
!
version_matches
(
method
,
version
))
{
...
...
@@ -1867,6 +1881,11 @@ oop java_lang_StackTraceElement::create(Handle mirror, int method_id,
java_lang_StackTraceElement
::
set_lineNumber
(
element
(),
-
1
);
}
else
{
// Fill in source file name and line number.
// Use a specific ik version as a holder since the mirror might
// refer to a version that is now obsolete and no longer accessible
// via the previous versions list.
holder
=
holder
->
get_klass_version
(
version
);
assert
(
holder
!=
NULL
,
"sanity check"
);
Symbol
*
source
=
holder
->
source_file_name
();
if
(
ShowHiddenFrames
&&
source
==
NULL
)
source
=
vmSymbols
::
unknown_class_name
();
...
...
@@ -1881,8 +1900,9 @@ oop java_lang_StackTraceElement::create(Handle mirror, int method_id,
oop
java_lang_StackTraceElement
::
create
(
methodHandle
method
,
int
bci
,
TRAPS
)
{
Handle
mirror
(
THREAD
,
method
->
method_holder
()
->
java_mirror
());
int
method_id
=
method
->
method_idnum
();
return
create
(
mirror
,
method_id
,
method
->
constants
()
->
version
(),
bci
,
THREAD
);
int
method_id
=
method
->
orig_method_idnum
();
int
cpref
=
method
->
name_index
();
return
create
(
mirror
,
method_id
,
method
->
constants
()
->
version
(),
bci
,
cpref
,
THREAD
);
}
void
java_lang_reflect_AccessibleObject
::
compute_offsets
()
{
...
...
This diff is collapsed.
Click to expand it.
src/share/vm/classfile/javaClasses.hpp
浏览文件 @
6d938636
/*
* Copyright (c) 1997, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
5
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -484,8 +484,9 @@ class java_lang_Throwable: AllStatic {
trace_methods_offset
=
0
,
trace_bcis_offset
=
1
,
trace_mirrors_offset
=
2
,
trace_next_offset
=
3
,
trace_size
=
4
,
trace_cprefs_offset
=
3
,
trace_next_offset
=
4
,
trace_size
=
5
,
trace_chunk_size
=
32
};
...
...
@@ -496,7 +497,7 @@ class java_lang_Throwable: AllStatic {
static
int
static_unassigned_stacktrace_offset
;
// Printing
static
char
*
print_stack_element_to_buffer
(
Handle
mirror
,
int
method
,
int
version
,
int
bci
);
static
char
*
print_stack_element_to_buffer
(
Handle
mirror
,
int
method
,
int
version
,
int
bci
,
int
cpref
);
// StackTrace (programmatic access, new since 1.4)
static
void
clear_stacktrace
(
oop
throwable
);
// No stack trace available
...
...
@@ -517,7 +518,7 @@ class java_lang_Throwable: AllStatic {
static
oop
message
(
Handle
throwable
);
static
void
set_message
(
oop
throwable
,
oop
value
);
static
void
print_stack_element
(
outputStream
*
st
,
Handle
mirror
,
int
method
,
int
version
,
int
bci
);
int
version
,
int
bci
,
int
cpref
);
static
void
print_stack_element
(
outputStream
*
st
,
methodHandle
method
,
int
bci
);
static
void
print_stack_usage
(
Handle
stream
);
...
...
@@ -1326,7 +1327,7 @@ class java_lang_StackTraceElement: AllStatic {
static
void
set_lineNumber
(
oop
element
,
int
value
);
// Create an instance of StackTraceElement
static
oop
create
(
Handle
mirror
,
int
method
,
int
version
,
int
bci
,
TRAPS
);
static
oop
create
(
Handle
mirror
,
int
method
,
int
version
,
int
bci
,
int
cpref
,
TRAPS
);
static
oop
create
(
methodHandle
method
,
int
bci
,
TRAPS
);
// Debugging
...
...
This diff is collapsed.
Click to expand it.
src/share/vm/oops/instanceKlass.cpp
浏览文件 @
6d938636
...
...
@@ -3747,6 +3747,22 @@ bool InstanceKlass::has_previous_version() const {
}
// end has_previous_version()
InstanceKlass
*
InstanceKlass
::
get_klass_version
(
int
version
)
{
if
(
constants
()
->
version
()
==
version
)
{
return
this
;
}
PreviousVersionWalker
pvw
(
Thread
::
current
(),
(
InstanceKlass
*
)
this
);
for
(
PreviousVersionNode
*
pv_node
=
pvw
.
next_previous_version
();
pv_node
!=
NULL
;
pv_node
=
pvw
.
next_previous_version
())
{
ConstantPool
*
prev_cp
=
pv_node
->
prev_constant_pool
();
if
(
prev_cp
->
version
()
==
version
)
{
return
prev_cp
->
pool_holder
();
}
}
return
NULL
;
// None found
}
Method
*
InstanceKlass
::
method_with_idnum
(
int
idnum
)
{
Method
*
m
=
NULL
;
if
(
idnum
<
methods
()
->
length
())
{
...
...
@@ -3765,6 +3781,37 @@ Method* InstanceKlass::method_with_idnum(int idnum) {
return
m
;
}
Method
*
InstanceKlass
::
method_with_orig_idnum
(
int
idnum
)
{
if
(
idnum
>=
methods
()
->
length
())
{
return
NULL
;
}
Method
*
m
=
methods
()
->
at
(
idnum
);
if
(
m
!=
NULL
&&
m
->
orig_method_idnum
()
==
idnum
)
{
return
m
;
}
// Obsolete method idnum does not match the original idnum
for
(
int
index
=
0
;
index
<
methods
()
->
length
();
++
index
)
{
m
=
methods
()
->
at
(
index
);
if
(
m
->
orig_method_idnum
()
==
idnum
)
{
return
m
;
}
}
// None found, return null for the caller to handle.
return
NULL
;
}
Method
*
InstanceKlass
::
method_with_orig_idnum
(
int
idnum
,
int
version
)
{
InstanceKlass
*
holder
=
get_klass_version
(
version
);
if
(
holder
==
NULL
)
{
return
NULL
;
// The version of klass is gone, no method is found
}
Method
*
method
=
holder
->
method_with_orig_idnum
(
idnum
);
return
method
;
}
jint
InstanceKlass
::
get_cached_class_file_len
()
{
return
VM_RedefineClasses
::
get_cached_class_file_len
(
_cached_class_file
);
}
...
...
This diff is collapsed.
Click to expand it.
src/share/vm/oops/instanceKlass.hpp
浏览文件 @
6d938636
...
...
@@ -358,6 +358,8 @@ class InstanceKlass: public Klass {
Array
<
Method
*>*
methods
()
const
{
return
_methods
;
}
void
set_methods
(
Array
<
Method
*>*
a
)
{
_methods
=
a
;
}
Method
*
method_with_idnum
(
int
idnum
);
Method
*
method_with_orig_idnum
(
int
idnum
);
Method
*
method_with_orig_idnum
(
int
idnum
,
int
version
);
// method ordering
Array
<
int
>*
method_ordering
()
const
{
return
_method_ordering
;
}
...
...
@@ -658,6 +660,7 @@ class InstanceKlass: public Klass {
return
_previous_versions
;
}
InstanceKlass
*
get_klass_version
(
int
version
);
static
void
purge_previous_versions
(
InstanceKlass
*
ik
);
// JVMTI: Support for caching a class file before it is modified by an agent that can do retransformation
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部