/[dynamips]/upstream/dynamips-0.2.6-RC1/mips64_jit.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /upstream/dynamips-0.2.6-RC1/mips64_jit.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.5/mips64_jit.c revision 1 by dpavlin, Sat Oct 6 16:01:44 2007 UTC upstream/dynamips-0.2.6-RC1/mips64_jit.c revision 2 by dpavlin, Sat Oct 6 16:03:58 2007 UTC
# Line 660  int insn_block_local_addr(insn_block_t * Line 660  int insn_block_local_addr(insn_block_t *
660     return(0);     return(0);
661  }  }
662    
663    /* Check if PC register matches the compiled block virtual address */
664    static forced_inline int insn_block_match(cpu_mips_t *cpu,insn_block_t *block)
665    {
666       m_uint64_t vpage;
667    
668       vpage = cpu->pc & ~(m_uint64_t)MIPS_MIN_PAGE_IMASK;
669       return(block->start_pc == vpage);
670    }
671    
672  /* Execute a compiled MIPS code */  /* Execute a compiled MIPS code */
673  void *insn_block_execute(cpu_mips_t *cpu)  void *insn_block_execute(cpu_mips_t *cpu)
674  {    {  
# Line 681  void *insn_block_execute(cpu_mips_t *cpu Line 690  void *insn_block_execute(cpu_mips_t *cpu
690     cpu->cpu_thread_running = TRUE;     cpu->cpu_thread_running = TRUE;
691   start_cpu:     start_cpu:  
692     for(;;) {     for(;;) {
693        if (unlikely(!cpu->pc) || unlikely(cpu->state != MIPS_CPU_RUNNING))        if (unlikely(cpu->state != MIPS_CPU_RUNNING))
694           break;           break;
695    
696        /* Handle virtual idle loop */        /* Handle virtual idle loop */
# Line 714  void *insn_block_execute(cpu_mips_t *cpu Line 723  void *insn_block_execute(cpu_mips_t *cpu
723        block = cpu->exec_phys_map[phys_page];        block = cpu->exec_phys_map[phys_page];
724    
725        /* No block found, compile the page */        /* No block found, compile the page */
726        if (unlikely(!block)) {        if (unlikely(!block) || unlikely(!insn_block_match(cpu,block)))
727          {
728             if (block != NULL) {
729                insn_block_free(cpu,block,TRUE);
730                cpu->exec_phys_map[phys_page] = NULL;
731             }
732    
733           block = insn_page_compile(cpu,cpu->pc);           block = insn_page_compile(cpu,cpu->pc);
734           if (unlikely(!block)) {           if (unlikely(!block)) {
735              fprintf(stderr,              fprintf(stderr,

Legend:
Removed from v.1  
changed lines
  Added in v.2

  ViewVC Help
Powered by ViewVC 1.1.26