]> gitweb.factorcode.org Git - factor.git/commitdiff
added VM relocation type
authorPhil Dawes <phil@phildawes.net>
Tue, 18 Aug 2009 19:40:26 +0000 (20:40 +0100)
committerPhil Dawes <phil@phildawes.net>
Wed, 16 Sep 2009 07:16:30 +0000 (08:16 +0100)
basis/compiler/constants/constants.factor
vm/code_block.cpp
vm/code_block.hpp
vm/master.hpp

index b795862970e7cee5b7e779f1cdc8203748a5b169..cc6003b89c2f66e044e01b92123d3da3c19242b8 100644 (file)
@@ -50,6 +50,7 @@ CONSTANT: rt-immediate 8
 CONSTANT: rt-stack-chain 9
 CONSTANT: rt-untagged 10
 CONSTANT: rt-megamorphic-cache-hits 11
+CONSTANT: rt-vm 12
 
 : rc-absolute? ( n -- ? )
     ${ rc-absolute-ppc-2/2 rc-absolute-cell rc-absolute } member? ;
index f19759fb0ec4f748a13cd561a84bbd219a56a576..a64a8d2c2d03bcc90d7cd7d637ed3e60b81f47e2 100755 (executable)
@@ -44,6 +44,7 @@ int factorvm::number_of_parameters(relocation_type type)
        case RT_THIS:
        case RT_STACK_CHAIN:
        case RT_MEGAMORPHIC_CACHE_HITS:
+       case RT_VM:
                return 0;
        default:
                critical_error("Bad rel type",type);
@@ -186,6 +187,8 @@ cell factorvm::compute_relocation(relocation_entry rel, cell index, code_block *
                return untag_fixnum(ARG);
        case RT_MEGAMORPHIC_CACHE_HITS:
                return (cell)&megamorphic_cache_hits;
+       case RT_VM:
+               return (cell)this;
        default:
                critical_error("Bad rel type",rel);
                return 0; /* Can't happen */
index 60046ed380e91bd071b33604517da2c2f055082c..50d937f4afcdf11b3244f0b11b80377622dc61eb 100644 (file)
@@ -26,6 +26,8 @@ enum relocation_type {
        RT_UNTAGGED,
        /* address of megamorphic_cache_hits var */
        RT_MEGAMORPHIC_CACHE_HITS,
+       /* address of vm object*/
+       RT_VM,
 };
 
 enum relocation_class {
index bf60d1e4f6c533322a664b77d0ed5b5a0481aee6..c5c14e6999e3e9f0e3a7b30085878a5af2e44174 100755 (executable)
@@ -35,8 +35,8 @@
 
 /* Factor headers */
 #include "layouts.hpp"
-#include "platform.hpp"
 #include "primitives.hpp"
+#include "platform.hpp"
 #include "stacks.hpp"
 #include "segments.hpp"
 #include "contexts.hpp"