vframeKlass.cpp

Go to the documentation of this file.
00001 /* Copyright 1994, 1995 LongView Technologies L.L.C. $Revision: 1.8 $ */
00002 /* Copyright (c) 2006, Sun Microsystems, Inc.
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 
00006 following conditions are met:
00007 
00008     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
00009     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 
00010           disclaimer in the documentation and/or other materials provided with the distribution.
00011     * Neither the name of Sun Microsystems nor the names of its contributors may be used to endorse or promote products derived 
00012           from this software without specific prior written permission.
00013 
00014 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 
00015 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 
00016 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
00017 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
00018 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
00019 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
00020 
00021 
00022 */
00023 
00024 
00025 # include "incls/_precompiled.incl"
00026 # include "incls/_vframeKlass.cpp.incl"
00027 
00028 void set_vframeKlass_vtbl(Klass* k) {
00029   vframeKlass o;
00030   k->set_vtbl_value(o.vtbl_value());
00031 }
00032 
00033 oop vframeKlass::allocateObject() {
00034   klassOop k    = as_klassOop();
00035   int      size = non_indexable_size();
00036   // allocate
00037   vframeOop obj = as_vframeOop(Universe::allocate(size, (memOop*)&k));
00038   // header
00039   memOop(obj)->initialize_header(true, k);
00040  
00041   obj->set_process(processOop(nilObj));
00042   obj->set_index(0);
00043   obj->set_time_stamp(1);
00044 
00045   // instance variables
00046   memOop(obj)->initialize_body(vframeOopDesc::header_size(), size);
00047   return obj;
00048 }
00049 
00050 klassOop vframeKlass::create_subclass(mixinOop mixin, Format format) {
00051   if (format == mem_klass || format == vframe_klass) {
00052     return vframeKlass::create_class(as_klassOop(), mixin);
00053   }
00054   return NULL;
00055 }
00056 
00057 klassOop vframeKlass::create_class(klassOop super_class, mixinOop mixin) {
00058   vframeKlass o;
00059   return create_generic_class(super_class, mixin, o.vtbl_value());
00060 }
00061 
00062 int vframeKlass::oop_scavenge_contents(oop obj) {
00063   int size = non_indexable_size();
00064   // header + instance variables
00065   memOop(obj)->scavenge_header();
00066   memOop(obj)->scavenge_body(memOopDesc::header_size(), size);
00067   return size;  
00068 }
00069 
00070 int vframeKlass::oop_scavenge_tenured_contents(oop obj) {
00071   int size = non_indexable_size();
00072   // header + instance variables
00073   memOop(obj)->scavenge_tenured_header();
00074   memOop(obj)->scavenge_tenured_body(memOopDesc::header_size(), size);
00075   return size;
00076 }
00077 
00078 void vframeKlass::oop_follow_contents(oop obj) {
00079   // header + instance variables
00080   memOop(obj)->follow_header();
00081   memOop(obj)->follow_body(memOopDesc::header_size(), non_indexable_size());
00082 }
00083 
00084 void vframeKlass::oop_layout_iterate(oop obj, ObjectLayoutClosure* blk) {
00085   // header
00086   memOop(obj)->layout_iterate_header(blk);
00087   vframeOop vf = vframeOop(obj);
00088   blk->do_oop("process",    (oop*) &vf->addr()->_process);
00089   blk->do_oop("index",      (oop*) &vf->addr()->_index);
00090   blk->do_oop("time stamp", (oop*) &vf->addr()->_time_stamp);
00091   memOop(obj)->layout_iterate_body(blk, vframeOopDesc::header_size(), non_indexable_size());
00092 }
00093 
00094 void vframeKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
00095   // header
00096   memOop(obj)->oop_iterate_header(blk);
00097   vframeOop vf = vframeOop(obj);
00098   blk->do_oop((oop*) &vf->addr()->_process);
00099   blk->do_oop((oop*) &vf->addr()->_index);
00100   blk->do_oop((oop*) &vf->addr()->_time_stamp);
00101   // instance variables
00102   memOop(obj)->oop_iterate_body(blk, vframeOopDesc::header_size(), non_indexable_size());
00103 }

Generated on Mon Oct 9 13:37:30 2006 for Strongtalk VM by  doxygen 1.4.7