00001 /* Copyright 1994, 1995 LongView Technologies L.L.C. $Revision: 1.15 $ */ 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 // Primitives for obj arrays 00025 00026 class objArrayPrimitives : AllStatic { 00027 private: 00028 static void inc_calls() { number_of_calls++; } 00029 public: 00030 static int number_of_calls; 00031 00032 //%prim 00033 // <IndexedInstanceVariables class> 00034 // primitiveIndexedObjectNew: size <SmallInteger> 00035 // ifFail: failBlock <PrimFailBlock> ^<Object> = 00036 // Internal { error = #(NegativeSize) 00037 // flags = #(Allocate) 00038 // name = 'objArrayPrimitives::allocateSize' } 00039 //% 00040 static PRIM_DECL_2(allocateSize, oop receiver, oop argument); 00041 00042 //%prim 00043 // <IndexedInstanceVariables> 00044 // primitiveIndexedObjectSize = 00045 // Internal { flags = #(Pure IndexedObject) 00046 // name = 'objArrayPrimitives::size' } 00047 //% 00048 static PRIM_DECL_1(size, oop receiver); 00049 00050 //%prim 00051 // <IndexedInstanceVariables> 00052 // primitiveIndexedObjectAt: index <SmallInteger> 00053 // ifFail: failBlock <PrimFailBlock> ^<SmallInteger> = 00054 // Internal { error = #(OutOfBounds) 00055 // flags = #(Function IndexedObject) 00056 // name = 'objArrayPrimitives::at' } 00057 //% 00058 static PRIM_DECL_2(at, oop receiver, oop index); 00059 00060 //%prim 00061 // <IndexedInstanceVariables> 00062 // primitiveIndexedObjectAt: index <SmallInteger> 00063 // put: c <Object> 00064 // ifFail: failBlock <PrimFailBlock> ^<Object> = 00065 // Internal { error = #(OutOfBounds) 00066 // flags = #(Function IndexedObject) 00067 // name = 'objArrayPrimitives::atPut' } 00068 //% 00069 static PRIM_DECL_3(atPut, oop receiver, oop index, oop value); 00070 00071 //%prim 00072 // <IndexedInstanceVariables> 00073 // primitiveIndexedObjectAtAllPut: obj <Object> ^<Self> = 00074 // Internal { flags = #(Function IndexedObject) 00075 // name = 'objArrayPrimitives::at_all_put' } 00076 //% 00077 static PRIM_DECL_2(at_all_put, oop receiver, oop obj); 00078 00079 //%prim 00080 // <IndexedInstanceVariables> 00081 // primitiveIndexedObjectReplaceFrom: from <SmallInteger> 00082 // to: to <SmallInteger> 00083 // with: source <IndexedInstanceVariables> 00084 // startingAt: start <SmallInteger> 00085 // ifFail: failBlock <PrimFailBlock> ^<Self> = 00086 // Internal { error = #(OutOfBounds) 00087 // flags = #(IndexedObject) 00088 // name = 'objArrayPrimitives::replace_from_to' } 00089 //% 00090 static PRIM_DECL_5(replace_from_to, oop receiver, oop from, oop to, oop source, oop start); 00091 00092 //%prim 00093 // <IndexedInstanceVariables> 00094 // primitiveIndexedObjectCopyFrom: from <SmallInteger> 00095 // startingAt: start <SmallInteger> 00096 // size: size <SmallInteger> 00097 // ifFail: failBlock <PrimFailBlock> ^<Self> = 00098 // Internal { error = #(OutOfBounds NegativeSize) 00099 // flags = #(IndexedObject) 00100 // name = 'objArrayPrimitives::copy_size' } 00101 //% 00102 static PRIM_DECL_4(copy_size, oop receiver, oop from, oop start, oop size); 00103 00104 }; 00105