Commit a977c5f9 authored by Erick Gallesio's avatar Erick Gallesio

adding peehole optim for successive returns

parent a8053263
;;;;
;;;; assembler.stk -- Assember stuff
;;;;
;;;; Copyright 2000-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;; Copyright 2000-2007 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 14-Mar-2001 13:49 (eg)
;;;; Last file update: 23-Oct-2006 15:33 (eg)
;;;; Last file update: 22-Feb-2007 18:39 (eg)
;;;;
;;;
......@@ -275,7 +275,7 @@
(set! pc (+ pc (length x))))))
code)
;//(DEBUG "A l'issue de la passe 1 pc=~S labs=~S\n" pc labs)
(eprintf "A l'issue de la passe 1 pc=~S labs=~S\n" pc labs)
;;
;; Pass2
......@@ -316,9 +316,10 @@
(when (> len 3)
(panic "Instruction with more than 2 parameters ~S" x))
(set! pos (+ pos len))))
;// (DEBUG "A LA FIN pos=~S vector=~S" pos vect)
; (eprintf "A LA FIN pos=~S vector=~S\n" pos vect)
)
code)
(eprintf "A LA FIN pos=~S vector=~S\n" pos (vector-length vect))
vect)))
......
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 17-Mar-2001 20:32 (eg)
;;;; Last file update: 3-Feb-2007 15:18 (eg)
;;;; Last file update: 22-Feb-2007 18:31 (eg)
;;;;
; ======================================================================
......@@ -210,6 +210,10 @@
((LOCAL-REF2) 'LOCAL-REF2-PUSH)
((LOCAL-REF3) 'LOCAL-REF3-PUSH)
((LOCAL-REF4) 'LOCAL-REF4-PUSH)))))
;; [RETURN; RETURN] => [RETURN]
((and (eq? i1 'RETURN) (eq? i2 'RETURN))
(replace-2-instr code (list 'RETURN)))
(else ;; No optimization; goto next instruction
(set! code (cdr code))))))
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,9 +21,10 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 28-Dec-1999 22:58 (eg)
* Last file update: 30-Jan-2007 18:38 (eg)
* Last file update: 22-Feb-2007 17:42 (eg)
*/
#ifndef STKLOS_H
#define STKLOS_H
......@@ -47,6 +48,10 @@ extern "C"
#include "stklosconf.h"
#include "extraconf.h"
/* To debug the GC uncomment the following line */
/* #define GC_DEBUG 1*/
#ifdef HAVE_GC
# include <gc/gc.h>
#else
......@@ -141,11 +146,12 @@ extern "C"
/* Scheme interface. *** THIS IS THE INTERFACE TO USE *** */
#define STk_must_malloc(size) GC_malloc(size)
#define STk_must_malloc_atomic(size) GC_malloc_atomic(size)
#define STk_must_realloc(ptr, size) GC_realloc((ptr), (size))
#define STk_free(ptr) GC_free(ptr)
#define STk_register_finalizer(ptr, f) GC_register_finalizer((void *) (ptr), \
#define STk_must_malloc(size) GC_MALLOC(size)
#define STk_must_malloc_atomic(size) GC_MALLOC_ATOMIC(size)
#define STk_must_realloc(ptr, size) GC_REALLOC((ptr), (size))
#define STk_free(ptr) GC_FREE(ptr)
#define STk_register_finalizer(ptr, f) GC_REGISTER_FINALIZER((void *) (ptr), \
(GC_finalization_proc)(f), 0, 0, 0)
#define STk_gc() GC_gcollect()
......@@ -1179,7 +1185,7 @@ int STk_init_vector(void);
----
------------------------------------------------------------------------------
*/
#define DEFAULT_STACK_SIZE 50000
#define DEFAULT_STACK_SIZE 100000
void STk_execute_current_handler(SCM kind, SCM location, SCM message);
void STk_raise_exception(SCM cond);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment