00001 /* Copyright 1994, 1995 LongView Technologies L.L.C. $Revision: 1.28 $ */ 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 debugging 00025 00026 class debugPrimitives : AllStatic { 00027 private: 00028 static void inc_calls() { number_of_calls++; } 00029 public: 00030 static int number_of_calls; 00031 00032 //%prim 00033 // <NoReceiver> primitiveBooleanFlagAt: name <Symbol> 00034 // ifFail: failBlock <PrimFailBlock> ^<Boolean> = 00035 // Internal { 00036 // error = #(NotFound) 00037 // name = 'debugPrimitives::boolAt' } 00038 //% 00039 static PRIM_DECL_1(boolAt, oop name); 00040 00041 //%prim 00042 // <NoReceiver> primitiveBooleanFlagAt: name <Symbol> 00043 // put: value <Boolean> 00044 // ifFail: failBlock <PrimFailBlock> ^<Boolean> = 00045 // Internal { 00046 // error = #(NotFound) 00047 // name = 'debugPrimitives::boolAtPut' } 00048 //% 00049 static PRIM_DECL_2(boolAtPut, oop name, oop value); 00050 00051 //%prim 00052 // <NoReceiver> primitiveSmallIntegerFlagAt: name <Symbol> 00053 // ifFail: failBlock <PrimFailBlock> ^<SmallInteger> = 00054 // Internal { 00055 // error = #(NotFound) 00056 // name = 'debugPrimitives::smiAt' } 00057 //% 00058 static PRIM_DECL_1(smiAt, oop name); 00059 00060 //%prim 00061 // <NoReceiver> primitiveSmallIntegerFlagAt: name <Symbol> 00062 // put: value <Boolean> 00063 // ifFail: failBlock <PrimFailBlock> ^<Boolean> = 00064 // Internal { 00065 // error = #(NotFound) 00066 // name = 'debugPrimitives::smiAtPut' } 00067 //% 00068 static PRIM_DECL_2(smiAtPut, oop name, oop value); 00069 00070 //%prim 00071 // <NoReceiver> primitiveClearLookupCache ^<Object> = 00072 // Internal { name = 'debugPrimitives::clearLookupCache' } 00073 //% 00074 static PRIM_DECL_0(clearLookupCache); 00075 00076 //%prim 00077 // <NoReceiver> primitiveClearLookupCacheStatistics ^<Object> = 00078 // Internal { name = 'debugPrimitives::clearLookupCacheStatistics' } 00079 //% 00080 static PRIM_DECL_0(clearLookupCacheStatistics); 00081 00082 //%prim 00083 // <NoReceiver> primitivePrintLookupCacheStatistics ^<Object> = 00084 // Internal { name = 'debugPrimitives::printLookupCacheStatistics' } 00085 //% 00086 static PRIM_DECL_0(printLookupCacheStatistics); 00087 00088 //%prim 00089 // <NoReceiver> primitivePrintLayout ^<Object> = 00090 // Internal { name = 'debugPrimitives::printMemoryLayout' } 00091 //% 00092 static PRIM_DECL_0(printMemoryLayout); 00093 00094 //%prim 00095 // <NoReceiver> primitiveDecodeAllMethods ^<Object> = 00096 // Internal { name = 'debugPrimitives::decodeAllMethods' } 00097 //% 00098 static PRIM_DECL_0(decodeAllMethods); 00099 00100 //%prim 00101 // <Object> primitivePrintMethodCodes: selector <Symbol> 00102 // ifFail: failBlock <PrimFailBlock> ^<Object> = 00103 // Internal { error = #(NotFound) 00104 // name = 'debugPrimitives::printMethodCodes' } 00105 //% 00106 static PRIM_DECL_2(printMethodCodes, oop receiver, oop sel); 00107 00108 //%prim 00109 // <Object> primitiveGenerateIR: selector <Symbol> 00110 // ifFail: failBlock <PrimFailBlock> ^<Object> = 00111 // Internal { error = #(NotFound) 00112 // name = 'debugPrimitives::generateIR' } 00113 //% 00114 static PRIM_DECL_2(generateIR, oop receiver, oop sel); 00115 00116 //%prim 00117 // <Object> primitiveOptimizeMethod: selector <Symbol> 00118 // ifFail: failBlock <PrimFailBlock> ^<Object> = 00119 // Internal { error = #(NotFound) 00120 // name = 'debugPrimitives::optimizeMethod' } 00121 //% 00122 static PRIM_DECL_2(optimizeMethod, oop receiver, oop sel); 00123 00124 //%prim 00125 // <Object> primitiveDecodeMethod: selector <Symbol> 00126 // ifFail: failBlock <PrimFailBlock> ^<Object> = 00127 // Internal { error = #(NotFound) 00128 // name = 'debugPrimitives::decodeMethod' } 00129 //% 00130 static PRIM_DECL_2(decodeMethod, oop receiver, oop sel); 00131 00132 //%prim 00133 // <NoReceiver> primitiveTimerStart ^<Object> = 00134 // Internal { name = 'debugPrimitives::timerStart' } 00135 //% 00136 static PRIM_DECL_0(timerStart); 00137 00138 //%prim 00139 // <NoReceiver> primitiveTimerStop ^<Object> = 00140 // Internal { name = 'debugPrimitives::timerStop' } 00141 //% 00142 static PRIM_DECL_0(timerStop); 00143 00144 //%prim 00145 // <NoReceiver> primitiveTimerPrintBuffer ^<Object> = 00146 // Internal { name = 'debugPrimitives::timerPrintBuffer' } 00147 //% 00148 static PRIM_DECL_0(timerPrintBuffer); 00149 00150 //%prim 00151 // <NoReceiver> primitiveInterpreterInvocationCounterLimit ^<SmallInteger> = 00152 // Internal { name = 'debugPrimitives::interpreterInvocationCounterLimit' } 00153 //% 00154 static PRIM_DECL_0(interpreterInvocationCounterLimit); 00155 00156 //%prim 00157 // <NoReceiver> primitiveSetInterpreterInvocationCounterLimitTo: limit <SmallInteger> 00158 // ifFail: failBlock <PrimFailBlock> ^ <Object> = 00159 // Internal { name = 'debugPrimitives::setInterpreterInvocationCounterLimit' } 00160 //% 00161 static PRIM_DECL_1(setInterpreterInvocationCounterLimit, oop limit); 00162 00163 //%prim 00164 // <NoReceiver> primitiveClearInvocationCounters ^<Object> = 00165 // Internal { name = 'debugPrimitives::clearInvocationCounters' } 00166 //% 00167 static PRIM_DECL_0(clearInvocationCounters); 00168 00169 //%prim 00170 // <NoReceiver> primitivePrintInvocationCounterHistogram: size <SmallInteger> 00171 // ifFail: failBlock <PrimFailBlock> ^<Object> = 00172 // Internal { name = 'debugPrimitives::printInvocationCounterHistogram' } 00173 //% 00174 static PRIM_DECL_1(printInvocationCounterHistogram, oop size); 00175 00176 //%prim 00177 // <NoReceiver> primitivePrintObjectHistogram ^<Object> = 00178 // Internal { name = 'debugPrimitives::printObjectHistogram' } 00179 //% 00180 static PRIM_DECL_0(printObjectHistogram); 00181 00182 //%prim 00183 // <NoReceiver> primitiveClearInlineCaches ^<Object> = 00184 // Internal {name = 'debugPrimitives::clearInlineCaches' } 00185 //% 00186 static PRIM_DECL_0(clearInlineCaches); 00187 00188 //%prim 00189 // <NoReceiver> primitiveClearNMethodCounters ^<Object> = 00190 // Internal { name = 'debugPrimitives::clearNMethodCounters' } 00191 //% 00192 static PRIM_DECL_0(clearNMethodCounters); 00193 00194 //%prim 00195 // <NoReceiver> primitivePrintNMethodCounterHistogram: size <SmallInteger> 00196 // ifFail: failBlock <PrimFailBlock> ^<Object> = 00197 // Internal { name = 'debugPrimitives::printNMethodCounterHistogram' } 00198 //% 00199 static PRIM_DECL_1(printNMethodCounterHistogram, oop size); 00200 00201 //%prim 00202 // <NoReceiver> primitiveNumberOfMethodInvocations ^<SmallInteger> = 00203 // Internal { name = 'debugPrimitives::numberOfMethodInvocations' } 00204 //% 00205 static PRIM_DECL_0(numberOfMethodInvocations); 00206 00207 //%prim 00208 // <NoReceiver> primitiveNumberOfNMethodInvocations ^<SmallInteger> = 00209 // Internal { name = 'debugPrimitives::numberOfNMethodInvocations' } 00210 //% 00211 static PRIM_DECL_0(numberOfNMethodInvocations); 00212 00213 // Accessors to LookupCache statistics 00214 00215 //%prim 00216 // <NoReceiver> primitiveNumberOfPrimaryLookupCacheHits ^<SmallInteger> = 00217 // Internal { name = 'debugPrimitives::numberOfPrimaryLookupCacheHits' } 00218 //% 00219 static PRIM_DECL_0(numberOfPrimaryLookupCacheHits); 00220 00221 //%prim 00222 // <NoReceiver> primitiveNumberOfSecondaryLookupCacheHits ^<SmallInteger> = 00223 // Internal { name = 'debugPrimitives::numberOfSecondaryLookupCacheHits' } 00224 //% 00225 static PRIM_DECL_0(numberOfSecondaryLookupCacheHits); 00226 00227 //%prim 00228 // <NoReceiver> primitiveNumberOfLookupCacheMisses ^<SmallInteger> = 00229 // Internal { name = 'debugPrimitives::numberOfLookupCacheMisses' } 00230 //% 00231 static PRIM_DECL_0(numberOfLookupCacheMisses); 00232 00233 //%prim 00234 // <NoReceiver> primitiveClearPrimitiveCounters ^<Object> = 00235 // Internal { name = 'debugPrimitives::clearPrimitiveCounters' } 00236 //% 00237 static PRIM_DECL_0(clearPrimitiveCounters); 00238 00239 //%prim 00240 // <NoReceiver> primitivePrintPrimitiveCounters ^<Object> = 00241 // Internal { name = 'debugPrimitives::printPrimitiveCounters' } 00242 //% 00243 static PRIM_DECL_0(printPrimitiveCounters); 00244 00245 //%prim 00246 // <NoReceiver> primitiveDeoptimizeStacks ^<Object> = 00247 // Internal { doc = 'Deoptimizes all stack to the canonical form' 00248 // flags = #(NLR) 00249 // name = 'debugPrimitives::deoptimizeStacks' } 00250 //% 00251 static PRIM_DECL_0(deoptimizeStacks); 00252 00253 //%prim 00254 // <NoReceiver> primitiveVerify ^<Object> = 00255 // Internal { doc = 'Verify the system' 00256 // name = 'debugPrimitives::verify' } 00257 //% 00258 static PRIM_DECL_0(verify); 00259 };