/* Sun-$Revision: 23.4 $ */ /* Copyright 1992-9 Sun Microsystems, Inc. and Stanford University. See the LICENSE file for license information. */ # pragma interface // New style closures (someday will elim the macros altogether!) // First, define the closure: struct OopClosure: StackObj { virtual void do_oop( oop* p ) = 0; OopClosure* a() { return this; } // needed to bypass a warning in gcc }; // LocationsDoer uses OOPS_DO, not DERIVED_OOPS_DO_TEMPLATE because it is comparing ADDRESSES of oops struct OopScavenger: OopClosure { void do_oop(oop* p) { DERIVED_SCAVENGE_TEMPLATE(p); } }; struct OopGCMarker: OopClosure { void do_oop(oop* p) { DERIVED_MARK_TEMPLATE(p); } }; struct OopGCUnmarker: OopClosure { void do_oop(oop* p) { DERIVED_UNMARK_TEMPLATE(p); } }; struct OopVerifier: OopClosure { void do_oop(oop* p) { DERIVED_VERIFY_TEMPLATE(p); } }; struct OopZapper: OopClosure { void do_oop(oop* p) { Unused(p); } }; struct OopSwitcher: OopClosure { oop from, to; OopSwitcher (oop f, oop t) { from = f; to = t; } void do_oop(oop* p) { DERIVED_SWITCH_POINTERS_TEMPLATE(p); } }; struct OopDoer: OopClosure { oopsDoFn fn; OopDoer (oopsDoFn fnarg) { fn = fnarg; } void do_oop(oop* p) { DERIVED_OOPS_DO_TEMPLATE(p, fn); } }; struct OopLocationsDoer: OopClosure { oopsDoFn fn; OopLocationsDoer(oopsDoFn fnarg) { fn = fnarg; } void do_oop(oop* p) { OOPS_DO_TEMPLATE(p, fn); } }; struct OopBlockAdjuster: OopClosure { frame *olds, *news; OopBlockAdjuster(frame* oarg, frame* narg) { olds = oarg; news = narg; } void do_oop(oop* p); };