From 7de311c0da09f0108f892ca694ade93196236bed Mon Sep 17 00:00:00 2001 From: Phil Dawes Date: Fri, 21 Aug 2009 08:21:44 +0100 Subject: [PATCH] moved stack_traces_p into the vm --- vm/code_block.hpp | 5 ----- vm/jit.cpp | 2 +- vm/vm.hpp | 10 +++++++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/vm/code_block.hpp b/vm/code_block.hpp index 50d937f4af..17ccdfe8ab 100644 --- a/vm/code_block.hpp +++ b/vm/code_block.hpp @@ -72,9 +72,4 @@ void copy_literal_references(code_block *compiled, factorvm *myvm); void update_word_references(code_block *compiled, factorvm *myvm); void update_literal_and_word_references(code_block *compiled, factorvm *myvm); -inline bool stack_traces_p() -{ - return userenv[STACK_TRACES_ENV] != F; -} - } diff --git a/vm/jit.cpp b/vm/jit.cpp index 7177f26073..d474d23a18 100644 --- a/vm/jit.cpp +++ b/vm/jit.cpp @@ -21,7 +21,7 @@ jit::jit(cell type_, cell owner_, factorvm *vm) offset(0), myvm(vm) { - if(stack_traces_p()) literal(owner.value()); + if(myvm->stack_traces_p()) literal(owner.value()); } void jit::emit_relocation(cell code_template_) diff --git a/vm/vm.hpp b/vm/vm.hpp index 00a24e4502..88b323adf4 100644 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -2,11 +2,15 @@ namespace factor { struct factorvm { - // if you change this struct, also change vm.factor + + // if you change this struct, also change vm.factor k-------- context *stack_chain; zone nursery; /* new objects are allocated here */ cell cards_offset; cell decks_offset; + // cell userenv[USER_ENV]; // prob best to put this last + + // segments inline cell align_page(cell a); @@ -494,6 +498,10 @@ struct factorvm { void fixup_labels(array *labels, code_block *compiled); code_block *allot_code_block(cell size); code_block *add_code_block(cell type,cell code_,cell labels_,cell relocation_,cell literals_); + inline bool stack_traces_p() + { + return userenv[STACK_TRACES_ENV] != F; + } //code_heap heap code;