comparison graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiTargetMethod.java @ 4693:07bcee8b70a4

Simplify exception debug information and exception handler table creation based on Graal's simplified model of exception handler information (i.e. the dispatch is done in compiled code).
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 25 Feb 2012 00:40:34 +0100
parents aaac4894175c
children 12c63380e7ff
comparison
equal deleted inserted replaced
4692:9d48ccb39292 4693:07bcee8b70a4
307 public static final class ExceptionHandler extends Site { 307 public static final class ExceptionHandler extends Site {
308 /** 308 /**
309 * 309 *
310 */ 310 */
311 private static final long serialVersionUID = 4897339464722665281L; 311 private static final long serialVersionUID = 4897339464722665281L;
312 public final int bci;
313 public final int scopeLevel;
314 public final int handlerPos; 312 public final int handlerPos;
315 public final int handlerBci; 313
316 public final RiType exceptionType; 314 ExceptionHandler(int pcOffset, int handlerPos) {
317
318 ExceptionHandler(int pcOffset, int bci, int scopeLevel, int handlerPos, int handlerBci, RiType exceptionType) {
319 super(pcOffset); 315 super(pcOffset);
320 this.bci = bci;
321 this.scopeLevel = scopeLevel;
322 this.handlerPos = handlerPos; 316 this.handlerPos = handlerPos;
323 this.handlerBci = handlerBci; 317 }
324 this.exceptionType = exceptionType; 318
325 } 319 @Override
326 320 public String toString() {
327 @Override 321 return String.format("%d[<exception edge to %d>]", pcOffset, handlerPos);
328 public String toString() {
329 return String.format("%d[<exception edge to %d with type %s>]", pcOffset, handlerPos, (exceptionType == null) ? "null" : exceptionType);
330 } 322 }
331 } 323 }
332 324
333 public static final class Mark extends Site { 325 public static final class Mark extends Site {
334 /** 326 /**
459 * 451 *
460 * @param codePos the position in the code that is covered by the handler 452 * @param codePos the position in the code that is covered by the handler
461 * @param handlerPos the position of the handler 453 * @param handlerPos the position of the handler
462 * @param throwableType the type of exceptions handled by the handler 454 * @param throwableType the type of exceptions handled by the handler
463 */ 455 */
464 public void recordExceptionHandler(int codePos, int bci, int scopeLevel, int handlerPos, int handlerBci, RiType throwableType) { 456 public void recordExceptionHandler(int codePos, int handlerPos) {
465 exceptionHandlers.add(new ExceptionHandler(codePos, bci, scopeLevel, handlerPos, handlerBci, throwableType)); 457 exceptionHandlers.add(new ExceptionHandler(codePos, handlerPos));
466 } 458 }
467 459
468 /** 460 /**
469 * Records a safepoint in the code array. 461 * Records a safepoint in the code array.
470 * 462 *