Re: Problem in Thread.c
"Sébastien Adam" <[email protected]> Sun, 16 Apr 2006 22:24:34 +0000
| Newsgroups | gmane.comp.java.vm.sablevm.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============0803409260==
Content-Type: multipart/alternative;
boundary="----=_Part_7002_22069587.1145226274139"
------=_Part_7002_22069587.1145226274139
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
When I collect the garbage I pass through the stack of each thread to get
the roots. In addition, I scavenge the heap. Each root is then updated...
Maybe should I pass through some other roots...
inline svm_static void
_svmf_trace_native_references (_svmt_JNIEnv *env)
{
_svmt_JavaVM *vm =3D env->vm;
_svmt_JNIEnv *thread;
/* Trace native global references. */
_svmf_trace_native_ref_list (env, vm->native_globals.list);
/* Trace stack and native local references. */
for (thread =3D vm->threads.user; thread !=3D NULL; thread =3D thread->ne=
xt)
{
_svmf_trace_native_ref_list (env, thread->native_locals.list);
_svmf_trace_stack (env, thread);
}
for (thread =3D vm->threads.system; thread !=3D NULL; thread =3D thread->=
next)
{
_svmf_trace_native_ref_list (env, thread->native_locals.list);
_svmf_trace_stack (env, thread);
}
}
On 4/16/06, Chris Pickett <[email protected]> wrote:
>
> Hi Seb,
>
> This is just a guess, but maybe it is because the object instance for an
> INVOKESTATIC is not on the heap but in class loader memory.
>
> Chris
>
> On Sun, April 16, 2006 10:41 am, S=E9bastien Adam wrote:
> > ... maybe should I add that enter_object_monitor is called in the
> > instruction SVM_INSTRUCTION_INVOKESTATIC in instructions_switch.c...
> >
> > /* preserve references on the stack across GC */
> > frame->stack_size =3D stack_size + args_count;
> >
> > if (_svmf_enter_object_monitor (env, instance) !=3D JNI_OK) {
> > goto exception_handler; }
> >
> >
> > ...
> > _______________________________________________
> > SableVM-devel mailing list
> > [email protected]
> > http://sablevm.org/lists/control/listinfo/sablevm-devel
> >
> >
>
>
>
> _______________________________________________
> SableVM-devel mailing list
> [email protected]
> http://sablevm.org/lists/control/listinfo/sablevm-devel
>
------=_Part_7002_22069587.1145226274139
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
When I collect the garbage I pass through the stack of each thread to
get the roots. In addition, I scavenge the heap. Each root is
then updated... Maybe should I pass through some other roots... <br>
<br>
inline svm_static void <br>
_svmf_trace_native_references (_svmt_JNIEnv *env)<br>
{<br>
_svmt_JavaVM *vm =3D env->vm;<br>
_svmt_JNIEnv *thread;<br>
<br>
/* Trace native global references. */<br>
_svmf_trace_native_ref_list (env, vm->native_globals.list);<br>
<br>
/* Trace stack and native local references. */<br>
for (thread =3D vm->threads.user; thread !=3D NULL; thread =3D th=
read->next)<br>
{<br>
_svmf_trace_native_ref_list (env, thread->=
;native_locals.list);<br>
<br>
_svmf_trace_stack (env, thread);<br>
}<br>
<br>
for (thread =3D vm->threads.system; thread !=3D NULL; thread =3D =
thread->next)<br>
{<br>
_svmf_trace_native_ref_list (env, thread->=
;native_locals.list);<br>
<br>
_svmf_trace_stack (env, thread);<br>
}<br>
}<br><br><div><span class=3D"gmail_quote">On 4/16/06, <b class=3D"gmail_sen=
dername">Chris Pickett</b> <<a href=3D"mailto:[email protected].=
ca">[email protected]</a>> wrote:</span><blockquote class=3D"=
gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0p=
t 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Seb,<br><br>This is just a guess, but maybe it is because the object ins=
tance for an<br>INVOKESTATIC is not on the heap but in class loader memory.=
<br><br>Chris<br><br>On Sun, April 16, 2006 10:41 am, S=E9bastien Adam wrot=
e:
<br>> ... maybe should I add that enter_object_monitor is called in the<=
br>> instruction SVM_INSTRUCTION_INVOKESTATIC in instructions_switch.c..=
.<br>><br>> /* preserve references on the stack across GC */<br>> =
frame->stack_size =3D stack_size + args_count;
<br>><br>> if (_svmf_enter_object_monitor (env, instance) !=3D JNI_OK=
) {<br>> goto exception_handler; }<br>><br>><br>> ...<br>> _=
______________________________________________<br>> SableVM-devel mailin=
g list
<br>> <a href=3D"mailto:[email protected]">SableVM-devel@sablevm=
.org</a><br>> <a href=3D"http://sablevm.org/lists/control/listinfo/sable=
vm-devel">http://sablevm.org/lists/control/listinfo/sablevm-devel</a><br>&g=
t;
<br>><br><br><br><br>_______________________________________________<br>=
SableVM-devel mailing list<br><a href=3D"mailto:[email protected]">=
[email protected]</a><br><a href=3D"http://sablevm.org/lists/contro=
l/listinfo/sablevm-devel">
http://sablevm.org/lists/control/listinfo/sablevm-devel</a><br></blockquote=
></div><br>
------=_Part_7002_22069587.1145226274139--
--===============0803409260==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
SableVM-devel mailing list
[email protected]
http://sablevm.org/lists/control/listinfo/sablevm-devel
--===============0803409260==--