* src/vm/jit/arm/codegen.c: Remove hack for return value in float registers.
[cacao.git] / src / vm / jit / linenumbertable.hpp
index d0b2c5bc07b76e1eadfa5b546551df74c5bf4d91..1fa5440ea25cc627266a5c847beaa1c43a7cc7f2 100644 (file)
 #include <stdint.h>
 
 #ifdef __cplusplus
+#include <functional>
 #include <vector>
 #endif
 
 #include "toolbox/list.hpp"
 
-#include "vm/method.h"
+#include "vm/method.hpp"
 
 #include "vm/jit/jit.hpp"
 #include "vm/jit/code.hpp"
@@ -66,7 +67,20 @@ public:
        inline int32_t get_linenumber() const { return _linenumber; }
        inline void*   get_pc        () const { return _pc; }
 
-       void resolve(codeinfo* code);
+       void resolve(const codeinfo* code);
+};
+
+
+/**
+ * Unary function to resolve Linenumber objects.
+ */
+class LinenumberResolver : public std::binary_function<Linenumber, codeinfo*, void> {
+public:
+       // Unary resolve function.
+       void operator() (Linenumber& ln, const codeinfo* code) const
+       {
+               ln.resolve(code);
+       }
 };
 
 
@@ -77,6 +91,15 @@ class LinenumberTable {
 private:
        std::vector<Linenumber> _linenumbers;
 
+       // Comparator class.
+       class comparator : public std::binary_function<Linenumber, void*, bool> {
+       public:
+               bool operator() (const Linenumber& ln, const void* pc) const
+               {
+                       return (pc >= ln.get_pc());
+               }
+       };
+
 public:
        LinenumberTable(jitdata* jd);
        ~LinenumberTable();
@@ -88,10 +111,6 @@ public:
 
 typedef struct LinenumberTable LinenumberTable;
 
-#include "vm/jit/codegen-common.hpp"
-
-int32_t linenumbertable_linenumber_for_pc(methodinfo** m, codeinfo* code, void* pc);
-
 #endif
 
 #include "vm/jit/codegen-common.hpp"
@@ -108,7 +127,6 @@ void    linenumbertable_list_entry_add_inline_end(codegendata *cd, instruction *
 } // extern "C"
 #endif
 
-
 #endif // _LINENUMBERTABLE_HPP