Dies ist eine alte Version des Dokuments!


Exceptions

Terminologie

  • PPC Exceptions: Exception which are specific to the PPC architecture.
  • Interrupt: A certain type of a PPC exception, caused by asynchronous events by external hardware.
  • Java Exception: Exception defined in the Java language specification. All Java exceptions are extensions of the class Throwable.

PPC Exceptions

Each PPC exception is caused by a synchronous or asynchronous event and causes the processor to switch to supervisor mode and jump to the proper exception vector.

PPC Exceptions and Interrupts

Exception classes and their corresponding exception methods have to be specified in the configuration. Instances of these classes are never created and therefore the object constructors are defined as synthetic and will not be translated into code.
The code generator has to create a special exception stack frame and must conclude the method with the instruction rfi.
The reset exception must not have a prolog, as there is no stack yet.

Floats in Exceptions

Mit US.ENABLE_FLOATS werden alle volatile FPR's gespeichert und das FP-Enable Bit im MSR gesetzt. Die nonvolatile FPR, die in einer Methode benutzt werden, werden bereits durch den Methodenprolog gesichert. US.ENABLE_FLOATS kann in einer Exception-Methode oder in einer Methode, die durch eine Exception-Methode aufgerufen wird, plaziert werden.
Auch wenn wie im Falle des Decrementers eine action-Methode aufgerufen wird und diese in einer Unterklasse überschrieben wird, muss die action-Methode der Unterklasse US.ENABLE_FLOATS aufrufen, weil in der Decrementer-Exception Methode ja noch nicht klar ist, dass die Floats benützt werden. Werden aus dieser action-Methode weitere Methoden (z.B. Math.sin) aufgerufen, muss dort drin US.FLOAT_ENABLE() nicht mehr aufgerufen werden.

Java Exceptions