]> gitweb.factorcode.org Git - factor.git/commitdiff
vm: More allocates comments.
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 25 Mar 2013 21:05:05 +0000 (14:05 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 25 Mar 2013 21:05:05 +0000 (14:05 -0700)
vm/bignum.cpp
vm/data_heap.cpp
vm/factor.cpp
vm/math.cpp
vm/objects.cpp
vm/quotations.cpp
vm/tuples.cpp
vm/words.cpp

index 9f852437274962e62b5fe5c43b983bc3966d0e33..94026ac95ff8bcdd251a3989a8e11363cbedf088 100755 (executable)
@@ -324,8 +324,8 @@ bignum *factor_vm::bignum_remainder(bignum * numerator, bignum * denominator)
                }
 }
 
-/* Allocates memory */
 /* cell_to_bignum, fixnum_to_bignum, long_long_to_bignum, ulong_long_to_bignum */
+/* Allocates memory */
 #define FOO_TO_BIGNUM(name,type,stype,utype)                           \
 bignum * factor_vm::name##_to_bignum(type n)                           \
 {                                                                      \
index ddd39d221aa1b32cdb83058b111abdc707193851..6fa8858f051b966690acb7ee74b009d9cd48b4f2 100755 (executable)
@@ -167,6 +167,7 @@ struct object_accumulator {
        }
 };
 
+/* Allocates memory */
 cell factor_vm::instances(cell type)
 {
        object_accumulator accum(type);
@@ -174,6 +175,7 @@ cell factor_vm::instances(cell type)
        return std_vector_to_array(accum.objects);
 }
 
