diff options
author | Tom Tromey <tromey@redhat.com> | 2002-12-06 23:41:38 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2002-12-06 23:41:38 +0000 |
commit | b4d0051bd97c7c6cb2e5e2dc65286985cfccb35c (patch) | |
tree | 17255e0977815a30bda684d2dba5ea831676898f /libjava/boehm.cc | |
parent | 377dfc820f477c12d33c99b238171788c40fda02 (diff) | |
download | gcc-b4d0051bd97c7c6cb2e5e2dc65286985cfccb35c.zip gcc-b4d0051bd97c7c6cb2e5e2dc65286985cfccb35c.tar.gz gcc-b4d0051bd97c7c6cb2e5e2dc65286985cfccb35c.tar.bz2 |
java-interp.h (class _Jv_InterpMethod): Added JV_MARKOBJ_DECL.
* include/java-interp.h (class _Jv_InterpMethod): Added
JV_MARKOBJ_DECL.
* boehm.cc (_Jv_MarkObj): Consolidated interpreter code. Also
mark `prepared' field of interpreted method.
* interpret.cc (compile): Use _Jv_AllocBytes.
From-SVN: r59900
Diffstat (limited to 'libjava/boehm.cc')
-rw-r--r-- | libjava/boehm.cc | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/libjava/boehm.cc b/libjava/boehm.cc index 466c922..90796f2 100644 --- a/libjava/boehm.cc +++ b/libjava/boehm.cc @@ -39,7 +39,6 @@ extern "C" ptr_t GC_debug_generic_malloc (size_t size, int k, GC_EXTRA_PARAMS); }; -// We must check for plausibility ourselves. #define MAYBE_MARK(Obj, Top, Limit, Source, Exit) \ Top=GC_MARK_AND_PUSH((GC_PTR)Obj, Top, Limit, (GC_PTR *)Source) @@ -153,19 +152,6 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /* env */) p = (ptr_t) c->methods[i].signature; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cm2label); - - // FIXME: `ncode' entry? - -#ifdef INTERPRETER - // The interpreter installs a heap-allocated - // trampoline here, so we'll mark it. - if (_Jv_IsInterpretedClass (c)) - { - p = (ptr_t) c->methods[i].ncode; - MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, - cm3label); - } -#endif } } @@ -221,7 +207,7 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /* env */) #ifdef INTERPRETER if (_Jv_IsInterpretedClass (c)) { - _Jv_InterpClass* ic = (_Jv_InterpClass*)c; + _Jv_InterpClass* ic = (_Jv_InterpClass*) c; p = (ptr_t) ic->interpreted_methods; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, cElabel); @@ -231,6 +217,26 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /* env */) p = (ptr_t) ic->interpreted_methods[i]; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, \ cFlabel); + + // Mark the direct-threaded code. + if ((c->methods[i].accflags + & java::lang::reflect::Modifier::NATIVE) == 0) + { + _Jv_InterpMethod *im + = (_Jv_InterpMethod *) ic->interpreted_methods[i]; + if (im) + { + p = (ptr_t) im->prepared; + MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, \ + cFlabel); + } + } + + // The interpreter installs a heap-allocated trampoline + // here, so we'll mark it. + p = (ptr_t) c->methods[i].ncode; + MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, + cm3label); } p = (ptr_t) ic->field_initializers; |