Added: codegen_disassemble_nativestub
authortwisti <none@none>
Wed, 8 Jun 2005 20:54:54 +0000 (20:54 +0000)
committertwisti <none@none>
Wed, 8 Jun 2005 20:54:54 +0000 (20:54 +0000)
src/vm/jit/codegen.inc

index 932f419f3c0f7b414680c065a5c8ae5537e74d95..47af3708896f950f9f397349204159911dfe6de8 100644 (file)
@@ -47,7 +47,7 @@
    memory. All functions writing values into the data area return the offset
    relative the begin of the code area (start of procedure).   
 
-   $Id: codegen.inc 2589 2005-06-08 10:59:04Z twisti $
+   $Id: codegen.inc 2616 2005-06-08 20:54:54Z twisti $
 
 */
 
@@ -59,6 +59,8 @@
 # include <dlfcn.h>
 #endif
 
+#include "disass.h"
+
 #include "mm/memory.h"
 #include "toolbox/avl.h"
 #include "toolbox/logging.h"
@@ -850,6 +852,26 @@ void dseg_display(methodinfo *m, codegendata *cd)
 }
 
 
+
+/* codegen_nativestub **********************************************************
+
+   Disassembles the generated native stub.
+
+*******************************************************************************/
+
+static void codegen_disassemble_nativestub(methodinfo *m, s4 *code, s4 len)
+{
+       printf("Native stub: ");
+       utf_fprint_classname(stdout, m->class->name);
+       printf(".");
+       utf_fprint(stdout, m->name);
+       utf_fprint(stdout, m->descriptor);
+       printf("\n\nLength: %d\n\n", len);
+
+       disassemble(code, len);
+}
+
+
 /* reg_of_var:
     This function determines a register, to which the result of an operation
     should go, when it is ultimatively intended to store the result in