made a copy
[strongtalk-kjk.git] / vm / oops / dValueArrayKlass.hpp
blobfb529bd0607a2af0eb0d4a4e41d0917927973a35
1 /* Copyright 1996 LongView Technologies L.L.C. $Revision: 1.1 $ */
2 /* Copyright (c) 2006, Sun Microsystems, Inc.
3 All rights reserved.
5 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
6 following conditions are met:
8 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
10 disclaimer in the documentation and/or other materials provided with the distribution.
11 * Neither the name of Sun Microsystems nor the names of its contributors may be used to endorse or promote products derived
12 from this software without specific prior written permission.
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
15 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
16 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
18 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
19 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
24 class doubleValueArrayKlass: public memOopKlass {
25 public:
26 // allocation properties
27 bool can_inline_allocation() const { return false; }
29 // Return the oop size for a doubleValueArrayOop
30 int object_size(int number_of_doubleValues) const {
31 return non_indexable_size() + 1
32 + roundTo(number_of_doubleValues * sizeof(double), oopSize) / oopSize;
35 // creation operations
36 oop allocateObject();
37 oop allocateObjectSize(int size);
39 // creates invocation
40 klassOop create_subclass(mixinOop mixin, Format format);
42 static klassOop create_class(klassOop super_class, mixinOop mixin);
44 // Format
45 Format format() { return doubleValueArray_klass; }
47 friend void set_doubleValueArrayKlass_vtbl(Klass* k);
49 char* name() const { return "doubleValueArray"; }
51 // ALL FUNCTIONS BELOW THIS POINT ARE DISPATCHED FROM AN OOP
52 public:
53 // accessors
54 int oop_scavenge_contents(oop obj);
55 int oop_scavenge_tenured_contents(oop obj);
57 bool oop_verify(oop obj);
58 void oop_print_value_on(oop obj, outputStream* st);
60 // iterators
61 void oop_oop_iterate(oop obj, OopClosure* blk);
62 void oop_layout_iterate(oop obj, ObjectLayoutClosure* blk);
64 // Sizing
65 int oop_header_size() const { return doubleValueArrayOopDesc::header_size(); }
66 int oop_size(oop obj) const { return object_size(doubleValueArrayOop(obj)->length()); }
68 // testers
69 bool oop_is_doubleValueArray() const { return true; }
70 bool oop_is_indexable() const { return true; }