Mercurial > hg > truffle
comparison src/share/vm/classfile/javaClasses.cpp @ 3297:6431be02f3ac
Merge
author | trims |
---|---|
date | Fri, 29 Apr 2011 16:55:43 -0700 |
parents | 01147d8aac1d |
children | 167b70ff3abc |
comparison
equal
deleted
inserted
replaced
3265:d7cc76ea8d06 | 3297:6431be02f3ac |
---|---|
1355 return _bcis->ushort_at(_index); | 1355 return _bcis->ushort_at(_index); |
1356 } | 1356 } |
1357 }; | 1357 }; |
1358 | 1358 |
1359 | 1359 |
1360 void java_lang_Throwable::fill_in_stack_trace(Handle throwable, TRAPS) { | 1360 void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle method, TRAPS) { |
1361 if (!StackTraceInThrowable) return; | 1361 if (!StackTraceInThrowable) return; |
1362 ResourceMark rm(THREAD); | 1362 ResourceMark rm(THREAD); |
1363 | 1363 |
1364 // Start out by clearing the backtrace for this object, in case the VM | 1364 // Start out by clearing the backtrace for this object, in case the VM |
1365 // runs out of memory while allocating the stack trace | 1365 // runs out of memory while allocating the stack trace |
1371 } | 1371 } |
1372 | 1372 |
1373 int max_depth = MaxJavaStackTraceDepth; | 1373 int max_depth = MaxJavaStackTraceDepth; |
1374 JavaThread* thread = (JavaThread*)THREAD; | 1374 JavaThread* thread = (JavaThread*)THREAD; |
1375 BacktraceBuilder bt(CHECK); | 1375 BacktraceBuilder bt(CHECK); |
1376 | |
1377 // If there is no Java frame just return the method that was being called | |
1378 // with bci 0 | |
1379 if (!thread->has_last_Java_frame()) { | |
1380 if (max_depth >= 1 && method() != NULL) { | |
1381 bt.push(method(), 0, CHECK); | |
1382 set_backtrace(throwable(), bt.backtrace()); | |
1383 } | |
1384 return; | |
1385 } | |
1376 | 1386 |
1377 // Instead of using vframe directly, this version of fill_in_stack_trace | 1387 // Instead of using vframe directly, this version of fill_in_stack_trace |
1378 // basically handles everything by hand. This significantly improved the | 1388 // basically handles everything by hand. This significantly improved the |
1379 // speed of this method call up to 28.5% on Solaris sparc. 27.1% on Windows. | 1389 // speed of this method call up to 28.5% on Solaris sparc. 27.1% on Windows. |
1380 // See bug 6333838 for more details. | 1390 // See bug 6333838 for more details. |
1475 | 1485 |
1476 // Put completed stack trace into throwable object | 1486 // Put completed stack trace into throwable object |
1477 set_backtrace(throwable(), bt.backtrace()); | 1487 set_backtrace(throwable(), bt.backtrace()); |
1478 } | 1488 } |
1479 | 1489 |
1480 void java_lang_Throwable::fill_in_stack_trace(Handle throwable) { | 1490 void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle method) { |
1481 // No-op if stack trace is disabled | 1491 // No-op if stack trace is disabled |
1482 if (!StackTraceInThrowable) { | 1492 if (!StackTraceInThrowable) { |
1483 return; | 1493 return; |
1484 } | 1494 } |
1485 | 1495 |
1489 } | 1499 } |
1490 | 1500 |
1491 PRESERVE_EXCEPTION_MARK; | 1501 PRESERVE_EXCEPTION_MARK; |
1492 | 1502 |
1493 JavaThread* thread = JavaThread::active(); | 1503 JavaThread* thread = JavaThread::active(); |
1494 fill_in_stack_trace(throwable, thread); | 1504 fill_in_stack_trace(throwable, method, thread); |
1495 // ignore exceptions thrown during stack trace filling | 1505 // ignore exceptions thrown during stack trace filling |
1496 CLEAR_PENDING_EXCEPTION; | 1506 CLEAR_PENDING_EXCEPTION; |
1497 } | 1507 } |
1498 | 1508 |
1499 void java_lang_Throwable::allocate_backtrace(Handle throwable, TRAPS) { | 1509 void java_lang_Throwable::allocate_backtrace(Handle throwable, TRAPS) { |