]> gitweb.factorcode.org Git - factor.git/commitdiff
vm: factor out word_stack_frame_size
authorJoe Groff <arcata@gmail.com>
Wed, 14 Dec 2011 01:04:35 +0000 (17:04 -0800)
committerJoe Groff <arcata@gmail.com>
Wed, 14 Dec 2011 17:56:49 +0000 (09:56 -0800)
vm/quotations.cpp
vm/quotations.hpp

index dc84ef506e5e14edbbbf2c7d0c3df9d1f7d2bb3c..43f90df2801af7c2ed0f84705d9dc2b0f532a2dc 100755 (executable)
@@ -309,6 +309,14 @@ void quotation_jit::iterate_quotation()
        }
 }
 
+cell quotation_jit::word_stack_frame_size(cell obj)
+{
+       if (special_subprimitive_p(obj))
+               return SIGNAL_HANDLER_STACK_FRAME_SIZE;
+       else
+               return JIT_FRAME_SIZE;
+}
+
 /* Allocates memory */
 code_block *factor_vm::jit_compile_quot(cell owner_, cell quot_, bool relocating)
 {
@@ -319,9 +327,7 @@ code_block *factor_vm::jit_compile_quot(cell owner_, cell quot_, bool relocating
        compiler.init_quotation(quot.value());
        compiler.iterate_quotation();
 
-       cell frame_size = compiler.special_subprimitive_p(owner_)
-               ? SIGNAL_HANDLER_STACK_FRAME_SIZE
-               : JIT_FRAME_SIZE;
+       cell frame_size = compiler.word_stack_frame_size(owner_);
 
        code_block *compiled = compiler.to_code_block(frame_size);
 
index f465a349448233146a416c5e1a10f078ec8e445a..36c2461f4f2caa925655693647e6baa16f7fadab 100755 (executable)
@@ -26,6 +26,7 @@ struct quotation_jit : public jit {
        bool declare_p(cell i, cell length);
        bool special_subprimitive_p(cell obj);
        bool word_stack_frame_p(cell obj);
+       cell word_stack_frame_size(cell obj);
        bool word_safepoint_p(cell obj);
        bool stack_frame_p();
        bool safepoint_p();