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

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

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

revision 1505 by zherczeg, Mon Aug 11 06:42:28 2014 UTC revision 1506 by zherczeg, Sat Sep 27 06:25:26 2014 UTC
# Line 95  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 95  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
95          sljit_ub *inst;          sljit_ub *inst;
96    
97          CHECK_ERROR();          CHECK_ERROR();
98          check_sljit_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);          CHECK(check_sljit_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
99            set_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
100    
         compiler->options = options;  
         compiler->scratches = scratches;  
         compiler->saveds = saveds;  
         compiler->fscratches = fscratches;  
         compiler->fsaveds = fsaveds;  
101          compiler->flags_saved = 0;          compiler->flags_saved = 0;
 #if (defined SLJIT_DEBUG && SLJIT_DEBUG)  
         compiler->logical_local_size = local_size;  
 #endif  
102    
103          /* Including the return address saved by the call instruction. */          /* Including the return address saved by the call instruction. */
104          saved_register_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);          saved_register_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);
# Line 173  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 166  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
166  #endif  #endif
167          }          }
168    
169          local_size = ((local_size + FIXED_LOCALS_OFFSET + saved_register_size + 16 - 1) & ~(16 - 1)) - saved_register_size;          local_size = ((local_size + SLJIT_LOCALS_OFFSET + saved_register_size + 15) & ~15) - saved_register_size;
170          compiler->local_size = local_size;          compiler->local_size = local_size;
171    
172  #ifdef _WIN64  #ifdef _WIN64
# Line 201  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 194  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
194                  *inst++ = MOV_rm_i32;                  *inst++ = MOV_rm_i32;
195                  *inst++ = MOD_REG | reg_lmap[SLJIT_R0];                  *inst++ = MOD_REG | reg_lmap[SLJIT_R0];
196                  *(sljit_si*)inst = local_size;                  *(sljit_si*)inst = local_size;
197  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \
198                            || (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
199                  compiler->skip_checks = 1;                  compiler->skip_checks = 1;
200  #endif  #endif
201                  FAIL_IF(sljit_emit_ijump(compiler, SLJIT_CALL1, SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_grow_stack)));                  FAIL_IF(sljit_emit_ijump(compiler, SLJIT_CALL1, SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_grow_stack)));
# Line 243  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 237  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
237          return SLJIT_SUCCESS;          return SLJIT_SUCCESS;
238  }  }
239    
240  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_context(struct sljit_compiler *compiler,  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_set_context(struct sljit_compiler *compiler,
241          sljit_si options, sljit_si args, sljit_si scratches, sljit_si saveds,          sljit_si options, sljit_si args, sljit_si scratches, sljit_si saveds,
242          sljit_si fscratches, sljit_si fsaveds, sljit_si local_size)          sljit_si fscratches, sljit_si fsaveds, sljit_si local_size)
243  {  {
244          sljit_si saved_register_size;          sljit_si saved_register_size;
245    
246          CHECK_ERROR_VOID();          CHECK_ERROR();
247          check_sljit_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);          CHECK(check_sljit_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
248            set_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
         compiler->options = options;  
         compiler->scratches = scratches;  
         compiler->saveds = saveds;  
         compiler->fscratches = fscratches;  
         compiler->fsaveds = fsaveds;  
 #if (defined SLJIT_DEBUG && SLJIT_DEBUG)  
         compiler->logical_local_size = local_size;  
 #endif  
249    
250          /* Including the return address saved by the call instruction. */          /* Including the return address saved by the call instruction. */
251          saved_register_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);          saved_register_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);
252          compiler->local_size = ((local_size + FIXED_LOCALS_OFFSET + saved_register_size + 16 - 1) & ~(16 - 1)) - saved_register_size;          compiler->local_size = ((local_size + SLJIT_LOCALS_OFFSET + saved_register_size + 15) & ~15) - saved_register_size;
253            return SLJIT_SUCCESS;
254  }  }
255    
256  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_return(struct sljit_compiler *compiler, sljit_si op, sljit_si src, sljit_sw srcw)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_return(struct sljit_compiler *compiler, sljit_si op, sljit_si src, sljit_sw srcw)
# Line 272  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 259  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
259          sljit_ub *inst;          sljit_ub *inst;
260    
261          CHECK_ERROR();          CHECK_ERROR();
262          check_sljit_emit_return(compiler, op, src, srcw);          CHECK(check_sljit_emit_return(compiler, op, src, srcw));
263    
264          compiler->flags_saved = 0;          compiler->flags_saved = 0;
265          FAIL_IF(emit_mov_before_return(compiler, op, src, srcw));          FAIL_IF(emit_mov_before_return(compiler, op, src, srcw));
# Line 607  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 594  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
594          sljit_ub *inst;          sljit_ub *inst;
595    
596          CHECK_ERROR();          CHECK_ERROR();
597          check_sljit_emit_fast_enter(compiler, dst, dstw);          CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw));
598          ADJUST_LOCAL_OFFSET(dst, dstw);          ADJUST_LOCAL_OFFSET(dst, dstw);
599    
600          /* For UNUSED dst. Uncommon, but possible. */          /* For UNUSED dst. Uncommon, but possible. */
# Line 644  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 631  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
631          sljit_ub *inst;          sljit_ub *inst;
632    
633          CHECK_ERROR();          CHECK_ERROR();
634          check_sljit_emit_fast_return(compiler, src, srcw);          CHECK(check_sljit_emit_fast_return(compiler, src, srcw));
635          ADJUST_LOCAL_OFFSET(src, srcw);          ADJUST_LOCAL_OFFSET(src, srcw);
636    
637          if ((src & SLJIT_IMM) && NOT_HALFWORD(srcw)) {          if ((src & SLJIT_IMM) && NOT_HALFWORD(srcw)) {

Legend:
Removed from v.1505  
changed lines
  Added in v.1506

  ViewVC Help
Powered by ViewVC 1.1.5