From 7844c66d6e0ceea3313e7eaa9a782564507372c1 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Tue, 13 Dec 2011 17:04:35 -0800 Subject: [PATCH] vm: factor out word_stack_frame_size --- vm/quotations.cpp | 12 +++++++++--- vm/quotations.hpp | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/vm/quotations.cpp b/vm/quotations.cpp index dc84ef506e..43f90df280 100755 --- a/vm/quotations.cpp +++ b/vm/quotations.cpp @@ -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); diff --git a/vm/quotations.hpp b/vm/quotations.hpp index f465a34944..36c2461f4f 100755 --- a/vm/quotations.hpp +++ b/vm/quotations.hpp @@ -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();