processKlass.cpp

Go to the documentation of this file.
00001 /* Copyright 1994, 1995 LongView Technologies L.L.C. $Revision: 1.14 $ */
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 # include "incls/_precompiled.incl"
00025 # include "incls/_processKlass.cpp.incl"
00026 
00027 void set_processKlass_vtbl(Klass* k) {
00028   processKlass o;
00029   k->set_vtbl_value(o.vtbl_value());
00030 }
00031 
00032 oop processKlass::allocateProcess(int stack_size) {
00033   return allocateObject();
00034 }
00035 
00036 oop processKlass::allocateObject() {
00037   klassOop k    = as_klassOop();
00038   int      size = non_indexable_size();
00039   // allocate
00040   processOop obj = as_processOop(Universe::allocate(size, (memOop*)&k));
00041   // header
00042   memOop(obj)->initialize_header(true, k);
00043   obj->set_process(NULL);
00044   // instance variables
00045   memOop(obj)->initialize_body(processOopDesc::header_size(), size);
00046   return obj;
00047 }
00048 
00049 klassOop processKlass::create_subclass(mixinOop mixin, Format format) {
00050   if (format == mem_klass || format == process_klass) {
00051     return processKlass::create_class(as_klassOop(), mixin);
00052   }
00053   return NULL;
00054 }
00055 
00056 klassOop processKlass::create_class(klassOop super_class, mixinOop mixin) {
00057   processKlass o;
00058   return create_generic_class(super_class, mixin, o.vtbl_value());
00059 }
00060 
00061 int processKlass::oop_scavenge_contents(oop obj) {
00062   int size = non_indexable_size();
00063   // header
00064   memOop(obj)->scavenge_header();
00065   // instance variables
00066   memOop(obj)->scavenge_body(processOopDesc::header_size(), size);
00067   return size;  
00068 }
00069 
00070 int processKlass::oop_scavenge_tenured_contents(oop obj) {
00071   int size = non_indexable_size();
00072   // header
00073   memOop(obj)->scavenge_tenured_header();
00074   // instance variables
00075   memOop(obj)->scavenge_tenured_body(processOopDesc::header_size(), size);
00076   return size;
00077 }
00078 
00079 void processKlass::oop_follow_contents(oop obj) {
00080   // header
00081   memOop(obj)->follow_header();
00082   // instance variables
00083   memOop(obj)->follow_body(processOopDesc::header_size(), non_indexable_size());
00084 }
00085 
00086 void processKlass::oop_layout_iterate(oop obj, ObjectLayoutClosure* blk) {
00087   // header
00088   memOop(obj)->layout_iterate_header(blk);
00089   blk->do_long("process", (void**) &processOop(obj)->addr()->_process);
00090   // instance variables
00091   memOop(obj)->layout_iterate_body(blk, processOopDesc::header_size(), non_indexable_size());
00092 }
00093 
00094 void processKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
00095   // header
00096   memOop(obj)->oop_iterate_header(blk);
00097   // instance variables
00098   memOop(obj)->oop_iterate_body(blk, processOopDesc::header_size(), non_indexable_size());
00099 }

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