Raymond Toy pushed to branch native-image at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/lisp/save.c
    ... ... @@ -27,6 +27,16 @@
    27 27
     #include "gencgc.h"
    
    28 28
     #endif
    
    29 29
     
    
    30
    +/*
    
    31
    + * Aargh!  Why is SPARC so different here?  What is the advantage of
    
    32
    + * making it different from all the other ports?
    
    33
    + */
    
    34
    +#if defined(sparc) || (defined(DARWIN) && defined(__ppc__))
    
    35
    +#define RAW_ADDR_OFFSET 0
    
    36
    +#else
    
    37
    +#define RAW_ADDR_OFFSET (6 * sizeof(lispobj) - type_FunctionPointer)
    
    38
    +#endif
    
    39
    +
    
    30 40
     /* Like (ceiling x y), but y is constrained to be a power of two */
    
    31 41
     #define CEILING(x,y) (((x) + ((y) - 1)) & (~((y) - 1)))
    
    32 42
     
    
    ... ... @@ -371,9 +381,13 @@ save_executable(char *filename, lispobj init_function)
    371 381
     #ifdef reg_ALLOC
    
    372 382
         write_space_object(dir_name, DYNAMIC_SPACE_ID, (os_vm_address_t)current_dynamic_space,
    
    373 383
                            (os_vm_address_t)current_dynamic_space_free_pointer);
    
    384
    +    write_asm_object(dir_name, DYNAMIC_SPACE_ID, (os_vm_address_t)current_dynamic_space,
    
    385
    +                     (os_vm_address_t)current_dynamic_space_free_pointer);
    
    374 386
     #else
    
    375 387
         write_space_object(dir_name, DYNAMIC_SPACE_ID, (os_vm_address_t)current_dynamic_space,
    
    376 388
                            (os_vm_address_t)SymbolValue(ALLOCATION_POINTER));
    
    389
    +    write_asm_object(dir_name, DYNAMIC_SPACE_ID, (os_vm_address_t)current_dynamic_space,
    
    390
    +                     (os_vm_address_t)SymbolValue(ALLOCATION_POINTER));
    
    377 391
     #endif
    
    378 392
     
    
    379 393
         printf("\tdone]\n");
    
    ... ... @@ -530,6 +544,14 @@ asm_fdefn(lispobj* ptr, lispobj object, FILE* f)
    530 544
         asm_lispobj(ptr + 1, ptr[1], f);
    
    531 545
         asm_lispobj(ptr + 2, ptr[2], f);
    
    532 546
     
    
    547
    +#if 0
    
    548
    +    struct fdefn* fdefn = (struct fdefn*) ptr;
    
    549
    +    
    
    550
    +    if (((char *) (fdefn->function + RAW_ADDR_OFFSET) != fdefn->raw_addr)) {
    
    551
    +        fprintf(f, "# Different!\n");
    
    552
    +    }
    
    553
    +#endif
    
    554
    +    
    
    533 555
         fprintf(f, "\t.4byte\tL%lx\t# raw_addr\n", (unsigned long) ptr[3]);
    
    534 556
     
    
    535 557
         return 4;
    
    ... ... @@ -678,6 +700,15 @@ asm_code_header(lispobj* ptr, lispobj object, FILE* f)
    678 700
     	fheaderl = fheaderp->next;
    
    679 701
         }
    
    680 702
     
    
    703
    +    {
    
    704
    +        uint32_t* code_data = (uint32_t*) fheaderp->code;
    
    705
    +            
    
    706
    +        for (k = 0; k < ncode_words; ++k) {
    
    707
    +            fprintf(f, "\t.4byte\t0x%08x\t# %p\n", code_data[k],
    
    708
    +                    fheaderp->code + 4*k);
    
    709
    +        }
    
    710
    +    }
    
    711
    +        
    
    681 712
         asm_align(f);
    
    682 713
         return nwords;
    
    683 714
     }