"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "sljit/sljitNativeSPARC_common.c" between
pcre-8.43.tar.bz2 and pcre-8.44.tar.bz2

About: The PCRE library implements Perl compatible regular expression pattern matching.

sljitNativeSPARC_common.c  (pcre-8.43.tar.bz2):sljitNativeSPARC_common.c  (pcre-8.44.tar.bz2)
skipping to change at line 301 skipping to change at line 301
} }
SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil er) SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil er)
{ {
struct sljit_memory_fragment *buf; struct sljit_memory_fragment *buf;
sljit_ins *code; sljit_ins *code;
sljit_ins *code_ptr; sljit_ins *code_ptr;
sljit_ins *buf_ptr; sljit_ins *buf_ptr;
sljit_ins *buf_end; sljit_ins *buf_end;
sljit_uw word_count; sljit_uw word_count;
sljit_uw next_addr;
sljit_sw executable_offset; sljit_sw executable_offset;
sljit_uw addr; sljit_uw addr;
struct sljit_label *label; struct sljit_label *label;
struct sljit_jump *jump; struct sljit_jump *jump;
struct sljit_const *const_; struct sljit_const *const_;
struct sljit_put_label *put_label;
CHECK_ERROR_PTR(); CHECK_ERROR_PTR();
CHECK_PTR(check_sljit_generate_code(compiler)); CHECK_PTR(check_sljit_generate_code(compiler));
reverse_buf(compiler); reverse_buf(compiler);
code = (sljit_ins*)SLJIT_MALLOC_EXEC(compiler->size * sizeof(sljit_ins)); code = (sljit_ins*)SLJIT_MALLOC_EXEC(compiler->size * sizeof(sljit_ins));
PTR_FAIL_WITH_EXEC_IF(code); PTR_FAIL_WITH_EXEC_IF(code);
buf = compiler->buf; buf = compiler->buf;
code_ptr = code; code_ptr = code;
word_count = 0; word_count = 0;
next_addr = 0;
executable_offset = SLJIT_EXEC_OFFSET(code); executable_offset = SLJIT_EXEC_OFFSET(code);
label = compiler->labels; label = compiler->labels;
jump = compiler->jumps; jump = compiler->jumps;
const_ = compiler->consts; const_ = compiler->consts;
put_label = compiler->put_labels;
do { do {
buf_ptr = (sljit_ins*)buf->memory; buf_ptr = (sljit_ins*)buf->memory;
buf_end = buf_ptr + (buf->used_size >> 2); buf_end = buf_ptr + (buf->used_size >> 2);
do { do {
*code_ptr = *buf_ptr++; *code_ptr = *buf_ptr++;
SLJIT_ASSERT(!label || label->size >= word_count); if (next_addr == word_count) {
SLJIT_ASSERT(!jump || jump->addr >= word_count); SLJIT_ASSERT(!label || label->size >= word_count)
SLJIT_ASSERT(!const_ || const_->addr >= word_count); ;
/* These structures are ordered by their address. */ SLJIT_ASSERT(!jump || jump->addr >= word_count);
if (label && label->size == word_count) { SLJIT_ASSERT(!const_ || const_->addr >= word_coun
/* Just recording the address. */ t);
label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(cod SLJIT_ASSERT(!put_label || put_label->addr >= wor
e_ptr, executable_offset); d_count);
label->size = code_ptr - code;
label = label->next; /* These structures are ordered by their address.
} */
if (jump && jump->addr == word_count) { if (label && label->size == word_count) {
/* Just recording the address. */
label->addr = (sljit_uw)SLJIT_ADD_EXEC_OF
FSET(code_ptr, executable_offset);
label->size = code_ptr - code;
label = label->next;
}
if (jump && jump->addr == word_count) {
#if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) #if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
jump->addr = (sljit_uw)(code_ptr - 3); jump->addr = (sljit_uw)(code_ptr - 3);
#else #else
jump->addr = (sljit_uw)(code_ptr - 6); jump->addr = (sljit_uw)(code_ptr - 6);
#endif #endif
code_ptr = detect_jump_type(jump, code_ptr, code, code_ptr = detect_jump_type(jump, code_pt
executable_offset); r, code, executable_offset);
jump = jump->next; jump = jump->next;
} }
if (const_ && const_->addr == word_count) { if (const_ && const_->addr == word_count) {
/* Just recording the address. */ /* Just recording the address. */
const_->addr = (sljit_uw)code_ptr; const_->addr = (sljit_uw)code_ptr;
const_ = const_->next; const_ = const_->next;
}
if (put_label && put_label->addr == word_count) {
SLJIT_ASSERT(put_label->label);
put_label->addr = (sljit_uw)code_ptr;
put_label = put_label->next;
}
next_addr = compute_next_addr(label, jump, const_
, put_label);
} }
code_ptr ++; code_ptr ++;
word_count ++; word_count ++;
} while (buf_ptr < buf_end); } while (buf_ptr < buf_end);
buf = buf->next; buf = buf->next;
} while (buf); } while (buf);
if (label && label->size == word_count) { if (label && label->size == word_count) {
label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executabl e_offset); label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executabl e_offset);
label->size = code_ptr - code; label->size = code_ptr - code;
label = label->next; label = label->next;
} }
SLJIT_ASSERT(!label); SLJIT_ASSERT(!label);
SLJIT_ASSERT(!jump); SLJIT_ASSERT(!jump);
SLJIT_ASSERT(!const_); SLJIT_ASSERT(!const_);
SLJIT_ASSERT(!put_label);
SLJIT_ASSERT(code_ptr - code <= (sljit_s32)compiler->size); SLJIT_ASSERT(code_ptr - code <= (sljit_s32)compiler->size);
jump = compiler->jumps; jump = compiler->jumps;
while (jump) { while (jump) {
do { do {
addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target; addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target;
buf_ptr = (sljit_ins *)jump->addr; buf_ptr = (sljit_ins *)jump->addr;
if (jump->flags & PATCH_CALL) { if (jump->flags & PATCH_CALL) {
addr = (sljit_sw)(addr - (sljit_uw)SLJIT_ADD_EXEC _OFFSET(buf_ptr, executable_offset)) >> 2; addr = (sljit_sw)(addr - (sljit_uw)SLJIT_ADD_EXEC _OFFSET(buf_ptr, executable_offset)) >> 2;
skipping to change at line 392 skipping to change at line 407
} }
if (jump->flags & PATCH_B) { if (jump->flags & PATCH_B) {
addr = (sljit_sw)(addr - (sljit_uw)SLJIT_ADD_EXEC _OFFSET(buf_ptr, executable_offset)) >> 2; addr = (sljit_sw)(addr - (sljit_uw)SLJIT_ADD_EXEC _OFFSET(buf_ptr, executable_offset)) >> 2;
SLJIT_ASSERT((sljit_sw)addr <= MAX_DISP && (sljit _sw)addr >= MIN_DISP); SLJIT_ASSERT((sljit_sw)addr <= MAX_DISP && (sljit _sw)addr >= MIN_DISP);
buf_ptr[0] = (buf_ptr[0] & ~DISP_MASK) | (addr & DISP_MASK); buf_ptr[0] = (buf_ptr[0] & ~DISP_MASK) | (addr & DISP_MASK);
break; break;
} }
/* Set the fields of immediate loads. */ /* Set the fields of immediate loads. */
#if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) #if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
buf_ptr[0] = (buf_ptr[0] & 0xffc00000) | ((addr >> 10) & SLJIT_ASSERT(((buf_ptr[0] & 0xc1cfffff) == 0x01000000) &&
0x3fffff); ((buf_ptr[1] & 0xc1f83fff) == 0x80102000));
buf_ptr[1] = (buf_ptr[1] & 0xfffffc00) | (addr & 0x3ff); buf_ptr[0] |= (addr >> 10) & 0x3fffff;
buf_ptr[1] |= addr & 0x3ff;
#else #else
#error "Implementation required" #error "Implementation required"
#endif #endif
} while (0); } while (0);
jump = jump->next; jump = jump->next;
} }
put_label = compiler->put_labels;
while (put_label) {
addr = put_label->label->addr;
buf_ptr = (sljit_ins *)put_label->addr;
#if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
SLJIT_ASSERT(((buf_ptr[0] & 0xc1cfffff) == 0x01000000) && ((buf_p
tr[1] & 0xc1f83fff) == 0x80102000));
buf_ptr[0] |= (addr >> 10) & 0x3fffff;
buf_ptr[1] |= addr & 0x3ff;
#else
#error "Implementation required"
#endif
put_label = put_label->next;
}
compiler->error = SLJIT_ERR_COMPILED; compiler->error = SLJIT_ERR_COMPILED;
compiler->executable_offset = executable_offset; compiler->executable_offset = executable_offset;
compiler->executable_size = (code_ptr - code) * sizeof(sljit_ins); compiler->executable_size = (code_ptr - code) * sizeof(sljit_ins);
code = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code, executable_offset); code = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code, executable_offset);
code_ptr = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset ); code_ptr = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset );
SLJIT_CACHE_FLUSH(code, code_ptr); SLJIT_CACHE_FLUSH(code, code_ptr);
return code; return code;
} }
skipping to change at line 1467 skipping to change at line 1498
#if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) #if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);; return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);;
#else #else
#error "Implementation required" #error "Implementation required"
#endif #endif
} }
SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi ler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value) SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi ler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value)
{ {
sljit_s32 reg;
struct sljit_const *const_; struct sljit_const *const_;
sljit_s32 dst_r;
CHECK_ERROR_PTR(); CHECK_ERROR_PTR();
CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value)); CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value));
ADJUST_LOCAL_OFFSET(dst, dstw); ADJUST_LOCAL_OFFSET(dst, dstw);
const_ = (struct sljit_const*)ensure_abuf(compiler, sizeof(struct sljit_c onst)); const_ = (struct sljit_const*)ensure_abuf(compiler, sizeof(struct sljit_c onst));
PTR_FAIL_IF(!const_); PTR_FAIL_IF(!const_);
set_const(const_, compiler); set_const(const_, compiler);
reg = FAST_IS_REG(dst) ? dst : TMP_REG2; dst_r = FAST_IS_REG(dst) ? dst : TMP_REG2;
PTR_FAIL_IF(emit_const(compiler, dst_r, init_value));
PTR_FAIL_IF(emit_const(compiler, reg, init_value));
if (dst & SLJIT_MEM) if (dst & SLJIT_MEM)
PTR_FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw) ); PTR_FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw) );
return const_; return const_;
} }
SLJIT_API_FUNC_ATTRIBUTE struct sljit_put_label* sljit_emit_put_label(struct slj
it_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
{
struct sljit_put_label *put_label;
sljit_s32 dst_r;
CHECK_ERROR_PTR();
CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw));
ADJUST_LOCAL_OFFSET(dst, dstw);
put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct
sljit_put_label));
PTR_FAIL_IF(!put_label);
set_put_label(put_label, compiler, 0);
dst_r = FAST_IS_REG(dst) ? dst : TMP_REG2;
PTR_FAIL_IF(emit_const(compiler, dst_r, 0));
if (dst & SLJIT_MEM)
PTR_FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw)
);
return put_label;
}
 End of changes. 15 change blocks. 
29 lines changed or deleted 65 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)