Commit e5858b9e authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl

use get_desc_arity_offset abc instruction to compute descriptor adresses

parent 73cb9f73
......@@ -110,6 +110,11 @@ is_Array_D d = code inline {
eq_desc_b ARRAY 1
}
desc_arity_offset :: Int;
desc_arity_offset = code inline {
get_desc_arity_offset
}
get_D_name :: !Int -> {#Char};
get_D_name d = code {
.d 0 1 i
......@@ -641,7 +646,7 @@ lookup_symbol_value {di_prefix_arity_and_mod,di_name} mod_a symbols
| symbol_value== -1
= abort ("lookup_desc_info not found "+++symbol_name);
# arity = prefix_n - PREFIX_D;
= symbol_value+(arity<<3)+2;
= symbol_value+(arity*desc_arity_offset)+2;
lookup_symbol_values desc_info_a mod_a symbols
= {#lookup_symbol_value desc_info mod_a symbols \\ desc_info <-: desc_info_a};
......
......@@ -20,6 +20,11 @@ copy_to_string g = code {
.o 1 0
}
desc_arity_offset :: Int;
desc_arity_offset = code inline {
get_desc_arity_offset
}
get_D_from_string s i :== IF_INT_64_OR_32 (get_D_from_string_64 s i) (get_D_from_string_32 s i);
get_D_from_string_32 :: !{#Char} !Int -> Int;
......@@ -257,7 +262,7 @@ get_module d
| arity < 256
| is__Cons_D d
= 0;
| is__Tuple_D (d-arity*8)
| is__Tuple_D (d-arity*desc_arity_offset)
= 0;
= get_D_cons_module d;
= get_D_record_module d;
......@@ -462,7 +467,7 @@ info_of_desc_and_mod {desc,desc_mod_n} desc_tree
| arity < 256
| is__Cons_D desc
= ":";
| is__Tuple_D (desc-arity*8)
| is__Tuple_D (desc-arity*desc_arity_offset)
= {'t',arity_to_char arity};
= {'C',arity_to_char arity,arity_to_char (get_D_arity desc),toChar (desc_mod_n),toChar (desc_mod_n>>8)}
+++get_D_name desc+++"\0";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment