Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
art
Commits
77bccdc5
Commit
77bccdc5
authored
9 years ago
by
Andreas Gampe
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Download
Plain Diff
Merge "ART: Clean up unnecessary ArtMethod**"
parents
fc298560
3a35714e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
runtime/entrypoints/entrypoint_utils-inl.h
runtime/entrypoints/entrypoint_utils-inl.h
+8
-8
runtime/entrypoints/entrypoint_utils.h
runtime/entrypoints/entrypoint_utils.h
+1
-1
runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+2
-2
runtime/interpreter/interpreter_common.h
runtime/interpreter/interpreter_common.h
+2
-2
No files found.
runtime/entrypoints/entrypoint_utils-inl.h
View file @
77bccdc5
...
...
@@ -426,15 +426,15 @@ EXPLICIT_FIND_FIELD_FROM_CODE_TYPED_TEMPLATE_DECL(StaticPrimitiveWrite);
template
<
InvokeType
type
,
bool
access_check
>
inline
ArtMethod
*
FindMethodFromCode
(
uint32_t
method_idx
,
mirror
::
Object
**
this_object
,
ArtMethod
*
*
referrer
,
Thread
*
self
)
{
ArtMethod
*
referrer
,
Thread
*
self
)
{
ClassLinker
*
const
class_linker
=
Runtime
::
Current
()
->
GetClassLinker
();
ArtMethod
*
resolved_method
=
class_linker
->
GetResolvedMethod
(
method_idx
,
*
referrer
);
ArtMethod
*
resolved_method
=
class_linker
->
GetResolvedMethod
(
method_idx
,
referrer
);
if
(
resolved_method
==
nullptr
)
{
StackHandleScope
<
1
>
hs
(
self
);
mirror
::
Object
*
null_this
=
nullptr
;
HandleWrapper
<
mirror
::
Object
>
h_this
(
hs
.
NewHandleWrapper
(
type
==
kStatic
?
&
null_this
:
this_object
));
resolved_method
=
class_linker
->
ResolveMethod
(
self
,
method_idx
,
*
referrer
,
type
);
resolved_method
=
class_linker
->
ResolveMethod
(
self
,
method_idx
,
referrer
,
type
);
}
if
(
UNLIKELY
(
resolved_method
==
nullptr
))
{
DCHECK
(
self
->
IsExceptionPending
());
// Throw exception and unwind.
...
...
@@ -448,11 +448,11 @@ inline ArtMethod* FindMethodFromCode(uint32_t method_idx, mirror::Object** this_
// Incompatible class change should have been handled in resolve method.
if
(
UNLIKELY
(
resolved_method
->
CheckIncompatibleClassChange
(
type
)))
{
ThrowIncompatibleClassChangeError
(
type
,
resolved_method
->
GetInvokeType
(),
resolved_method
,
*
referrer
);
referrer
);
return
nullptr
;
// Failure.
}
mirror
::
Class
*
methods_class
=
resolved_method
->
GetDeclaringClass
();
mirror
::
Class
*
referring_class
=
(
*
referrer
)
->
GetDeclaringClass
();
mirror
::
Class
*
referring_class
=
referrer
->
GetDeclaringClass
();
bool
can_access_resolved_method
=
referring_class
->
CheckResolvedMethodAccess
<
type
>
(
methods_class
,
resolved_method
,
method_idx
);
...
...
@@ -480,7 +480,7 @@ inline ArtMethod* FindMethodFromCode(uint32_t method_idx, mirror::Object** this_
return
klass
->
GetVTableEntry
(
vtable_index
,
class_linker
->
GetImagePointerSize
());
}
case
kSuper
:
{
mirror
::
Class
*
super_class
=
(
*
referrer
)
->
GetDeclaringClass
()
->
GetSuperClass
();
mirror
::
Class
*
super_class
=
referrer
->
GetDeclaringClass
()
->
GetSuperClass
();
uint16_t
vtable_index
=
resolved_method
->
GetMethodIndex
();
if
(
access_check
)
{
// Check existence of super class.
...
...
@@ -517,7 +517,7 @@ inline ArtMethod* FindMethodFromCode(uint32_t method_idx, mirror::Object** this_
resolved_method
,
class_linker
->
GetImagePointerSize
());
if
(
UNLIKELY
(
interface_method
==
nullptr
))
{
ThrowIncompatibleClassChangeErrorClassForInterfaceDispatch
(
resolved_method
,
*
this_object
,
*
referrer
);
*
this_object
,
referrer
);
return
nullptr
;
// Failure.
}
return
interface_method
;
...
...
@@ -534,7 +534,7 @@ inline ArtMethod* FindMethodFromCode(uint32_t method_idx, mirror::Object** this_
template SHARED_REQUIRES(Locks::mutator_lock_) ALWAYS_INLINE \
ArtMethod* FindMethodFromCode<_type, _access_check>(uint32_t method_idx, \
mirror::Object** this_object, \
ArtMethod*
*
referrer, \
ArtMethod* referrer, \
Thread* self)
#define EXPLICIT_FIND_METHOD_FROM_CODE_TYPED_TEMPLATE_DECL(_type) \
EXPLICIT_FIND_METHOD_FROM_CODE_TEMPLATE_DECL(_type, false); \
...
...
This diff is collapsed.
Click to expand it.
runtime/entrypoints/entrypoint_utils.h
View file @
77bccdc5
...
...
@@ -138,7 +138,7 @@ inline ArtField* FindFieldFromCode(
template
<
InvokeType
type
,
bool
access_check
>
inline
ArtMethod
*
FindMethodFromCode
(
uint32_t
method_idx
,
mirror
::
Object
**
this_object
,
ArtMethod
*
*
referrer
,
Thread
*
self
)
uint32_t
method_idx
,
mirror
::
Object
**
this_object
,
ArtMethod
*
referrer
,
Thread
*
self
)
SHARED_REQUIRES
(
Locks
::
mutator_lock_
);
// Fast path field resolution that can't initialize classes or throw exceptions.
...
...
This diff is collapsed.
Click to expand it.
runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
View file @
77bccdc5
...
...
@@ -1989,7 +1989,7 @@ static TwoWordReturn artInvokeCommon(uint32_t method_idx, mirror::Object* this_o
ScopedObjectAccessUnchecked
soa
(
self
->
GetJniEnv
());
RememberForGcArgumentVisitor
visitor
(
sp
,
type
==
kStatic
,
shorty
,
shorty_len
,
&
soa
);
visitor
.
VisitArguments
();
method
=
FindMethodFromCode
<
type
,
access_check
>
(
method_idx
,
&
this_object
,
&
caller_method
,
method
=
FindMethodFromCode
<
type
,
access_check
>
(
method_idx
,
&
this_object
,
caller_method
,
self
);
visitor
.
FixupReferences
();
}
...
...
@@ -2112,7 +2112,7 @@ extern "C" TwoWordReturn artInvokeInterfaceTrampoline(uint32_t dex_method_idx,
ScopedObjectAccessUnchecked
soa
(
self
->
GetJniEnv
());
RememberForGcArgumentVisitor
visitor
(
sp
,
false
,
shorty
,
shorty_len
,
&
soa
);
visitor
.
VisitArguments
();
method
=
FindMethodFromCode
<
kInterface
,
false
>
(
dex_method_idx
,
&
this_object
,
&
caller_method
,
method
=
FindMethodFromCode
<
kInterface
,
false
>
(
dex_method_idx
,
&
this_object
,
caller_method
,
self
);
visitor
.
FixupReferences
();
}
...
...
This diff is collapsed.
Click to expand it.
runtime/interpreter/interpreter_common.h
View file @
77bccdc5
...
...
@@ -169,7 +169,7 @@ static inline bool DoCreateLambda(Thread* self, ShadowFrame& shadow_frame,
mirror
::
Object
*
receiver
=
nullptr
;
// Always static. (see 'kStatic')
ArtMethod
*
sf_method
=
shadow_frame
.
GetMethod
();
ArtMethod
*
const
called_method
=
FindMethodFromCode
<
kStatic
,
do_access_check
>
(
method_idx
,
&
receiver
,
&
sf_method
,
self
);
method_idx
,
&
receiver
,
sf_method
,
self
);
uint32_t
vregA
=
inst
->
VRegA_21c
();
...
...
@@ -254,7 +254,7 @@ static inline bool DoInvoke(Thread* self, ShadowFrame& shadow_frame, const Instr
Object
*
receiver
=
(
type
==
kStatic
)
?
nullptr
:
shadow_frame
.
GetVRegReference
(
vregC
);
ArtMethod
*
sf_method
=
shadow_frame
.
GetMethod
();
ArtMethod
*
const
called_method
=
FindMethodFromCode
<
type
,
do_access_check
>
(
method_idx
,
&
receiver
,
&
sf_method
,
self
);
method_idx
,
&
receiver
,
sf_method
,
self
);
// The shadow frame should already be pushed, so we don't need to update it.
if
(
UNLIKELY
(
called_method
==
nullptr
))
{
CHECK
(
self
->
IsExceptionPending
());
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment