From 54b3c1ea8801cc65964486b6b841715c040100c1 Mon Sep 17 00:00:00 2001 From: Phil Dawes Date: Mon, 17 Aug 2009 21:37:09 +0100 Subject: [PATCH] added vm member to jit classes --- vm/inline_cache.cpp | 4 ++-- vm/jit.cpp | 5 +++-- vm/jit.hpp | 4 ++-- vm/profiler.cpp | 2 +- vm/quotations.cpp | 4 ++-- vm/quotations.hpp | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) mode change 100644 => 100755 vm/quotations.hpp diff --git a/vm/inline_cache.cpp b/vm/inline_cache.cpp index 05a977a67d..9e26f75ad9 100755 --- a/vm/inline_cache.cpp +++ b/vm/inline_cache.cpp @@ -103,7 +103,7 @@ void update_pic_count(cell type) struct inline_cache_jit : public jit { fixnum index; - inline_cache_jit(cell generic_word_) : jit(PIC_TYPE,generic_word_) {}; + inline_cache_jit(cell generic_word_,factorvm *vm) : jit(PIC_TYPE,generic_word_,vm) {}; void emit_check(cell klass); void compile_inline_cache(fixnum index, @@ -173,7 +173,7 @@ code_block *factorvm::compile_inline_cache(fixnum index,cell generic_word_,cell gc_root methods(methods_); gc_root cache_entries(cache_entries_); - inline_cache_jit jit(generic_word.value()); + inline_cache_jit jit(generic_word.value(),this); jit.compile_inline_cache(index, generic_word.value(), methods.value(), diff --git a/vm/jit.cpp b/vm/jit.cpp index a3f222a953..104231f532 100644 --- a/vm/jit.cpp +++ b/vm/jit.cpp @@ -10,7 +10,7 @@ namespace factor - polymorphic inline caches (inline_cache.cpp) */ /* Allocates memory */ -jit::jit(cell type_, cell owner_) +jit::jit(cell type_, cell owner_, factorvm *vm) : type(type_), owner(owner_), code(), @@ -18,7 +18,8 @@ jit::jit(cell type_, cell owner_) literals(), computing_offset_p(false), position(0), - offset(0) + offset(0), + myvm(vm) { if(stack_traces_p()) literal(owner.value()); } diff --git a/vm/jit.hpp b/vm/jit.hpp index 69ab0f9595..0e3db90d38 100644 --- a/vm/jit.hpp +++ b/vm/jit.hpp @@ -10,9 +10,9 @@ struct jit { bool computing_offset_p; fixnum position; cell offset; - //factorvm *vm; + factorvm *myvm; - jit(cell jit_type, cell owner); + jit(cell jit_type, cell owner, factorvm *vm); void compute_position(cell offset); void emit_relocation(cell code_template); diff --git a/vm/profiler.cpp b/vm/profiler.cpp index 054fe01537..de5da244a9 100755 --- a/vm/profiler.cpp +++ b/vm/profiler.cpp @@ -20,7 +20,7 @@ code_block *factorvm::compile_profiling_stub(cell word_) { gc_root word(word_); - jit jit(WORD_TYPE,word.value()); + jit jit(WORD_TYPE,word.value(),this); jit.emit_with(userenv[JIT_PROFILING],word.value()); return jit.to_code_block(); diff --git a/vm/quotations.cpp b/vm/quotations.cpp index a093e0e9df..4a1ad4d371 100755 --- a/vm/quotations.cpp +++ b/vm/quotations.cpp @@ -285,7 +285,7 @@ void factorvm::jit_compile(cell quot_, bool relocating) gc_root quot(quot_); if(quot->code) return; - quotation_jit compiler(quot.value(),true,relocating); + quotation_jit compiler(quot.value(),true,relocating,this); compiler.iterate_quotation(); code_block *compiled = compiler.to_code_block(); @@ -368,7 +368,7 @@ fixnum factorvm::quot_code_offset_to_scan(cell quot_, cell offset) gc_root quot(quot_); gc_root array(quot->array); - quotation_jit compiler(quot.value(),false,false); + quotation_jit compiler(quot.value(),false,false,this); compiler.compute_position(offset); compiler.iterate_quotation(); diff --git a/vm/quotations.hpp b/vm/quotations.hpp old mode 100644 new mode 100755 index c1a2a92bd1..b70be4306e --- a/vm/quotations.hpp +++ b/vm/quotations.hpp @@ -5,8 +5,8 @@ struct quotation_jit : public jit { gc_root elements; bool compiling, relocate; - quotation_jit(cell quot, bool compiling_, bool relocate_) - : jit(QUOTATION_TYPE,quot), + quotation_jit(cell quot, bool compiling_, bool relocate_, factorvm *vm) + : jit(QUOTATION_TYPE,quot,vm), elements(owner.as().untagged()->array), compiling(compiling_), relocate(relocate_) {};