/[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 1492 by zherczeg, Mon Jul 7 07:11:16 2014 UTC revision 1493 by zherczeg, Wed Jul 9 04:41:15 2014 UTC
# Line 91  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 91  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
91          sljit_si args, sljit_si scratches, sljit_si saveds,          sljit_si args, sljit_si scratches, sljit_si saveds,
92          sljit_si fscratches, sljit_si fsaveds, sljit_si local_size)          sljit_si fscratches, sljit_si fsaveds, sljit_si local_size)
93  {  {
94          sljit_si i, tmp, size, allocated_size;          sljit_si i, tmp, size, saved_register_size;
95          sljit_ub *inst;          sljit_ub *inst;
96    
97          CHECK_ERROR();          CHECK_ERROR();
# Line 107  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 107  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
107  #endif  #endif
108    
109          /* Including the return address saved by the call instruction. */          /* Including the return address saved by the call instruction. */
110          allocated_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);          saved_register_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);
111    
112          tmp = saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - saveds) : SLJIT_FIRST_SAVED_REG;          tmp = saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - saveds) : SLJIT_FIRST_SAVED_REG;
113          for (i = SLJIT_S0; i >= tmp; i--) {          for (i = SLJIT_S0; i >= tmp; i--) {
# Line 172  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 172  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
172  #endif  #endif
173          }          }
174    
175          local_size = ((local_size + FIXED_LOCALS_OFFSET + allocated_size + 16 - 1) & ~(16 - 1)) - allocated_size;          local_size = ((local_size + FIXED_LOCALS_OFFSET + saved_register_size + 16 - 1) & ~(16 - 1)) - saved_register_size;
176          compiler->local_size = local_size;          compiler->local_size = local_size;
177    
178  #ifdef _WIN64  #ifdef _WIN64
# Line 185  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 185  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
185                  *inst++ = GROUP_BINARY_83;                  *inst++ = GROUP_BINARY_83;
186                  *inst++ = MOD_REG | SUB | 4;                  *inst++ = MOD_REG | SUB | 4;
187                  /* Allocated size for registers must be divisible by 8. */                  /* Allocated size for registers must be divisible by 8. */
188                  SLJIT_ASSERT(!(allocated_size & 0x7));                  SLJIT_ASSERT(!(saved_register_size & 0x7));
189                  /* Aligned to 16 byte. */                  /* Aligned to 16 byte. */
190                  if (allocated_size & 0x8) {                  if (saved_register_size & 0x8) {
191                          *inst++ = 5 * sizeof(sljit_sw);                          *inst++ = 5 * sizeof(sljit_sw);
192                          local_size -= 5 * sizeof(sljit_sw);                          local_size -= 5 * sizeof(sljit_sw);
193                  } else {                  } else {
# Line 246  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_ Line 246  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_
246          sljit_si args, sljit_si scratches, sljit_si saveds,          sljit_si args, sljit_si scratches, sljit_si saveds,
247          sljit_si fscratches, sljit_si fsaveds, sljit_si local_size)          sljit_si fscratches, sljit_si fsaveds, sljit_si local_size)
248  {  {
249          sljit_si allocated_size;          sljit_si saved_register_size;
250    
251          CHECK_ERROR_VOID();          CHECK_ERROR_VOID();
252          check_sljit_set_context(compiler, args, scratches, saveds, fscratches, fsaveds, local_size);          check_sljit_set_context(compiler, args, scratches, saveds, fscratches, fsaveds, local_size);
# Line 260  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_ Line 260  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_
260  #endif  #endif
261    
262          /* Including the return address saved by the call instruction. */          /* Including the return address saved by the call instruction. */
263          allocated_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);          saved_register_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);
264          compiler->local_size = ((local_size + FIXED_LOCALS_OFFSET + allocated_size + 16 - 1) & ~(16 - 1)) - allocated_size;          compiler->local_size = ((local_size + FIXED_LOCALS_OFFSET + saved_register_size + 16 - 1) & ~(16 - 1)) - saved_register_size;
265  }  }
266    
267  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)

Legend:
Removed from v.1492  
changed lines
  Added in v.1493

  ViewVC Help
Powered by ViewVC 1.1.5