dValueArrayKlass.cpp

Go to the documentation of this file.
00001 /* Copyright 1996 LongView Technologies L.L.C. $Revision: 1.1 $ */
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/_dValueArrayKlass.cpp.incl"
00026 # include <ctype.h>
00027 
00028 oop doubleValueArrayKlass::allocateObject() {
00029   fatal("should never call allocateObject in doubleValueArrayKlass");
00030   return badOop;
00031 }
00032 
00033 oop doubleValueArrayKlass::allocateObjectSize(int size) {
00034   klassOop k        = as_klassOop();
00035   int      ni_size  = non_indexable_size();
00036   int      obj_size = ni_size + 1 + roundTo(size * sizeof(double), oopSize) / oopSize;
00037   // allocate
00038   doubleValueArrayOop obj = as_doubleValueArrayOop(Universe::allocate(obj_size, (memOop*)&k));
00039   // header
00040   memOop(obj)->initialize_header(true, k);
00041   // instance variables
00042   memOop(obj)->initialize_body(memOopDesc::header_size(), ni_size);
00043   // indexables
00044   obj->set_length(size);
00045   for (int index = 1; index <= size; index++) {
00046     obj->double_at_put(index, 0.0);
00047   }
00048   return obj;
00049 }
00050 
00051 klassOop doubleValueArrayKlass::create_subclass(mixinOop mixin, Format format) {
00052   if (format == mem_klass || format == doubleValueArray_klass) {
00053     return doubleValueArrayKlass::create_class(as_klassOop(), mixin);
00054   }
00055   return NULL;
00056 }
00057 
00058 klassOop doubleValueArrayKlass::create_class(klassOop super_class, mixinOop mixin) {
00059   doubleValueArrayKlass o;
00060   return create_generic_class(super_class, mixin, o.vtbl_value());
00061 }
00062 
00063 void set_doubleValueArrayKlass_vtbl(Klass* k) {
00064   doubleValueArrayKlass o;
00065   k->set_vtbl_value(o.vtbl_value());
00066 }
00067 
00068 bool doubleValueArrayKlass::oop_verify(oop obj) {
00069   assert_doubleValueArray(obj,"Argument must be doubleValueArray");
00070   return doubleValueArrayOop(obj)->verify();
00071 }
00072 
00073 void doubleValueArrayKlass::oop_print_value_on(oop obj, outputStream* st) {
00074   assert_doubleValueArray(obj,"Argument must be doubleValueArray");
00075   doubleValueArrayOop array = doubleValueArrayOop(obj);
00076   int len = array->length();
00077   int n   = min(MaxElementPrintSize, len);
00078   Unimplemented();
00079 }
00080 
00081 void doubleValueArrayKlass::oop_layout_iterate(oop obj, ObjectLayoutClosure* blk) {
00082   double* p       = doubleValueArrayOop(obj)->double_start();
00083   oop*        l   = doubleValueArrayOop(obj)->length_addr();
00084   int         len = doubleValueArrayOop(obj)->length();
00085   memOopKlass::oop_layout_iterate(obj, blk);
00086   blk->do_oop("length", l);
00087   blk->begin_indexables();
00088   Unimplemented();
00089   blk->end_indexables();
00090 }
00091 
00092 void doubleValueArrayKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
00093   oop* l = doubleValueArrayOop(obj)->length_addr();
00094   memOopKlass::oop_oop_iterate(obj, blk);
00095   blk->do_oop(l);
00096 }
00097 
00098 int doubleValueArrayKlass::oop_scavenge_contents(oop obj) {
00099   memOopKlass::oop_scavenge_contents(obj);
00100   return object_size(doubleValueArrayOop(obj)->length());  
00101 }
00102 
00103 int doubleValueArrayKlass::oop_scavenge_tenured_contents(oop obj) {
00104   memOopKlass::oop_scavenge_tenured_contents(obj);
00105   return object_size(doubleValueArrayOop(obj)->length());  
00106 }
00107 

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