Lines Matching defs:state

80 			       struct traversal_state *state);
318 /* Handy state for the traversal functions. */
335 struct traversal_state *state = (struct traversal_state *)state_p;
337 ggc_pch_count_object (state->d, d->obj, d->size,
340 state->count++;
348 struct traversal_state *state = (struct traversal_state *)state_p;
350 d->new_addr = ggc_pch_alloc_object (state->d, d->obj, d->size,
353 state->ptrs[state->ptrs_i++] = d;
374 struct traversal_state *state ATTRIBUTE_UNUSED
389 struct traversal_state *state)
403 if (fwrite (&ptr, sizeof (void *), 1, state->f)
411 if (fwrite (&new_ptr->new_addr, sizeof (void *), 1, state->f)
427 /* Write out the state of the compiler to F. */
435 struct traversal_state state;
456 state.f = f;
457 state.d = init_ggc_pch();
458 state.count = 0;
459 htab_traverse (saving_htab, call_count, &state);
461 mmi.size = ggc_pch_total_size (state.d);
470 ggc_pch_this_base (state.d, mmi.preferred_base);
472 state.ptrs = XNEWVEC (struct ptr_data *, state.count);
473 state.ptrs_i = 0;
474 htab_traverse (saving_htab, call_alloc, &state);
475 qsort (state.ptrs, state.count, sizeof (*state.ptrs), compare_ptr_data);
484 write_pch_globals (gt_ggc_rtab, &state);
485 write_pch_globals (gt_pch_cache_rtab, &state);
491 o = ftell (state.f) + sizeof (mmi);
499 if (fwrite (&mmi, sizeof (mmi), 1, state.f) != 1)
502 && fseek (state.f, mmi.offset, SEEK_SET) != 0)
505 ggc_pch_prepare_write (state.d, state.f);
508 for (i = 0; i < state.count; i++)
510 if (this_object_size < state.ptrs[i]->size)
512 this_object_size = state.ptrs[i]->size;
515 memcpy (this_object, state.ptrs[i]->obj, state.ptrs[i]->size);
516 if (state.ptrs[i]->reorder_fn != NULL)
517 state.ptrs[i]->reorder_fn (state.ptrs[i]->obj,
518 state.ptrs[i]->note_ptr_cookie,
519 relocate_ptrs, &state);
520 state.ptrs[i]->note_ptr_fn (state.ptrs[i]->obj,
521 state.ptrs[i]->note_ptr_cookie,
522 relocate_ptrs, &state);
523 ggc_pch_write_object (state.d, state.f, state.ptrs[i]->obj,
524 state.ptrs[i]->new_addr, state.ptrs[i]->size,
525 state.ptrs[i]->note_ptr_fn == gt_pch_p_S);
526 if (state.ptrs[i]->note_ptr_fn != gt_pch_p_S)
527 memcpy (state.ptrs[i]->obj, this_object, state.ptrs[i]->size);
529 ggc_pch_finish (state.d, state.f);
532 free (state.ptrs);
536 /* Read the state of the compiler back in from F. */