]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/layouts.hpp
vm: change "profiler" names to "counting_profiler"
[factor.git] / vm / layouts.hpp
index 35f04e7cc518a2703b7e94db84a44b55cdf0808a..300b819b1fadcc96d612781959fe0d9220ce1072 100644 (file)
@@ -23,6 +23,11 @@ inline static cell align(cell a, cell b)
        return (a + (b-1)) & ~(b-1);
 }
 
+inline static cell alignment_for(cell a, cell b)
+{
+       return align(a,b) - a;
+}
+
 static const cell data_alignment = 16;
 
 #define WORD_SIZE (signed)(sizeof(cell)*8)
@@ -55,7 +60,7 @@ enum code_block_type
 {
        code_block_unoptimized,
        code_block_optimized,
-       code_block_profiling,
+       code_block_counting_profiler,
        code_block_pic
 };
 
@@ -98,7 +103,10 @@ struct object {
        cell header;
 
        cell size() const;
+       template<typename Fixup> cell size(Fixup fixup) const;
+
        cell binary_payload_start() const;
+       template<typename Fixup> cell binary_payload_start(Fixup fixup) const;
 
        cell *slots() const { return (cell *)this; }
 
@@ -178,8 +186,6 @@ struct bignum : public object {
        cell *data() const { return (cell *)(this + 1); }
 };
 
-const cell byte_array_offset = 16 - BYTE_ARRAY_TYPE;
-
 struct byte_array : public object {
        static const cell type_number = BYTE_ARRAY_TYPE;
        static const cell element_size = 1;
@@ -226,7 +232,7 @@ struct word : public object {
        cell pic_def;
        /* TAGGED alternative entry point for direct tail calls. Used for inline caching */
        cell pic_tail_def;
-       /* TAGGED call count for profiling */
+       /* TAGGED call count for counting_profiler */
        cell counter;
        /* TAGGED machine code for sub-primitive */
        cell subprimitive;
@@ -234,8 +240,8 @@ struct word : public object {
        void *entry_point;
        /* UNTAGGED compiled code block */
        code_block *code;
-       /* UNTAGGED profiler stub */
-       code_block *profiling;
+       /* UNTAGGED counting_profiler stub */
+       code_block *counting_profiler;
 };
 
 /* Assembly code makes assumptions about the layout of this struct */
@@ -244,8 +250,6 @@ struct wrapper : public object {
        cell object;
 };
 
-const fixnum boxed_float_offset = 8 - FLOAT_TYPE;
-
 /* Assembly code makes assumptions about the layout of this struct */
 struct boxed_float : object {
        static const cell type_number = FLOAT_TYPE;