Support for exception throwing.

These changes start to add support for a long jump style of exception throw.
A Context is added to build up the registers that will be loaded by the long
jump from callee saves that are on the stack. Throws are reworked slightly to
give the PC for the frame of the method being looked at, rather than the return
PC (that previously led the trace's PC to be off by a frame). Callee save
support is added to the JNI compiler which then no longer needs to spill
incoming argument registers as it may reuse the callee saves.

Currently the code is lightly tested on ARM and doesn't support
restoring floating point callee save registers.

Also clean up some PIC TODOs.

Change-Id: I9bcef4ab3bf4a9de57d7a5123fb3bb1707ca8921
diff --git a/src/context.h b/src/context.h
new file mode 100644
index 0000000..05cd43b
--- /dev/null
+++ b/src/context.h
@@ -0,0 +1,36 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+
+#ifndef ART_SRC_CONTEXT_H_
+#define ART_SRC_CONTEXT_H_
+
+#include <stdint.h>
+
+namespace art {
+
+class Frame;
+
+// Representation of a thread's context on the executing machine
+class Context {
+ public:
+  // Creates a context for the running architecture
+  static Context* Create();
+
+  virtual ~Context() {}
+
+  // Read values from callee saves in the given frame. The frame also holds
+  // the method that holds the layout.
+  virtual void FillCalleeSaves(const Frame& fr) = 0;
+
+  // Set the stack pointer value
+  virtual void SetSP(uintptr_t new_sp) = 0;
+
+  // Set the program counter value
+  virtual void SetPC(uintptr_t new_pc) = 0;
+
+  // Switch execution of the executing context to this context
+  virtual void DoLongJump() = 0;
+};
+
+}  // namespace art
+
+#endif  // ART_SRC_CONTEXT_H_