Simplify awk scripts, fix comments and signatures.
parent
29b53b1fad
commit
e96220a96f
|
@ -129,7 +129,7 @@ ENDIF
|
|||
pop r10
|
||||
pop r11
|
||||
pop rbp
|
||||
; Restore Caml_state_young_ptr, caml_exception_pointer
|
||||
; Restore Caml_state(young_ptr)
|
||||
Load_young_ptr r15
|
||||
; Return to caller
|
||||
ret
|
||||
|
@ -310,7 +310,7 @@ IFDEF WITH_SPACETIME
|
|||
pop rbx
|
||||
pop rax
|
||||
ENDIF
|
||||
; Setup alloc ptr and exception ptr
|
||||
; Setup alloc ptr
|
||||
Load_young_ptr r15
|
||||
; Build an exception handler
|
||||
lea r13, L108
|
||||
|
|
|
@ -394,7 +394,7 @@ FUNCTION(caml_raise_exception)
|
|||
mov domain_state_ptr, r0
|
||||
/* Load exception bucket */
|
||||
mov r0, r1
|
||||
/* Reload trap ptr, alloc ptr and alloc limit */
|
||||
/* Reload trap ptr and alloc ptr */
|
||||
ldr trap_ptr, Caml_state(exception_pointer)
|
||||
ldr alloc_ptr, Caml_state(young_ptr)
|
||||
/* Test if backtrace is active */
|
||||
|
|
|
@ -354,11 +354,10 @@ struct caml__roots_block {
|
|||
|
||||
#define CAMLxparam1(x) \
|
||||
struct caml__roots_block caml__roots_##x; \
|
||||
caml_domain_state* domain_state_##x = Caml_state; \
|
||||
CAMLunused_start int caml__dummy_##x = ( \
|
||||
(void) caml__frame, \
|
||||
(caml__roots_##x.next = domain_state_##x->local_roots), \
|
||||
(domain_state_##x->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.next = Caml_state->local_roots), \
|
||||
(Caml_state->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.nitems = 1), \
|
||||
(caml__roots_##x.ntables = 1), \
|
||||
(caml__roots_##x.tables [0] = &x), \
|
||||
|
@ -367,11 +366,10 @@ struct caml__roots_block {
|
|||
|
||||
#define CAMLxparam2(x, y) \
|
||||
struct caml__roots_block caml__roots_##x; \
|
||||
caml_domain_state* domain_state_##x = Caml_state; \
|
||||
CAMLunused_start int caml__dummy_##x = ( \
|
||||
(void) caml__frame, \
|
||||
(caml__roots_##x.next = domain_state_##x->local_roots), \
|
||||
(domain_state_##x->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.next = Caml_state->local_roots), \
|
||||
(Caml_state->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.nitems = 1), \
|
||||
(caml__roots_##x.ntables = 2), \
|
||||
(caml__roots_##x.tables [0] = &x), \
|
||||
|
@ -381,11 +379,10 @@ struct caml__roots_block {
|
|||
|
||||
#define CAMLxparam3(x, y, z) \
|
||||
struct caml__roots_block caml__roots_##x; \
|
||||
caml_domain_state* domain_state_##x = Caml_state; \
|
||||
CAMLunused_start int caml__dummy_##x = ( \
|
||||
(void) caml__frame, \
|
||||
(caml__roots_##x.next = domain_state_##x->local_roots), \
|
||||
(domain_state_##x->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.next = Caml_state->local_roots), \
|
||||
(Caml_state->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.nitems = 1), \
|
||||
(caml__roots_##x.ntables = 3), \
|
||||
(caml__roots_##x.tables [0] = &x), \
|
||||
|
@ -396,11 +393,10 @@ struct caml__roots_block {
|
|||
|
||||
#define CAMLxparam4(x, y, z, t) \
|
||||
struct caml__roots_block caml__roots_##x; \
|
||||
caml_domain_state* domain_state_##x = Caml_state; \
|
||||
CAMLunused_start int caml__dummy_##x = ( \
|
||||
(void) caml__frame, \
|
||||
(caml__roots_##x.next = domain_state_##x->local_roots), \
|
||||
(domain_state_##x->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.next = Caml_state->local_roots), \
|
||||
(Caml_state->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.nitems = 1), \
|
||||
(caml__roots_##x.ntables = 4), \
|
||||
(caml__roots_##x.tables [0] = &x), \
|
||||
|
@ -412,11 +408,10 @@ struct caml__roots_block {
|
|||
|
||||
#define CAMLxparam5(x, y, z, t, u) \
|
||||
struct caml__roots_block caml__roots_##x; \
|
||||
caml_domain_state* domain_state_##x = Caml_state; \
|
||||
CAMLunused_start int caml__dummy_##x = ( \
|
||||
(void) caml__frame, \
|
||||
(caml__roots_##x.next = domain_state_##x->local_roots), \
|
||||
(domain_state_##x->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.next = Caml_state->local_roots), \
|
||||
(Caml_state->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.nitems = 1), \
|
||||
(caml__roots_##x.ntables = 5), \
|
||||
(caml__roots_##x.tables [0] = &x), \
|
||||
|
@ -429,11 +424,10 @@ struct caml__roots_block {
|
|||
|
||||
#define CAMLxparamN(x, size) \
|
||||
struct caml__roots_block caml__roots_##x; \
|
||||
caml_domain_state* domain_state_##x = Caml_state; \
|
||||
CAMLunused_start int caml__dummy_##x = ( \
|
||||
(void) caml__frame, \
|
||||
(caml__roots_##x.next = domain_state_##x->local_roots), \
|
||||
(domain_state_##x->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.next = Caml_state->local_roots), \
|
||||
(Caml_state->local_roots = &caml__roots_##x), \
|
||||
(caml__roots_##x.nitems = (size)), \
|
||||
(caml__roots_##x.ntables = 1), \
|
||||
(caml__roots_##x.tables[0] = &(x[0])), \
|
||||
|
@ -518,18 +512,16 @@ struct caml__roots_block {
|
|||
|
||||
#define Begin_roots1(r0) { \
|
||||
struct caml__roots_block caml__roots_block; \
|
||||
caml_domain_state* domain_state = Caml_state; \
|
||||
caml__roots_block.next = domain_state->local_roots; \
|
||||
domain_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.next = Caml_state->local_roots; \
|
||||
Caml_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.nitems = 1; \
|
||||
caml__roots_block.ntables = 1; \
|
||||
caml__roots_block.tables[0] = &(r0);
|
||||
|
||||
#define Begin_roots2(r0, r1) { \
|
||||
struct caml__roots_block caml__roots_block; \
|
||||
caml_domain_state* domain_state = Caml_state; \
|
||||
caml__roots_block.next = domain_state->local_roots; \
|
||||
domain_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.next = Caml_state->local_roots; \
|
||||
Caml_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.nitems = 1; \
|
||||
caml__roots_block.ntables = 2; \
|
||||
caml__roots_block.tables[0] = &(r0); \
|
||||
|
@ -537,9 +529,8 @@ struct caml__roots_block {
|
|||
|
||||
#define Begin_roots3(r0, r1, r2) { \
|
||||
struct caml__roots_block caml__roots_block; \
|
||||
caml_domain_state* domain_state = Caml_state; \
|
||||
caml__roots_block.next = domain_state->local_roots; \
|
||||
domain_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.next = Caml_state->local_roots; \
|
||||
Caml_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.nitems = 1; \
|
||||
caml__roots_block.ntables = 3; \
|
||||
caml__roots_block.tables[0] = &(r0); \
|
||||
|
@ -548,9 +539,8 @@ struct caml__roots_block {
|
|||
|
||||
#define Begin_roots4(r0, r1, r2, r3) { \
|
||||
struct caml__roots_block caml__roots_block; \
|
||||
caml_domain_state* domain_state = Caml_state; \
|
||||
caml__roots_block.next = domain_state->local_roots; \
|
||||
domain_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.next = Caml_state->local_roots; \
|
||||
Caml_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.nitems = 1; \
|
||||
caml__roots_block.ntables = 4; \
|
||||
caml__roots_block.tables[0] = &(r0); \
|
||||
|
@ -560,9 +550,8 @@ struct caml__roots_block {
|
|||
|
||||
#define Begin_roots5(r0, r1, r2, r3, r4) { \
|
||||
struct caml__roots_block caml__roots_block; \
|
||||
caml_domain_state* domain_state = Caml_state; \
|
||||
caml__roots_block.next = domain_state->local_roots; \
|
||||
domain_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.next = Caml_state->local_roots; \
|
||||
Caml_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.nitems = 1; \
|
||||
caml__roots_block.ntables = 5; \
|
||||
caml__roots_block.tables[0] = &(r0); \
|
||||
|
@ -573,9 +562,8 @@ struct caml__roots_block {
|
|||
|
||||
#define Begin_roots_block(table, size) { \
|
||||
struct caml__roots_block caml__roots_block; \
|
||||
caml_domain_state* domain_state = Caml_state; \
|
||||
caml__roots_block.next = domain_state->local_roots; \
|
||||
domain_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.next = Caml_state->local_roots; \
|
||||
Caml_state->local_roots = &caml__roots_block; \
|
||||
caml__roots_block.nitems = (size); \
|
||||
caml__roots_block.ntables = 1; \
|
||||
caml__roots_block.tables[0] = (table);
|
||||
|
|
|
@ -510,7 +510,7 @@ int caml_find_code_fragment(char *pc, int *index, struct code_fragment **cf);
|
|||
* [caml_backtrace_buffer]. In bytecode, it is the same as a
|
||||
* [code_t], in native code it as a [frame_descr *]. The difference
|
||||
* doesn't matter for code outside [backtrace_{byt,nat}.c],
|
||||
* so it is just exposed as a [backtrace_slot].
|
||||
* so it is just exposed as a [void *].
|
||||
*/
|
||||
typedef void * backtrace_slot;
|
||||
|
||||
|
|
|
@ -12,25 +12,25 @@
|
|||
#* *
|
||||
#**************************************************************************
|
||||
|
||||
BEGIN{FS=",";count=0};
|
||||
BEGIN{FS="[,)] *";count=0};
|
||||
/DOMAIN_STATE/{
|
||||
print "Store_" substr($2,2,length($2)-2) " MACRO reg1, reg2";
|
||||
print "Store_" $2 " MACRO reg1, reg2";
|
||||
print " mov [reg1+" count "], reg2";
|
||||
print "ENDM";
|
||||
print "Load_" substr($2,2,length($2)-2) " MACRO reg1, reg2";
|
||||
print "Load_" $2 " MACRO reg1, reg2";
|
||||
print " mov reg2, [reg1+" count "]";
|
||||
print "ENDM";
|
||||
print "Push_" substr($2,2, length($2)-2) " MACRO reg1";
|
||||
print " push [reg1+ " count "]";
|
||||
print "Push_" $2 " MACRO reg1";
|
||||
print " push [reg1+" count "]";
|
||||
print "ENDM";
|
||||
print "Pop_" substr($2, 2, length($2)-2) " MACRO reg1";
|
||||
print " pop [reg1+ " count "]";
|
||||
print "Pop_" $2 " MACRO reg1";
|
||||
print " pop [reg1+" count "]";
|
||||
print "ENDM";
|
||||
print "Cmp_" substr($2, 2, length($2)-2) " MACRO reg1, reg2";
|
||||
print " cmp reg2, [reg1+ " count "]";
|
||||
print "Cmp_" $2 " MACRO reg1, reg2";
|
||||
print " cmp reg2, [reg1+" count "]";
|
||||
print "ENDM";
|
||||
print "Sub_" substr($2, 2, length($2)-2) " MACRO reg1, reg2";
|
||||
print " sub reg2, [reg1+ " count "]";
|
||||
print "Sub_" $2 " MACRO reg1, reg2";
|
||||
print " sub reg2, [reg1+" count "]";
|
||||
print "ENDM";
|
||||
count+=8
|
||||
}
|
||||
|
|
|
@ -12,22 +12,22 @@
|
|||
#* *
|
||||
#**************************************************************************
|
||||
|
||||
BEGIN{FS=",";count=0};
|
||||
BEGIN{FS="[,)] *";count=0};
|
||||
/DOMAIN_STATE/{
|
||||
print "Store_" substr($2,2,length($2)-2) " MACRO reg";
|
||||
print "Store_" $2 " MACRO reg";
|
||||
print " mov [r14+" count "], reg";
|
||||
print "ENDM";
|
||||
print "Load_" substr($2,2,length($2)-2) " MACRO reg";
|
||||
print "Load_" $2 " MACRO reg";
|
||||
print " mov reg, [r14+" count "]";
|
||||
print "ENDM";
|
||||
print "Push_" substr($2,2, length($2)-2) " MACRO";
|
||||
print " push [r14 + " count "]";
|
||||
print "Push_" $2 " MACRO";
|
||||
print " push [r14+" count "]";
|
||||
print "ENDM";
|
||||
print "Pop_" substr($2, 2, length($2)-2) " MACRO";
|
||||
print " pop [r14 + " count "]";
|
||||
print "Pop_" $2 " MACRO";
|
||||
print " pop [r14+" count "]";
|
||||
print "ENDM";
|
||||
print "Cmp_" substr($2, 2, length($2)-2) " MACRO reg";
|
||||
print " cmp reg, [r14 + " count "]";
|
||||
print "Cmp_" $2 " MACRO reg";
|
||||
print " cmp reg, [r14+" count "]";
|
||||
print "ENDM";
|
||||
count+=8
|
||||
}
|
||||
|
|
|
@ -273,7 +273,6 @@ value caml_static_release_bytecode(value prog, value len)
|
|||
return Val_unit; /* not reached */
|
||||
}
|
||||
|
||||
int volatile caml_something_to_do;
|
||||
void (* volatile caml_async_action_hook)(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -207,7 +207,7 @@ static char sig_alt_stack[SIGSTKSZ];
|
|||
#endif
|
||||
|
||||
#ifdef RETURN_AFTER_STACK_OVERFLOW
|
||||
extern void caml_stack_overflow(void);
|
||||
extern void caml_stack_overflow(caml_domain_state*);
|
||||
#endif
|
||||
|
||||
DECLARE_SIGNAL_HANDLER(segv_handler)
|
||||
|
|
Loading…
Reference in New Issue