| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "Dalvik.h" |
| 18 | #include "CompilerInternals.h" |
| 19 | |
| 20 | static ArenaMemBlock *arenaHead, *currentArena; |
| 21 | static int numArenaBlocks; |
| 22 | |
| 23 | /* Allocate the initial memory block for arena-based allocation */ |
| 24 | bool dvmCompilerHeapInit(void) |
| 25 | { |
| 26 | assert(arenaHead == NULL); |
| 27 | arenaHead = |
| 28 | (ArenaMemBlock *) malloc(sizeof(ArenaMemBlock) + ARENA_DEFAULT_SIZE); |
| 29 | if (arenaHead == NULL) { |
| 30 | LOGE("No memory left to create compiler heap memory\n"); |
| 31 | return false; |
| 32 | } |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 33 | arenaHead->blockSize = ARENA_DEFAULT_SIZE; |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 34 | currentArena = arenaHead; |
| 35 | currentArena->bytesAllocated = 0; |
| 36 | currentArena->next = NULL; |
| 37 | numArenaBlocks = 1; |
| 38 | |
| 39 | return true; |
| 40 | } |
| 41 | |
| 42 | /* Arena-based malloc for compilation tasks */ |
| 43 | void * dvmCompilerNew(size_t size, bool zero) |
| 44 | { |
| 45 | size = (size + 3) & ~3; |
| 46 | retry: |
| 47 | /* Normal case - space is available in the current page */ |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 48 | if (size + currentArena->bytesAllocated <= currentArena->blockSize) { |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 49 | void *ptr; |
| 50 | ptr = ¤tArena->ptr[currentArena->bytesAllocated]; |
| 51 | currentArena->bytesAllocated += size; |
| 52 | if (zero) { |
| 53 | memset(ptr, 0, size); |
| 54 | } |
| 55 | return ptr; |
| 56 | } else { |
| 57 | /* |
| 58 | * See if there are previously allocated arena blocks before the last |
| 59 | * reset |
| 60 | */ |
| 61 | if (currentArena->next) { |
| 62 | currentArena = currentArena->next; |
| 63 | goto retry; |
| 64 | } |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 65 | |
| 66 | size_t blockSize = (size < ARENA_DEFAULT_SIZE) ? |
| 67 | ARENA_DEFAULT_SIZE : size; |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 68 | /* Time to allocate a new arena */ |
| 69 | ArenaMemBlock *newArena = (ArenaMemBlock *) |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 70 | malloc(sizeof(ArenaMemBlock) + blockSize); |
| 71 | if (newArena == NULL) { |
| 72 | LOGE("Arena allocation failure"); |
| 73 | dvmAbort(); |
| 74 | } |
| 75 | newArena->blockSize = blockSize; |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 76 | newArena->bytesAllocated = 0; |
| 77 | newArena->next = NULL; |
| 78 | currentArena->next = newArena; |
| 79 | currentArena = newArena; |
| 80 | numArenaBlocks++; |
| Ben Cheng | 60c24f4 | 2010-01-04 12:29:56 -0800 | [diff] [blame] | 81 | if (numArenaBlocks > 10) |
| Ben Cheng | a497359 | 2010-03-31 11:59:18 -0700 | [diff] [blame] | 82 | LOGI("Total arena pages for JIT: %d", numArenaBlocks); |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 83 | goto retry; |
| 84 | } |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame^] | 85 | /* Should not reach here */ |
| 86 | dvmAbort(); |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | /* Reclaim all the arena blocks allocated so far */ |
| 90 | void dvmCompilerArenaReset(void) |
| 91 | { |
| 92 | ArenaMemBlock *block; |
| 93 | |
| 94 | for (block = arenaHead; block; block = block->next) { |
| 95 | block->bytesAllocated = 0; |
| 96 | } |
| 97 | currentArena = arenaHead; |
| 98 | } |
| 99 | |
| 100 | /* Growable List initialization */ |
| 101 | void dvmInitGrowableList(GrowableList *gList, size_t initLength) |
| 102 | { |
| 103 | gList->numAllocated = initLength; |
| 104 | gList->numUsed = 0; |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame^] | 105 | gList->elemList = (intptr_t *) dvmCompilerNew(sizeof(intptr_t) * initLength, |
| 106 | true); |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | /* Expand the capacity of a growable list */ |
| 110 | static void expandGrowableList(GrowableList *gList) |
| 111 | { |
| 112 | int newLength = gList->numAllocated; |
| 113 | if (newLength < 128) { |
| 114 | newLength <<= 1; |
| 115 | } else { |
| 116 | newLength += 128; |
| 117 | } |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame^] | 118 | intptr_t *newArray = |
| 119 | (intptr_t *) dvmCompilerNew(sizeof(intptr_t) * newLength, true); |
| 120 | memcpy(newArray, gList->elemList, sizeof(intptr_t) * gList->numAllocated); |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 121 | gList->numAllocated = newLength; |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame^] | 122 | gList->elemList = newArray; |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | /* Insert a new element into the growable list */ |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame^] | 126 | void dvmInsertGrowableList(GrowableList *gList, intptr_t elem) |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 127 | { |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 128 | assert(gList->numAllocated != 0); |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 129 | if (gList->numUsed == gList->numAllocated) { |
| 130 | expandGrowableList(gList); |
| 131 | } |
| 132 | gList->elemList[gList->numUsed++] = elem; |
| 133 | } |
| 134 | |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame^] | 135 | void dvmGrowableListIteratorInit(GrowableList *gList, |
| 136 | GrowableListIterator *iterator) |
| 137 | { |
| 138 | iterator->list = gList; |
| 139 | iterator->idx = 0; |
| 140 | iterator->size = gList->numUsed; |
| 141 | } |
| 142 | |
| 143 | intptr_t dvmGrowableListIteratorNext(GrowableListIterator *iterator) |
| 144 | { |
| 145 | assert(iterator->size == iterator->list->numUsed); |
| 146 | if (iterator->idx == iterator->size) return 0; |
| 147 | return iterator->list->elemList[iterator->idx++]; |
| 148 | } |
| 149 | |
| 150 | intptr_t dvmGrowableListGetElement(const GrowableList *gList, size_t idx) |
| 151 | { |
| 152 | assert(idx < gList->numUsed); |
| 153 | return gList->elemList[idx]; |
| 154 | } |
| 155 | |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 156 | /* Debug Utility - dump a compilation unit */ |
| 157 | void dvmCompilerDumpCompilationUnit(CompilationUnit *cUnit) |
| 158 | { |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 159 | BasicBlock *bb; |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 160 | char *blockTypeNames[] = { |
| 161 | "Normal Chaining Cell", |
| 162 | "Hot Chaining Cell", |
| 163 | "Singleton Chaining Cell", |
| 164 | "Predicted Chaining Cell", |
| 165 | "Backward Branch", |
| 166 | "Chaining Cell Gap", |
| 167 | "N/A", |
| 168 | "Method Entry Block", |
| 169 | "Trace Entry Block", |
| 170 | "Code Block", |
| 171 | "Trace Exit Block", |
| 172 | "Method Exit Block", |
| 173 | "PC Reconstruction", |
| 174 | "Exception Handling", |
| 175 | }; |
| 176 | |
| 177 | LOGD("Compiling %s %s", cUnit->method->clazz->descriptor, |
| 178 | cUnit->method->name); |
| 179 | LOGD("%d insns", dvmGetMethodInsnsSize(cUnit->method)); |
| 180 | LOGD("%d blocks in total", cUnit->numBlocks); |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame^] | 181 | GrowableListIterator iterator; |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 182 | |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame^] | 183 | dvmGrowableListIteratorInit(&cUnit->blockList, &iterator); |
| 184 | |
| 185 | while (true) { |
| 186 | bb = (BasicBlock *) dvmGrowableListIteratorNext(&iterator); |
| 187 | if (bb == NULL) break; |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 188 | LOGD("Block %d (%s) (insn %04x - %04x%s)\n", |
| 189 | bb->id, |
| 190 | blockTypeNames[bb->blockType], |
| 191 | bb->startOffset, |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 192 | bb->lastMIRInsn ? bb->lastMIRInsn->offset : bb->startOffset, |
| 193 | bb->lastMIRInsn ? "" : " empty"); |
| 194 | if (bb->taken) { |
| 195 | LOGD(" Taken branch: block %d (%04x)\n", |
| 196 | bb->taken->id, bb->taken->startOffset); |
| 197 | } |
| 198 | if (bb->fallThrough) { |
| 199 | LOGD(" Fallthrough : block %d (%04x)\n", |
| 200 | bb->fallThrough->id, bb->fallThrough->startOffset); |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | /* |
| Ben Cheng | 8b258bf | 2009-06-24 17:27:07 -0700 | [diff] [blame] | 206 | * dvmHashForeach callback. |
| 207 | */ |
| 208 | static int dumpMethodStats(void *compilerMethodStats, void *totalMethodStats) |
| 209 | { |
| 210 | CompilerMethodStats *methodStats = |
| 211 | (CompilerMethodStats *) compilerMethodStats; |
| 212 | CompilerMethodStats *totalStats = |
| 213 | (CompilerMethodStats *) totalMethodStats; |
| Ben Cheng | 8b258bf | 2009-06-24 17:27:07 -0700 | [diff] [blame] | 214 | |
| 215 | totalStats->dalvikSize += methodStats->dalvikSize; |
| 216 | totalStats->compiledDalvikSize += methodStats->compiledDalvikSize; |
| 217 | totalStats->nativeSize += methodStats->nativeSize; |
| 218 | |
| Ben Cheng | e80cd94 | 2009-07-17 15:54:23 -0700 | [diff] [blame] | 219 | /* Enable the following when fine-tuning the JIT performance */ |
| 220 | #if 0 |
| Ben Cheng | 8b258bf | 2009-06-24 17:27:07 -0700 | [diff] [blame] | 221 | int limit = (methodStats->dalvikSize >> 2) * 3; |
| 222 | |
| 223 | /* If over 3/4 of the Dalvik code is compiled, print something */ |
| 224 | if (methodStats->compiledDalvikSize >= limit) { |
| 225 | LOGD("Method stats: %s%s, %d/%d (compiled/total Dalvik), %d (native)", |
| Carl Shapiro | e3c01da | 2010-05-20 22:54:18 -0700 | [diff] [blame] | 226 | methodStats->method->clazz->descriptor, |
| 227 | methodStats->method->name, |
| Ben Cheng | 8b258bf | 2009-06-24 17:27:07 -0700 | [diff] [blame] | 228 | methodStats->compiledDalvikSize, |
| 229 | methodStats->dalvikSize, |
| 230 | methodStats->nativeSize); |
| 231 | } |
| Ben Cheng | e80cd94 | 2009-07-17 15:54:23 -0700 | [diff] [blame] | 232 | #endif |
| Ben Cheng | 8b258bf | 2009-06-24 17:27:07 -0700 | [diff] [blame] | 233 | return 0; |
| 234 | } |
| 235 | |
| 236 | /* |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 237 | * Dump the current stats of the compiler, including number of bytes used in |
| 238 | * the code cache, arena size, and work queue length, and various JIT stats. |
| 239 | */ |
| 240 | void dvmCompilerDumpStats(void) |
| 241 | { |
| Ben Cheng | 8b258bf | 2009-06-24 17:27:07 -0700 | [diff] [blame] | 242 | CompilerMethodStats totalMethodStats; |
| 243 | |
| 244 | memset(&totalMethodStats, 0, sizeof(CompilerMethodStats)); |
| 245 | LOGD("%d compilations using %d + %d bytes", |
| 246 | gDvmJit.numCompilations, |
| 247 | gDvmJit.templateSize, |
| 248 | gDvmJit.codeCacheByteUsed - gDvmJit.templateSize); |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 249 | LOGD("Compiler arena uses %d blocks (%d bytes each)", |
| 250 | numArenaBlocks, ARENA_DEFAULT_SIZE); |
| 251 | LOGD("Compiler work queue length is %d/%d", gDvmJit.compilerQueueLength, |
| 252 | gDvmJit.compilerMaxQueued); |
| 253 | dvmJitStats(); |
| 254 | dvmCompilerArchDump(); |
| Ben Cheng | dcf3e5d | 2009-09-11 13:42:05 -0700 | [diff] [blame] | 255 | if (gDvmJit.methodStatsTable) { |
| 256 | dvmHashForeach(gDvmJit.methodStatsTable, dumpMethodStats, |
| 257 | &totalMethodStats); |
| Ben Cheng | 978738d | 2010-05-13 13:45:57 -0700 | [diff] [blame] | 258 | LOGD("Code size stats: %d/%d (compiled/total Dalvik), %d (native)", |
| 259 | totalMethodStats.compiledDalvikSize, |
| 260 | totalMethodStats.dalvikSize, |
| 261 | totalMethodStats.nativeSize); |
| Ben Cheng | dcf3e5d | 2009-09-11 13:42:05 -0700 | [diff] [blame] | 262 | } |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 263 | } |
| Ben Cheng | 4238ec2 | 2009-08-24 16:32:22 -0700 | [diff] [blame] | 264 | |
| 265 | /* |
| 266 | * Allocate a bit vector with enough space to hold at least the specified |
| 267 | * number of bits. |
| 268 | * |
| 269 | * NOTE: this is the sister implementation of dvmAllocBitVector. In this version |
| 270 | * memory is allocated from the compiler arena. |
| 271 | */ |
| 272 | BitVector* dvmCompilerAllocBitVector(int startBits, bool expandable) |
| 273 | { |
| 274 | BitVector* bv; |
| 275 | int count; |
| 276 | |
| 277 | assert(sizeof(bv->storage[0]) == 4); /* assuming 32-bit units */ |
| 278 | assert(startBits >= 0); |
| 279 | |
| 280 | bv = (BitVector*) dvmCompilerNew(sizeof(BitVector), false); |
| 281 | |
| 282 | count = (startBits + 31) >> 5; |
| 283 | |
| 284 | bv->storageSize = count; |
| 285 | bv->expandable = expandable; |
| 286 | bv->storage = (u4*) dvmCompilerNew(count * sizeof(u4), true); |
| 287 | return bv; |
| 288 | } |
| 289 | |
| 290 | /* |
| 291 | * Mark the specified bit as "set". |
| 292 | * |
| 293 | * Returns "false" if the bit is outside the range of the vector and we're |
| 294 | * not allowed to expand. |
| 295 | * |
| 296 | * NOTE: this is the sister implementation of dvmSetBit. In this version |
| 297 | * memory is allocated from the compiler arena. |
| 298 | */ |
| 299 | bool dvmCompilerSetBit(BitVector *pBits, int num) |
| 300 | { |
| 301 | assert(num >= 0); |
| 302 | if (num >= pBits->storageSize * (int)sizeof(u4) * 8) { |
| 303 | if (!pBits->expandable) |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame^] | 304 | dvmAbort(); |
| Ben Cheng | 4238ec2 | 2009-08-24 16:32:22 -0700 | [diff] [blame] | 305 | |
| Ben Cheng | abf3ef8 | 2010-11-23 11:55:16 -0800 | [diff] [blame] | 306 | /* Round up to word boundaries for "num+1" bits */ |
| 307 | int newSize = (num + 1 + 31) >> 5; |
| Ben Cheng | 4238ec2 | 2009-08-24 16:32:22 -0700 | [diff] [blame] | 308 | assert(newSize > pBits->storageSize); |
| Carl Shapiro | fc75f3e | 2010-12-07 11:43:38 -0800 | [diff] [blame] | 309 | u4 *newStorage = (u4*)dvmCompilerNew(newSize * sizeof(u4), false); |
| Ben Cheng | 4238ec2 | 2009-08-24 16:32:22 -0700 | [diff] [blame] | 310 | memcpy(newStorage, pBits->storage, pBits->storageSize * sizeof(u4)); |
| 311 | memset(&newStorage[pBits->storageSize], 0, |
| 312 | (newSize - pBits->storageSize) * sizeof(u4)); |
| 313 | pBits->storage = newStorage; |
| 314 | pBits->storageSize = newSize; |
| 315 | } |
| 316 | |
| 317 | pBits->storage[num >> 5] |= 1 << (num & 0x1f); |
| 318 | return true; |
| 319 | } |
| 320 | |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame^] | 321 | /* |
| 322 | * Mark the specified bit as "unset". |
| 323 | * |
| 324 | * Returns "false" if the bit is outside the range of the vector and we're |
| 325 | * not allowed to expand. |
| 326 | * |
| 327 | * NOTE: this is the sister implementation of dvmClearBit. In this version |
| 328 | * memory is allocated from the compiler arena. |
| 329 | */ |
| 330 | bool dvmCompilerClearBit(BitVector *pBits, int num) |
| 331 | { |
| 332 | assert(num >= 0); |
| 333 | if (num >= pBits->storageSize * (int)sizeof(u4) * 8) { |
| 334 | LOGE("Trying to clear a bit that is not set in the vector yet!"); |
| 335 | dvmAbort(); |
| 336 | } |
| 337 | |
| 338 | pBits->storage[num >> 5] &= ~(1 << (num & 0x1f)); |
| 339 | return true; |
| 340 | } |
| 341 | |
| 342 | /* |
| 343 | * If set is true, mark all bits as 1. Otherwise mark all bits as 0. |
| 344 | */ |
| 345 | void dvmCompilerMarkAllBits(BitVector *pBits, bool set) |
| 346 | { |
| 347 | int value = set ? -1 : 0; |
| 348 | memset(pBits->storage, value, pBits->storageSize * (int)sizeof(u4)); |
| 349 | } |
| 350 | |
| Ben Cheng | 4238ec2 | 2009-08-24 16:32:22 -0700 | [diff] [blame] | 351 | void dvmDebugBitVector(char *msg, const BitVector *bv, int length) |
| 352 | { |
| 353 | int i; |
| 354 | |
| 355 | LOGE("%s", msg); |
| 356 | for (i = 0; i < length; i++) { |
| 357 | if (dvmIsBitSet(bv, i)) { |
| 358 | LOGE("Bit %d is set", i); |
| 359 | } |
| 360 | } |
| 361 | } |
| Bill Buzbee | fc519dc | 2010-03-06 23:30:57 -0800 | [diff] [blame] | 362 | |
| 363 | void dvmCompilerAbort(CompilationUnit *cUnit) |
| 364 | { |
| 365 | LOGE("Jit: aborting trace compilation, reverting to interpreter"); |
| 366 | /* Force a traceback in debug builds */ |
| 367 | assert(0); |
| 368 | /* |
| 369 | * Abort translation and force to interpret-only for this trace |
| 370 | * Matching setjmp in compiler thread work loop in Compiler.c. |
| 371 | */ |
| 372 | longjmp(*cUnit->bailPtr, 1); |
| 373 | } |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame^] | 374 | |
| 375 | void dvmDumpBlockBitVector(const GrowableList *blocks, char *msg, |
| 376 | const BitVector *bv, int length) |
| 377 | { |
| 378 | int i; |
| 379 | |
| 380 | LOGE("%s", msg); |
| 381 | for (i = 0; i < length; i++) { |
| 382 | if (dvmIsBitSet(bv, i)) { |
| 383 | BasicBlock *bb = |
| 384 | (BasicBlock *) dvmGrowableListGetElement(blocks, i); |
| 385 | char blockName[BLOCK_NAME_LEN]; |
| 386 | dvmGetBlockName(bb, blockName); |
| 387 | LOGE("Bit %d / %s is set", i, blockName); |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | void dvmGetBlockName(BasicBlock *bb, char *name) |
| 393 | { |
| 394 | switch (bb->blockType) { |
| 395 | case kMethodEntryBlock: |
| 396 | snprintf(name, BLOCK_NAME_LEN, "entry"); |
| 397 | break; |
| 398 | case kMethodExitBlock: |
| 399 | snprintf(name, BLOCK_NAME_LEN, "exit"); |
| 400 | break; |
| 401 | case kDalvikByteCode: |
| 402 | snprintf(name, BLOCK_NAME_LEN, "block%04x", bb->startOffset); |
| 403 | break; |
| 404 | case kExceptionHandling: |
| 405 | snprintf(name, BLOCK_NAME_LEN, "exception%04x", bb->startOffset); |
| 406 | break; |
| 407 | default: |
| 408 | snprintf(name, BLOCK_NAME_LEN, "??"); |
| 409 | break; |
| 410 | } |
| 411 | } |