+/* Allocates memory */
 void factor_vm::primitive_all_instances()
 {
        primitive_full_gc();
index dd9be27774b0474fc3dc521da412bd288d803cdd..8a345b9a6c70fc4f227f113cb7cf3986966a7b82 100755 (executable)
@@ -81,6 +81,7 @@ void factor_vm::init_parameters_from_args(vm_parameters *p, int argc, vm_char **
 }
 
 /* Compile code in boot image so that we can execute the startup quotation */
+/* Allocates memory */
 void factor_vm::prepare_boot_image()
 {
        std::cout << "*** Stage 2 early init... " << std::flush;
index af973bf4675d0c5e030b3f0db0a2ab9a788252d9..309def705f0efe7139105ed39905a18c650606e7 100755 (executable)
@@ -474,6 +474,7 @@ double factor_vm::to_double(cell value)
 
 /* The fixnum+, fixnum- and fixnum* primitives are defined in cpu_*.S. On
 overflow, they call these functions. */
+/* Allocates memory */
 inline void factor_vm::overflow_fixnum_add(fixnum x, fixnum y)
 {
        ctx->replace(tag<bignum>(fixnum_to_bignum(
@@ -485,6 +486,7 @@ VM_C_API void overflow_fixnum_add(fixnum x, fixnum y, factor_vm *parent)
        parent->overflow_fixnum_add(x,y);
 }
 
+/* Allocates memory */
 inline void factor_vm::overflow_fixnum_subtract(fixnum x, fixnum y)
 {
        ctx->replace(tag<bignum>(fixnum_to_bignum(
@@ -496,6 +498,7 @@ VM_C_API void overflow_fixnum_subtract(fixnum x, fixnum y, factor_vm *parent)
        parent->overflow_fixnum_subtract(x,y);
 }
 
+/* Allocates memory */
 inline void factor_vm::overflow_fixnum_multiply(fixnum x, fixnum y)
 {
        bignum *bx = fixnum_to_bignum(x);
index 4dcf486c07ffc9c64a9820576c1d2cb6ac2bccdb..7c5b7bbfc40420aa3fab228b4eb17336cba5a889 100644 (file)
@@ -47,6 +47,7 @@ void factor_vm::primitive_set_slot()
        write_barrier(slot_ptr);
 }
 
+/* Allocates memory */
 cell factor_vm::clone_object(cell obj_)
 {
        data_root<object> obj(obj_,this);
@@ -63,6 +64,7 @@ cell factor_vm::clone_object(cell obj_)
        }
 }
 
+/* Allocates memory */
 void factor_vm::primitive_clone()
 {
        ctx->replace(clone_object(ctx->peek()));
index fd8605e1d62b97e51c32f9b7dabd4fddfbdcc762..2feddd67bc4042f680dc85ab4b09de4b4c34ae9c 100755 (executable)
@@ -156,6 +156,7 @@ void quotation_jit::emit_epilog(bool safepoint, bool stack_frame)
        if(stack_frame) emit(parent->special_objects[JIT_EPILOG]);
 }
 
+/* Allocates memory conditionally */
 void quotation_jit::emit_quot(cell quot_)
 {
        data_root<quotation> quot(quot_,parent);
@@ -341,6 +342,7 @@ code_block *factor_vm::jit_compile_quot(cell owner_, cell quot_, bool relocating
        return compiled;
 }
 
+/* Allocates memory */
 void factor_vm::jit_compile_quot(cell quot_, bool relocating)
 {
        data_root<quotation> quot(quot_,this);
@@ -351,6 +353,7 @@ void factor_vm::jit_compile_quot(cell quot_, bool relocating)
        }
 }
 
+/* Allocates memory */
 void factor_vm::primitive_jit_compile()
 {
        jit_compile_quot(ctx->pop(),true);
@@ -361,8 +364,8 @@ void *factor_vm::lazy_jit_compile_entry_point()
        return untag<word>(special_objects[LAZY_JIT_COMPILE_WORD])->entry_point;
 }
 
-/* Allocates memory */
 /* push a new quotation on the stack */
+/* Allocates memory */
 void factor_vm::primitive_array_to_quotation()
 {
        quotation *quot = allot<quotation>(sizeof(quotation));
@@ -398,6 +401,7 @@ fixnum factor_vm::quot_code_offset_to_scan(cell quot_, cell offset)
        return compiler.get_position();
 }
 
+/* Allocates memory */
 cell factor_vm::lazy_jit_compile(cell quot_)
 {
        data_root<quotation> quot(quot_,this);
@@ -410,6 +414,7 @@ cell factor_vm::lazy_jit_compile(cell quot_)
        return quot.value();
 }
 
+/* Allocates memory */
 VM_C_API cell lazy_jit_compile(cell quot, factor_vm *parent)
 {
        return parent->lazy_jit_compile(quot);
@@ -427,11 +432,13 @@ void factor_vm::primitive_quot_compiled_p()
        ctx->push(tag_boolean(quot_compiled_p(quot.untagged())));
 }
 
+/* Allocates memory */
 cell factor_vm::find_all_quotations()
 {
        return instances(QUOTATION_TYPE);
 }
 
+/* Allocates memory */
 void factor_vm::initialize_all_quotations()
 {
        data_root<array> quotations(find_all_quotations(),this);
index 8d224c93d555d39dbb7fa862edb2ccdbeee3c9a7..0721b7fceeaa87627eac252dda7857c3ad4041e7 100755 (executable)
@@ -3,8 +3,8 @@
 namespace factor
 {
 
-/* Allocates memory */
 /* push a new tuple on the stack, filling its slots with f */
+/* Allocates memory */
 void factor_vm::primitive_tuple()
 {
        data_root<tuple_layout> layout(ctx->pop(),this);
@@ -16,8 +16,8 @@ void factor_vm::primitive_tuple()
        ctx->push(t.value());
 }
 
-/* Allocates memory */
 /* push a new tuple on the stack, filling its slots from the stack */
+/* Allocates memory */
 void factor_vm::primitive_tuple_boa()
 {
        data_root<tuple_layout> layout(ctx->pop(),this);
index 94bd0a70246331c59147a29071f03df026f581cb..39e255741e8c411e112b8654d391512d5ae59ab3 100644 (file)
@@ -3,7 +3,8 @@
 namespace factor
 {
 
-/* Compile a word definition with the non-optimizing compiler. Allocates memory */
+/* Compile a word definition with the non-optimizing compiler. */
+/* Allocates memory */
 void factor_vm::jit_compile_word(cell word_, cell def_, bool relocating)
 {
        data_root<word> word(word_,this);
@@ -21,11 +22,13 @@ void factor_vm::jit_compile_word(cell word_, cell def_, bool relocating)
        if(to_boolean(word->pic_tail_def)) jit_compile_quot(word->pic_tail_def,relocating);
 }
 
+/* Allocates memory */
 cell factor_vm::find_all_words()
 {
        return instances(WORD_TYPE);
 }
 
+/* Allocates memory */
 void factor_vm::compile_all_words()
 {
        data_root<array> words(find_all_words(),this);