Added oom stuff.
authortwisti <none@none>
Mon, 26 Apr 2004 16:36:48 +0000 (16:36 +0000)
committertwisti <none@none>
Mon, 26 Apr 2004 16:36:48 +0000 (16:36 +0000)
jit/codegen.inc
src/vm/jit/codegen.inc

index e87f363e570d16c69e318f00799c5fb57f801567..e3448940fbcdf13543dc54d4b8b38685823eef03 100644 (file)
@@ -48,7 +48,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 967 2004-03-18 14:29:03Z jowenn $
+   $Id: codegen.inc 1037 2004-04-26 16:36:48Z twisti $
 
 */
 
@@ -85,6 +85,7 @@ static branchref *xcheckarefs;      /* list of array size check branches      */
 static branchref *xnullrefs;        /* list of null check branches            */
 static branchref *xcastrefs;        /* list of cast check branches            */
 static branchref *xdivrefs;         /* list of divide by zero branches        */
+static branchref *xoomrefs;         /* list of out of memory branches         */
 static linenumberref *linenumberreferences; /*list of line numbers and the program counters of their first instruction*/
 static s4 linenumbertablesizepos;
 static s4 linenumbertablestartpos;
@@ -120,6 +121,7 @@ static void codegen_addxboundrefs(void *branchptr, s4 reg);
 static void codegen_addxnullrefs(void *branchptr);
 static void codegen_addxcastrefs(void *branchptr);
 static void codegen_addxdivrefs(void *branchptr);
+static void codegen_addxoomrefs(void *branchptr);
 static void codegen_threadcritstart(int offset);
 static void codegen_threadcritstop(int offset);
 
@@ -154,6 +156,7 @@ void codegen_init()
        xnullrefs = NULL;
        xcastrefs = NULL;
        xdivrefs = NULL;
+       xoomrefs = NULL;
 
 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
        threadcritcurrent.next = NULL;
@@ -414,6 +417,18 @@ static void codegen_addxcastrefs(void *branchptr)
 
 
 
+static void codegen_addxoomrefs(void *branchptr)
+{
+       s4 branchpos = (u1*) branchptr - mcodebase;
+
+       branchref *br = DNEW(branchref);
+
+       br->branchpos = branchpos;
+       br->next = xoomrefs;
+       xoomrefs = br;
+}
+
+
 static void codegen_addxdivrefs(void *branchptr)
 {
        s4 branchpos = (u1*) branchptr - mcodebase;
@@ -426,7 +441,6 @@ static void codegen_addxdivrefs(void *branchptr)
 }
 
 
-
 static void codegen_createlinenumbertable() {
 #ifdef __I386__
        /*log_text("codegen_createlinnumbertable");*/
index e87f363e570d16c69e318f00799c5fb57f801567..e3448940fbcdf13543dc54d4b8b38685823eef03 100644 (file)
@@ -48,7 +48,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 967 2004-03-18 14:29:03Z jowenn $
+   $Id: codegen.inc 1037 2004-04-26 16:36:48Z twisti $
 
 */
 
@@ -85,6 +85,7 @@ static branchref *xcheckarefs;      /* list of array size check branches      */
 static branchref *xnullrefs;        /* list of null check branches            */
 static branchref *xcastrefs;        /* list of cast check branches            */
 static branchref *xdivrefs;         /* list of divide by zero branches        */
+static branchref *xoomrefs;         /* list of out of memory branches         */
 static linenumberref *linenumberreferences; /*list of line numbers and the program counters of their first instruction*/
 static s4 linenumbertablesizepos;
 static s4 linenumbertablestartpos;
@@ -120,6 +121,7 @@ static void codegen_addxboundrefs(void *branchptr, s4 reg);
 static void codegen_addxnullrefs(void *branchptr);
 static void codegen_addxcastrefs(void *branchptr);
 static void codegen_addxdivrefs(void *branchptr);
+static void codegen_addxoomrefs(void *branchptr);
 static void codegen_threadcritstart(int offset);
 static void codegen_threadcritstop(int offset);
 
@@ -154,6 +156,7 @@ void codegen_init()
        xnullrefs = NULL;
        xcastrefs = NULL;
        xdivrefs = NULL;
+       xoomrefs = NULL;
 
 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
        threadcritcurrent.next = NULL;
@@ -414,6 +417,18 @@ static void codegen_addxcastrefs(void *branchptr)
 
 
 
+static void codegen_addxoomrefs(void *branchptr)
+{
+       s4 branchpos = (u1*) branchptr - mcodebase;
+
+       branchref *br = DNEW(branchref);
+
+       br->branchpos = branchpos;
+       br->next = xoomrefs;
+       xoomrefs = br;
+}
+
+
 static void codegen_addxdivrefs(void *branchptr)
 {
        s4 branchpos = (u1*) branchptr - mcodebase;
@@ -426,7 +441,6 @@ static void codegen_addxdivrefs(void *branchptr)
 }
 
 
-
 static void codegen_createlinenumbertable() {
 #ifdef __I386__
        /*log_text("codegen_createlinnumbertable");*/