Changeset 11168


Ignore:
Timestamp:
Oct 18, 2008, 11:47:11 PM (11 years ago)
Author:
gb
Message:

check_all_areas() takes the current tcr as argument; checks exception
frames, tlb, etc. (New! Improved! Even slower!).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-gc.c

    r11087 r11168  
    221221}
    222222
    223 void
    224 check_all_areas()
     223#ifdef X8632
     224void
     225check_xp(ExceptionInformation *xp, natural node_regs_mask)
     226{
     227  natural *regs = (natural *) xpGPRvector(xp), dnode;
     228
     229  if (node_regs_mask & (1<<0)) check_node(regs[REG_EAX]);
     230  if (node_regs_mask & (1<<1)) check_node(regs[REG_ECX]);
     231  if (regs[REG_EFL] & EFL_DF) {
     232    /* DF set means EDX should be treated as an imm reg */
     233    ;
     234  } else
     235    if (node_regs_mask & (1<<2)) check_node(regs[REG_EDX]);
     236
     237  if (node_regs_mask & (1<<3)) check_node(regs[REG_EBX]);
     238  if (node_regs_mask & (1<<4)) check_node(regs[REG_ESP]);
     239  if (node_regs_mask & (1<<5)) check_node(regs[REG_EBP]);
     240  if (node_regs_mask & (1<<6)) check_node(regs[REG_ESI]);
     241  if (node_regs_mask & (1<<7)) check_node(regs[REG_EDI]);
     242}
     243#else
     244void
     245check_xp(ExceptionInformation *xp)
     246{
     247  natural *regs = (natural *) xpGPRvector(xp), dnode;
     248
     249  check_node(regs[Iarg_z]);
     250  check_node(regs[Iarg_y]);
     251  check_node(regs[Iarg_x]);
     252  check_node(regs[Isave3]);
     253  check_node(regs[Isave2]);
     254  check_node(regs[Isave1]);
     255  check_node(regs[Isave0]);
     256  check_node(regs[Ifn]);
     257  check_node(regs[Itemp0]);
     258  check_node(regs[Itemp1]);
     259  check_node(regs[Itemp2]);
     260}
     261#endif
     262
     263void
     264check_tcrs(TCR *first)
     265{
     266  xframe_list *xframes;
     267  ExceptionInformation *xp;
     268 
     269  TCR *tcr = first;
     270  LispObj *tlb_start,*tlb_end;
     271
     272  do {
     273    xp = tcr->gc_context;
     274    if (xp) {
     275#ifdef X8632
     276      check_xp(xp,tcr->node_regs_mask);
     277#else
     278      check_xp(xp);
     279#endif
     280    }
     281#ifdef X8632
     282    check_node(tcr->save0);
     283    check_node(tcr->save1);
     284    check_node(tcr->save2);
     285    check_node(tcr->save3);
     286    check_node(tcr->next_method_context);
     287#endif
     288    for (xframes = (xframe_list *) tcr->xframe;
     289         xframes;
     290         xframes = xframes->prev) {
     291#ifndef X8632
     292      check_xp(xframes->curr);
     293#else
     294      check_xp(xframes->curr, xframes->node_regs_mask);
     295#endif
     296    }
     297    tlb_start = tcr->tlb_pointer;
     298    if (tlb_start) {
     299      tlb_end = tlb_start + ((tcr->tlb_limit)>>fixnumshift);
     300      check_range(tlb_start,tlb_end,false);
     301    }
     302    tcr = tcr->next;
     303  } while (tcr != first);
     304}
     305
     306 
     307void
     308check_all_areas(TCR *tcr)
    225309{
    226310  area *a = active_dynamic_area;
     
    267351    code = (a->code);
    268352  }
     353
     354  check_tcrs(tcr);
    269355}
    270356
Note: See TracChangeset for help on using the changeset viewer.