/[pcre]/code/trunk/sljit/sljitNativeX86_common.c
ViewVC logotype

Diff of /code/trunk/sljit/sljitNativeX86_common.c

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

revision 740 by zherczeg, Mon Oct 31 06:10:14 2011 UTC revision 777 by zherczeg, Thu Dec 1 15:15:31 2011 UTC
# Line 357  SLJIT_API_FUNC_ATTRIBUTE void* sljit_gen Line 357  SLJIT_API_FUNC_ATTRIBUTE void* sljit_gen
357          while (jump) {          while (jump) {
358                  if (jump->flags & PATCH_MB) {                  if (jump->flags & PATCH_MB) {
359                          SLJIT_ASSERT((sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_b))) >= -128 && (sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_b))) <= 127);                          SLJIT_ASSERT((sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_b))) >= -128 && (sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_b))) <= 127);
360                          *(sljit_ub*)jump->addr = jump->u.label->addr - (jump->addr + sizeof(sljit_b));                          *(sljit_ub*)jump->addr = (sljit_ub)(jump->u.label->addr - (jump->addr + sizeof(sljit_b)));
361                  } else if (jump->flags & PATCH_MW) {                  } else if (jump->flags & PATCH_MW) {
362                          if (jump->flags & JUMP_LABEL) {                          if (jump->flags & JUMP_LABEL) {
363  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
364                                  *(sljit_w*)jump->addr = jump->u.label->addr - (jump->addr + sizeof(sljit_w));                                  *(sljit_w*)jump->addr = (sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_w)));
365  #else  #else
366                                  SLJIT_ASSERT((sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw))) >= -0x80000000ll && (sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw))) <= 0x7fffffffll);                                  SLJIT_ASSERT((sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw))) >= -0x80000000ll && (sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw))) <= 0x7fffffffll);
367                                  *(sljit_hw*)jump->addr = jump->u.label->addr - (jump->addr + sizeof(sljit_hw));                                  *(sljit_hw*)jump->addr = (sljit_hw)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw)));
368  #endif  #endif
369                          }                          }
370                          else {                          else {
371  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
372                                  *(sljit_w*)jump->addr = jump->u.target - (jump->addr + sizeof(sljit_w));                                  *(sljit_w*)jump->addr = (sljit_w)(jump->u.target - (jump->addr + sizeof(sljit_w)));
373  #else  #else
374                                  SLJIT_ASSERT((sljit_w)(jump->u.target - (jump->addr + sizeof(sljit_hw))) >= -0x80000000ll && (sljit_w)(jump->u.target - (jump->addr + sizeof(sljit_hw))) <= 0x7fffffffll);                                  SLJIT_ASSERT((sljit_w)(jump->u.target - (jump->addr + sizeof(sljit_hw))) >= -0x80000000ll && (sljit_w)(jump->u.target - (jump->addr + sizeof(sljit_hw))) <= 0x7fffffffll);
375                                  *(sljit_hw*)jump->addr = jump->u.target - (jump->addr + sizeof(sljit_hw));                                  *(sljit_hw*)jump->addr = (sljit_hw)(jump->u.target - (jump->addr + sizeof(sljit_hw)));
376  #endif  #endif
377                          }                          }
378                  }                  }
# Line 387  SLJIT_API_FUNC_ATTRIBUTE void* sljit_gen Line 387  SLJIT_API_FUNC_ATTRIBUTE void* sljit_gen
387          /* Maybe we waste some space because of short jumps. */          /* Maybe we waste some space because of short jumps. */
388          SLJIT_ASSERT(code_ptr <= code + compiler->size);          SLJIT_ASSERT(code_ptr <= code + compiler->size);
389          compiler->error = SLJIT_ERR_COMPILED;          compiler->error = SLJIT_ERR_COMPILED;
390            compiler->executable_size = compiler->size;
391          return (void*)code;          return (void*)code;
392  }  }
393    
# Line 1360  static int emit_mul(struct sljit_compile Line 1361  static int emit_mul(struct sljit_compile
1361                          code = (sljit_ub*)ensure_buf(compiler, 1 + 4);                          code = (sljit_ub*)ensure_buf(compiler, 1 + 4);
1362                          FAIL_IF(!code);                          FAIL_IF(!code);
1363                          INC_CSIZE(4);                          INC_CSIZE(4);
1364                          *(sljit_hw*)code = src1w;                          *(sljit_hw*)code = (sljit_hw)src1w;
1365                  }                  }
1366                  else {                  else {
1367                          EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src1w);                          EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src1w);
# Line 1403  static int emit_mul(struct sljit_compile Line 1404  static int emit_mul(struct sljit_compile
1404                          code = (sljit_ub*)ensure_buf(compiler, 1 + 4);                          code = (sljit_ub*)ensure_buf(compiler, 1 + 4);
1405                          FAIL_IF(!code);                          FAIL_IF(!code);
1406                          INC_CSIZE(4);                          INC_CSIZE(4);
1407                          *(sljit_hw*)code = src2w;                          *(sljit_hw*)code = (sljit_hw)src2w;
1408                  }                  }
1409                  else {                  else {
1410                          EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src1w);                          EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src1w);

Legend:
Removed from v.740  
changed lines
  Added in v.777

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12