/[steeldump]/trunk/sb-heapdump/relocate.c
ViewVC logotype

Contents of /trunk/sb-heapdump/relocate.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 20 - (show annotations)
Sat Aug 25 21:10:48 2007 UTC (6 years, 7 months ago) by dlichteblau
File MIME type: text/plain
File size: 21682 byte(s)
update to SBCL 1.0.8.46
1 /* -*- indent-tabs-mode: nil -*- */
2
3 /* Copyright (c) 2006 David Lichteblau
4 * partly derived from SBCL source code (gc-common.c/gencgc.c)
5 *
6 * Tested on x86, x86-64, and PPC.
7 *
8 * When using this code to relocate memory not dumped by sb-heapdump,
9 * read the note in relocate_simple_vector.
10 */
11 /*
12 * Permission is hereby granted, free of charge, to any person
13 * obtaining a copy of this software and associated documentation files
14 * (the "Software"), to deal in the Software without restriction,
15 * including without limitation the rights to use, copy, modify, merge,
16 * publish, distribute, sublicense, and/or sell copies of the Software,
17 * and to permit persons to whom the Software is furnished to do so,
18 * subject to the following conditions:
19 *
20 * The above copyright notice and this permission notice shall be
21 * included in all copies or substantial portions of the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32 #include <unistd.h>
33 #include <stdio.h>
34 #include <errno.h>
35 #include "genesis/config.h"
36 #include "validate.h"
37 #include "gc.h"
38 #ifdef LISP_FEATURE_GENCGC
39 #include "gencgc-internal.h"
40 #else
41 #include "cheneygc-internal.h"
42 #endif
43 #include "gc-internal.h"
44 #include "generation.h"
45 #include "runtime.h"
46 #include "interr.h"
47 #include "genesis/fdefn.h"
48 #include "genesis/closure.h"
49 #include "genesis/instance.h"
50 #include "genesis/layout.h"
51 #include "genesis/code.h"
52 #include "genesis/simple-fun.h"
53 #include "genesis/vector.h"
54
55 /*
56 * stuff from src/runtime not declared in the official headers
57 */
58 #ifdef LISP_FEATURE_GENCGC
59 extern unsigned long bytes_allocated;
60 extern struct generation generations[NUM_GENERATIONS];
61 extern long large_object_size;
62 page_index_t gc_find_freeish_pages(long *, long, int);
63 #endif
64
65 /*
66 * our stuff
67 */
68 #define ALIGN(len) CEILING(len, 2)
69 #define RELOCATE_BOXED 0
70 #define RELOCATE_IMMEDIATE 0
71
72 #ifndef LISP_FEATURE_GENCGC
73 #define PAGE_BYTES 0x1000
74 #endif
75
76 struct relocator {
77 long *start;
78 long *end;
79 long displacement;
80 void *baseptr;
81 };
82
83 typedef long (*relocfn)(long *, struct relocator *);
84 static relocfn reloctab[256];
85
86 static int reloctab_initialized = 0;
87
88 static void relocate_init();
89 static void relocate(long *, long nwords, long *old_start, long displacement);
90 static void sub_relocate(long *ptr, long nwords, struct relocator *ctx);
91
92
93 /*
94 * heap file mapping
95 */
96 #ifdef LISP_FEATURE_GENCGC
97 static void
98 find_free_pages(long *start_page, long *end_page, long nbytes)
99 {
100 long los = large_object_size;
101
102 large_object_size = 0;
103 *end_page = 1 + gc_find_freeish_pages(start_page, nbytes, 0);
104 large_object_size = los;
105 }
106
107 /* FIXME: This used to be 2, which stopped working in SBCL 0.9.13.22
108 * (Gen. 6 also works, but 0 is arguable better than that.) */
109 #define GEN 0
110
111 void *
112 map_dumpfile(int fd, long offset, int verbose)
113 {
114 unsigned long length;
115 void *base = 0;
116 void *old_base;
117 long start_page, end_page;
118 long npages;
119 long i;
120
121 if (!reloctab_initialized) {
122 relocate_init();
123 reloctab_initialized = 1;
124 }
125
126 if (lseek(fd, offset, SEEK_SET) == -1) {
127 perror("lseek");
128 lose("map_dumpfile: cannot seek to segment");
129 }
130 if (read(fd, &old_base, sizeof(long)) != sizeof(long)
131 || read(fd, &length, sizeof(long)) != sizeof(long))
132 {
133 perror("read");
134 lose("map_dumpfile: cannot read header");
135 }
136 npages = (length + PAGE_BYTES - 1) / PAGE_BYTES;
137
138 if ( (start_page = find_page_index(old_base)) != -1) {
139 end_page = start_page + npages;
140 for (i = start_page; i < end_page; i++)
141 if (page_table[i].allocated != FREE_PAGE_FLAG)
142 break;
143 if (i == end_page)
144 base = old_base;
145 }
146 if (!base) {
147 find_free_pages(&start_page, &end_page, length);
148 base = page_address(start_page);
149 if (verbose) {
150 printf("\n; relocating heap file from 0x%08lx"
151 " to 0x%08lx\n",
152 (long) old_base,
153 (long) base);
154 fflush(stdout);
155 }
156 }
157
158 if (base != mmap(base,
159 length,
160 PROT_READ | PROT_WRITE,
161 MAP_FIXED | MAP_PRIVATE,
162 fd,
163 offset))
164 {
165 perror("mmap");
166 lose("map_dumpfile: cannot mmap heap file");
167 }
168 if (base != old_base)
169 relocate(base, length/N_WORD_BYTES, old_base, base-old_base);
170
171 os_protect(base,
172 npages * PAGE_BYTES,
173 #ifdef WRITE_PROTECT
174 OS_VM_PROT_READ | OS_VM_PROT_EXECUTE
175 #else
176 OS_VM_PROT_ALL | OS_VM_PROT_EXECUTE
177 #endif
178 );
179
180 for (i = 0; i < npages; i++) {
181 long page = start_page + i;
182 page_table[page].allocated = BOXED_PAGE_FLAG;
183 page_table[page].gen = GEN;
184 page_table[page].large_object = 0;
185 page_table[page].first_object_offset = -(PAGE_BYTES * i);
186 page_table[page].bytes_used = PAGE_BYTES;
187 #ifdef WRITE_PROTECT
188 page_table[page].write_protected = 1;
189 #else
190 page_table[page].write_protected = 0;
191 #endif
192 page_table[page].write_protected_cleared = 0;
193 page_table[page].dont_move = 0;
194 }
195 page_table[end_page - 1].bytes_used = length - PAGE_BYTES * (npages-1);
196 generations[GEN].bytes_allocated += length;
197 #if 0
198 /* fixme: do we need these? */
199 bytes_allocated += length;
200 generations[GEN].cum_sum_bytes_allocated += length;
201 #endif
202
203 if (last_free_page < end_page)
204 last_free_page = end_page;
205 SetSymbolValue(ALLOCATION_POINTER,
206 (lispobj)(((char *)DYNAMIC_SPACE_START)
207 + last_free_page*PAGE_BYTES),
208 0);
209
210 return base;
211 }
212 #else
213 void *
214 map_dumpfile(int fd, long offset, int verbose)
215 {
216 unsigned long length;
217 void *base;
218 void *old_base;
219
220 if (!reloctab_initialized) {
221 relocate_init();
222 reloctab_initialized = 1;
223 }
224
225 if (lseek(fd, offset, SEEK_SET) == -1) {
226 perror("lseek");
227 lose("map_dumpfile: cannot seek to segment");
228 }
229 if (read(fd, &old_base, sizeof(long)) != sizeof(long)
230 || read(fd, &length, sizeof(long)) != sizeof(long))
231 {
232 perror("read");
233 lose("map_dumpfile: cannot read header");
234 }
235
236 base = (void *) CEILING((long)dynamic_space_free_pointer, PAGE_BYTES);
237 dynamic_space_free_pointer = base + length;
238
239 if (base != mmap(base,
240 length,
241 PROT_READ | PROT_WRITE,
242 MAP_FIXED | MAP_PRIVATE,
243 fd,
244 offset))
245 {
246 perror("mmap");
247 lose("map_dumpfile: cannot mmap heap file");
248 }
249 if (verbose) {
250 printf("\n; relocating heap file from 0x%08lx to 0x%08lx\n",
251 (long) old_base,
252 (long) base);
253 fflush(stdout);
254 }
255 relocate(base, length/N_WORD_BYTES, old_base, base-old_base);
256
257 os_flush_icache((os_vm_address_t) base, length);
258
259 return base;
260 }
261 #endif
262
263 long
264 relocate_dumpfile(int fd, long offset, long *new_base)
265 {
266 long length;
267 void *tmp;
268 long *old_base;
269 long displacement;
270
271 if (!reloctab_initialized) {
272 relocate_init();
273 reloctab_initialized = 1;
274 }
275
276 if (lseek(fd, offset, SEEK_SET) == -1) {
277 perror("lseek");
278 lose("map_dumpfile: cannot seek to segment");
279 }
280 if (read(fd, &old_base, sizeof(long)) != sizeof(long)
281 || read(fd, &length, sizeof(long)) != sizeof(long))
282 {
283 perror("read");
284 lose("relocate_dumpfile: cannot read header");
285 }
286
287 tmp = mmap(0, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset);
288 if (tmp == MAP_FAILED) {
289 perror("mmap");
290 lose("relocate_dumpfile: cannot map heap file");
291 }
292 #ifdef LISP_FEATURE_GENCGC
293 if ((long) tmp % PAGE_BYTES != 0)
294 lose("relocate_dumpfile: bad base address");
295 #endif
296
297 displacement = (void *) new_base - (void *) old_base;
298 relocate(tmp, length/N_WORD_BYTES, old_base, displacement);
299 *((long **) tmp) = new_base;
300
301 if (munmap(tmp, length) == -1) {
302 perror("munmap");
303 lose("relocate_dumpfile: cannot unmap heap file");
304 }
305 return length;
306 }
307
308
309 /*
310 * relocation
311 */
312 static void *
313 natify(lispobj thing, struct relocator *ctx)
314 {
315 /* Same as `native_pointer' if tempspace == newspace. Else,
316 * turn the result into a tempspace pointer.
317 * This is for relocate_dumpfile. */
318 void *old_start = (void *) ctx->start;
319 void *new_start = old_start + ctx->displacement;
320 void *ptr = native_pointer((long) thing);
321 long offset = ptr - new_start;
322 return (void *) ctx->baseptr + offset;
323 }
324
325 #ifdef LISP_FEATURE_X86
326 static void *
327 oldify(void *ptr, struct relocator *ctx)
328 {
329 return (void *) ctx->start + (ptr - (void *) ctx->baseptr);
330 }
331 #endif
332
333 static void
334 relocate(long *ptr, long nwords, long *old_start, long displacement)
335 {
336 struct relocator ctx;
337
338 ctx.baseptr = ptr;
339 ctx.start = old_start;
340 ctx.end = old_start + nwords;
341 ctx.displacement = displacement;
342
343 sub_relocate(ptr, nwords, &ctx);
344 }
345
346 static void
347 sub_relocate(long *ptr, long nwords, struct relocator *ctx)
348 {
349 long *p;
350 long *q = ptr + nwords;
351 long nrelocated;
352
353 for (p = ptr; p < q; p += nrelocated) {
354 long word = *p;
355 if (is_lisp_pointer(word)) {
356 long *address = (long *) native_pointer(word);
357 if (ctx->start <= address && address < ctx->end)
358 *p += ctx->displacement;
359 nrelocated = 1;
360 } else {
361 relocfn fn = reloctab[widetag_of(word)];
362 if (fn)
363 nrelocated = fn(p, ctx);
364 else
365 nrelocated = 1;
366 }
367 }
368 }
369
370 static long
371 relocate_lose(long *ptr, struct relocator *ctx)
372 {
373 lose("no relocation function for header 0x%08x at 0x%08x\n",
374 *ptr, ptr);
375 return 0;
376 }
377
378 static long
379 relocate_unboxed(long *ptr, struct relocator *ctx)
380 {
381 return ALIGN(HeaderValue(*ptr) + 1);
382 }
383
384 static long
385 relocate_raw_vector(long *ptr, struct relocator *ctx)
386 {
387 return sizetab[widetag_of(*ptr)]((void *) ptr);
388 }
389
390 static long
391 relocate_simple_vector(long *ptr, struct relocator *ctx)
392 {
393 /* note: we leave the simple vector header as-is, assuming that
394 * the dumper has marked hash tables needing a re-hash already.
395 * If using the relocation routine is to be used for pages not
396 * written by sb-heapdump, at least replace
397 * vector-valid-hashing-subtype with
398 * sb-vm:vector-must-rehash-subtype here. */
399 return 2;
400 }
401
402 static long
403 relocate_fdefn(long *ptr, struct relocator *ctx)
404 {
405 struct fdefn *fdefn = (struct fdefn *) ptr;
406 char *nontramp_raw_addr = (char *) fdefn->fun + FUN_RAW_ADDR_OFFSET;
407
408 sub_relocate(ptr + 1, 2, ctx);
409 if (fdefn->raw_addr == nontramp_raw_addr)
410 fdefn->raw_addr = (char *)(fdefn->fun + FUN_RAW_ADDR_OFFSET);
411 return sizeof(struct fdefn) / sizeof(lispobj);
412 }
413
414 #if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
415 static long
416 relocate_closure_header(long *ptr, struct relocator *ctx)
417 {
418 struct closure *closure = (struct closure *) ptr;
419 long fun = (long) closure->fun - FUN_RAW_ADDR_OFFSET;
420 sub_relocate(&fun, 1, ctx);
421 closure->fun = fun + FUN_RAW_ADDR_OFFSET;
422 return 2;
423 }
424 #endif
425
426 static long
427 relocate_instance(long *ptr, struct relocator *ctx)
428 {
429 lispobj nuntagged;
430 struct instance *instance = (struct instance *) ptr;
431 long ntotal = HeaderValue(*ptr);
432
433 sub_relocate((long *) &instance->slots[0], 1, ctx);
434 if (fixnump(instance->slots[0]))
435 /* If the layout is a fixup, the dumper stores `nuntagged'
436 * here for us to find. */
437 nuntagged = instance->slots[0];
438 else {
439 struct layout *layout = natify(instance->slots[0], ctx);
440 nuntagged = layout->n_untagged_slots;
441 }
442
443 sub_relocate(ptr + 2, ntotal - fixnum_value(nuntagged) - 1, ctx);
444 return ntotal + 1;
445 }
446
447 static long
448 relocate_code_header(long *ptr, struct relocator *ctx)
449 {
450 long header = *ptr;
451 struct code *code = (struct code *) ptr;
452 long n_header_words = HeaderValue(header);
453 long n_code_words = fixnum_value(code->code_size);
454 long n_words = ALIGN(n_header_words + n_code_words);
455 lispobj ep;
456
457 sub_relocate(ptr + 1, n_header_words - 1, ctx);
458
459 ep = code->entry_points;
460 while (ep != NIL) {
461 struct simple_fun *fun = natify(ep, ctx);
462 #if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
463 fun->self = (long) ep + FUN_RAW_ADDR_OFFSET;
464 #else
465 fun->self = ep;
466 #endif
467 sub_relocate((void *) &fun->next, 1, ctx);
468 sub_relocate((void *) &fun->name, 1, ctx);
469 sub_relocate((void *) &fun->arglist, 1, ctx);
470 sub_relocate((void *) &fun->type, 1, ctx);
471 sub_relocate((void *) &fun->xrefs, 1, ctx);
472 ep = fun->next;
473 }
474
475 #ifdef LISP_FEATURE_X86
476 if (is_lisp_pointer(code->constants[0])) {
477 long word_displacement = ctx->displacement / N_WORD_BYTES;
478 char *code_start
479 = ((char *) code) + n_header_words * N_WORD_BYTES;
480 long *old_start = oldify(ptr, ctx);
481 long *old_end = old_start + n_words;
482
483 struct vector *fixups = natify(code->constants[0], ctx);
484 long n = fixnum_value(fixups->length);
485 long i;
486
487 for (i = 0; i < n; i++) {
488 unsigned long offset = fixups->data[i];
489 long **place = (long **) (code_start + offset);
490 long *old_value = *place;
491
492 if (old_start <= old_value && old_value < old_end)
493 *place = old_value + word_displacement;
494 else
495 *place = old_value - word_displacement;
496 }
497 }
498 #endif
499
500 return n_words;
501 }
502
503 void
504 relocate_init()
505 {
506 int i;
507
508 for (i = 0; i < ((sizeof reloctab)/(sizeof reloctab[0])); i++)
509 reloctab[i] = relocate_lose;
510
511 for (i = 0; i < (1<<(N_WIDETAG_BITS-N_LOWTAG_BITS)); i++) {
512 reloctab[EVEN_FIXNUM_LOWTAG|(i<<N_LOWTAG_BITS)]
513 = RELOCATE_IMMEDIATE;
514 reloctab[ODD_FIXNUM_LOWTAG|(i<<N_LOWTAG_BITS)]
515 = RELOCATE_IMMEDIATE;
516 }
517
518 reloctab[BIGNUM_WIDETAG] = relocate_unboxed;
519 reloctab[RATIO_WIDETAG] = RELOCATE_BOXED;
520 #if N_WORD_BITS == 64
521 reloctab[SINGLE_FLOAT_WIDETAG] = RELOCATE_IMMEDIATE;
522 #else
523 reloctab[SINGLE_FLOAT_WIDETAG] = relocate_unboxed;
524 #endif
525 reloctab[DOUBLE_FLOAT_WIDETAG] = relocate_unboxed;
526 #ifdef LONG_FLOAT_WIDETAG
527 reloctab[LONG_FLOAT_WIDETAG] = relocate_unboxed;
528 #endif
529 reloctab[COMPLEX_WIDETAG] = RELOCATE_BOXED;
530 #ifdef COMPLEX_SINGLE_FLOAT_WIDETAG
531 reloctab[COMPLEX_SINGLE_FLOAT_WIDETAG] = relocate_unboxed;
532 #endif
533 #ifdef COMPLEX_DOUBLE_FLOAT_WIDETAG
534 reloctab[COMPLEX_DOUBLE_FLOAT_WIDETAG] = relocate_unboxed;
535 #endif
536 #ifdef COMPLEX_LONG_FLOAT_WIDETAG
537 reloctab[COMPLEX_LONG_FLOAT_WIDETAG] = relocate_unboxed;
538 #endif
539 reloctab[SIMPLE_ARRAY_WIDETAG] = RELOCATE_BOXED;
540 reloctab[SIMPLE_BASE_STRING_WIDETAG] = relocate_raw_vector;
541 #ifdef SIMPLE_CHARACTER_STRING_WIDETAG
542 reloctab[SIMPLE_CHARACTER_STRING_WIDETAG] = relocate_raw_vector;
543 #endif
544 reloctab[SIMPLE_BIT_VECTOR_WIDETAG] = relocate_raw_vector;
545 reloctab[SIMPLE_VECTOR_WIDETAG] = relocate_simple_vector;
546 reloctab[SIMPLE_ARRAY_NIL_WIDETAG] = relocate_raw_vector;
547 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_2_WIDETAG] = relocate_raw_vector;
548 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG] = relocate_raw_vector;
549 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_7_WIDETAG] = relocate_raw_vector;
550 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_8_WIDETAG] = relocate_raw_vector;
551 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_15_WIDETAG] = relocate_raw_vector;
552 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_16_WIDETAG] = relocate_raw_vector;
553 #ifdef SIMPLE_ARRAY_UNSIGNED_BYTE_29_WIDETAG
554 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_29_WIDETAG] = relocate_raw_vector;
555 #endif
556 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_31_WIDETAG] = relocate_raw_vector;
557 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_32_WIDETAG] = relocate_raw_vector;
558 #ifdef SIMPLE_ARRAY_UNSIGNED_BYTE_60_WIDETAG
559 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_60_WIDETAG] = relocate_raw_vector;
560 #endif
561 #ifdef SIMPLE_ARRAY_UNSIGNED_BYTE_63_WIDETAG
562 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_63_WIDETAG] = relocate_raw_vector;
563 #endif
564 #ifdef SIMPLE_ARRAY_UNSIGNED_BYTE_64_WIDETAG
565 reloctab[SIMPLE_ARRAY_UNSIGNED_BYTE_64_WIDETAG] = relocate_raw_vector;
566 #endif
567 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_8_WIDETAG
568 reloctab[SIMPLE_ARRAY_SIGNED_BYTE_8_WIDETAG] = relocate_raw_vector;
569 #endif
570 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_16_WIDETAG
571 reloctab[SIMPLE_ARRAY_SIGNED_BYTE_16_WIDETAG] = relocate_raw_vector;
572 #endif
573 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_30_WIDETAG
574 reloctab[SIMPLE_ARRAY_SIGNED_BYTE_30_WIDETAG] = relocate_raw_vector;
575 #endif
576 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_32_WIDETAG
577 reloctab[SIMPLE_ARRAY_SIGNED_BYTE_32_WIDETAG] = relocate_raw_vector;
578 #endif
579 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_61_WIDETAG
580 reloctab[SIMPLE_ARRAY_SIGNED_BYTE_61_WIDETAG] = relocate_raw_vector;
581 #endif
582 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_64_WIDETAG
583 reloctab[SIMPLE_ARRAY_SIGNED_BYTE_64_WIDETAG] = relocate_raw_vector;
584 #endif
585 reloctab[SIMPLE_ARRAY_SINGLE_FLOAT_WIDETAG] = relocate_raw_vector;
586 reloctab[SIMPLE_ARRAY_DOUBLE_FLOAT_WIDETAG] = relocate_raw_vector;
587 #ifdef SIMPLE_ARRAY_LONG_FLOAT_WIDETAG
588 reloctab[SIMPLE_ARRAY_LONG_FLOAT_WIDETAG] = relocate_raw_vector;
589 #endif
590 #ifdef SIMPLE_ARRAY_COMPLEX_SINGLE_FLOAT_WIDETAG
591 reloctab[SIMPLE_ARRAY_COMPLEX_SINGLE_FLOAT_WIDETAG]
592 = relocate_raw_vector;
593 #endif
594 #ifdef SIMPLE_ARRAY_COMPLEX_DOUBLE_FLOAT_WIDETAG
595 reloctab[SIMPLE_ARRAY_COMPLEX_DOUBLE_FLOAT_WIDETAG]
596 = relocate_raw_vector;
597 #endif
598 #ifdef SIMPLE_ARRAY_COMPLEX_LONG_FLOAT_WIDETAG
599 reloctab[SIMPLE_ARRAY_COMPLEX_LONG_FLOAT_WIDETAG]
600 = relocate_raw_vector;
601 #endif
602 reloctab[COMPLEX_BASE_STRING_WIDETAG] = RELOCATE_BOXED;
603 #ifdef COMPLEX_CHARACTER_STRING_WIDETAG
604 reloctab[COMPLEX_CHARACTER_STRING_WIDETAG] = RELOCATE_BOXED;
605 #endif
606 reloctab[COMPLEX_VECTOR_NIL_WIDETAG] = RELOCATE_BOXED;
607 reloctab[COMPLEX_BIT_VECTOR_WIDETAG] = RELOCATE_BOXED;
608 reloctab[COMPLEX_VECTOR_WIDETAG] = RELOCATE_BOXED;
609 reloctab[COMPLEX_ARRAY_WIDETAG] = RELOCATE_BOXED;
610 reloctab[CODE_HEADER_WIDETAG] = relocate_code_header;
611 #ifndef LISP_FEATURE_GENCGC /* FIXME ..._X86 ? */
612 reloctab[SIMPLE_FUN_HEADER_WIDETAG] = relocate_lose;
613 reloctab[RETURN_PC_HEADER_WIDETAG] = relocate_lose;
614 #endif
615 reloctab[FUNCALLABLE_INSTANCE_HEADER_WIDETAG] = RELOCATE_BOXED;
616 #if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
617 reloctab[CLOSURE_HEADER_WIDETAG] = relocate_closure_header;
618 #else
619 reloctab[CLOSURE_HEADER_WIDETAG] = RELOCATE_BOXED;
620 #endif
621 reloctab[VALUE_CELL_HEADER_WIDETAG] = RELOCATE_BOXED;
622 reloctab[SYMBOL_HEADER_WIDETAG] = RELOCATE_BOXED;
623 reloctab[CHARACTER_WIDETAG] = RELOCATE_IMMEDIATE;
624 reloctab[SAP_WIDETAG] = relocate_unboxed;
625 reloctab[UNBOUND_MARKER_WIDETAG] = RELOCATE_IMMEDIATE;
626 reloctab[NO_TLS_VALUE_MARKER_WIDETAG] = RELOCATE_IMMEDIATE;
627 reloctab[WEAK_POINTER_WIDETAG] = RELOCATE_BOXED;
628 reloctab[INSTANCE_HEADER_WIDETAG] = relocate_instance;
629 #ifdef LISP_FEATURE_SPARC
630 reloctab[FDEFN_WIDETAG] = RELOCATE_BOXED;
631 #else
632 reloctab[FDEFN_WIDETAG] = relocate_fdefn;
633 #endif
634 }

  ViewVC Help
Powered by ViewVC 1.1.5