]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
compile_block() checks if code cache is full
authorAleksey Demakov <ademakov@gmail.com>
Thu, 15 Feb 2007 07:31:05 +0000 (07:31 +0000)
committerAleksey Demakov <ademakov@gmail.com>
Thu, 15 Feb 2007 07:31:05 +0000 (07:31 +0000)
ChangeLog
jit/jit-function.c

index 88327079020f62945f367d61067047660ed78f07..640c8919d0f14111593020fd2093266761718236 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-14  Aleksey Demakov  <ademakov@gmail.com>
+
+       * jit/jit-function.c (compile_block): check if cache is full and
+       exit if so.
+
 2007-02-13  Aleksey Demakov  <ademakov@gmail.com>
 
        * doc/texinfo.tex: remove an ancient file version from the tree.
index dac32ff2b925a634d4219fd1c67ba7803fb27388..0c0bcfb2c4e4658af39b39d85cad2a47ef9b4267 100644 (file)
@@ -518,6 +518,16 @@ static void compile_block(jit_gencode_t gen, jit_function_t func,
                printf("Start of binary code: 0x%08x\n", p1);
 #endif
 
+               /* The cache is full. */
+               if(!jit_cache_check_for_n(&gen->posn, 1))
+               {
+#ifdef _JIT_COMPILE_DEBUG
+                       printf("No space left in the code cache.\n\n");
+                       fflush(stdout);
+#endif
+                       return;
+               }
+
                switch(insn->opcode)
                {
                        case JIT_OP_NOP:                break;          /* Ignore NOP's */