pike.git/
src/
interpret_functions.h
Branch:
Tag:
Non-build tags
All tags
No tags
2001-03-09
2001-03-09 02:29:33 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
ee6846f7f87723be1fdf0241b81f2e2e72157650 (
75
lines) (+
36
/-
39
)
[
Show
|
Annotate
]
Branch:
7.9
some cleanup and optimization
Rev: src/interpret_functions.h:1.49
1:
/*
-
* $Id: interpret_functions.h,v 1.
48
2001/
02
/
24
02:
38
:
31
hubbe Exp $
+
* $Id: interpret_functions.h,v 1.
49
2001/
03
/
09
02:
29
:
33
hubbe Exp $
* * Opcode definitions for the interpreter. */
34:
BREAK; OPCODE1(F_CONSTANT,"constant")
-
assign
_svalue
_no_free
(
Pike_sp++,
& Pike_fp->context.prog->constants[arg1].sval);
+
push
_svalue(& Pike_fp->context.prog->constants[arg1].sval);
print_return_value(); BREAK;
187:
OPCODE1(F_MARK_AND_LOCAL, "mark & local") *(Pike_mark_sp++) = Pike_sp;
-
assign
_svalue
_no_free
(
Pike_sp++,
Pike_fp->locals + arg1);
+
push
_svalue( Pike_fp->locals + arg1);
print_return_value(); BREAK; OPCODE1(F_LOCAL, "local")
-
assign
_svalue
_no_free
(
Pike_sp++,
Pike_fp->locals + arg1);
+
push
_svalue( Pike_fp->locals + arg1);
print_return_value(); BREAK; OPCODE2(F_2_LOCALS, "2 locals")
-
assign
_svalue
_no_free
(
Pike_sp++,
Pike_fp->locals + arg1);
+
push
_svalue( Pike_fp->locals + arg1);
print_return_value();
-
assign
_svalue
_no_free
(
Pike_sp++,
Pike_fp->locals + arg2);
+
push
_svalue( Pike_fp->locals + arg2);
print_return_value(); BREAK;
323:
#endif /* AUTO_BIGNUM */ ) {
-
Pike_fp->locals[arg1].u.
integer++;
-
assign_svalue_no_free(Pike_sp++,Pike_fp->locals+arg1
);
+
push_int(++(
Pike_fp->locals[arg1].u.
integer
)
)
;
} else {
-
assign
_svalue
_no_free
(Pike_
sp++,Pike_
fp->locals+arg1);
+
push
_svalue(Pike_fp->locals+arg1);
push_int(1); f_add(2); assign_svalue(Pike_fp->locals+arg1,Pike_sp-1);
334:
BREAK; OPCODE1(F_POST_INC_LOCAL, "local++")
-
assign
_svalue
_no_free
(
Pike_sp++,
Pike_fp->locals + arg1);
+
push
_svalue( Pike_fp->locals + arg1);
+
if( (Pike_fp->locals[arg1].type == PIKE_T_INT) #ifdef AUTO_BIGNUM && (!INT_TYPE_ADD_OVERFLOW(Pike_fp->locals[arg1].u.integer, 1))
343:
{ Pike_fp->locals[arg1].u.integer++; } else {
-
assign
_svalue
_no_free
(Pike_
sp++, Pike_
fp->locals + arg1);
+
push
_svalue(Pike_fp->locals + arg1);
push_int(1); f_add(2);
-
assign
_
svalue
(Pike_fp->locals + arg1
, Pike_sp-1
);
-
pop_stack();
+
stack
_
pop_to
(Pike_fp->locals + arg1);
} BREAK;
360:
{ Pike_fp->locals[arg1].u.integer++; } else {
-
assign
_svalue
_no_free
(
Pike_sp++,
Pike_fp->locals + arg1);
+
push
_svalue( Pike_fp->locals + arg1);
push_int(1); f_add(2);
-
assign
_
svalue
(Pike_fp->locals + arg1
, Pike_sp-1
);
-
pop_stack();
+
stack
_
pop_to
(Pike_fp->locals + arg1);
} BREAK;
375:
#endif /* AUTO_BIGNUM */ ) {
-
Pike_fp->locals[arg1].u.integer
--;
-
assign_svalue_no_free(Pike_sp++,Pike_fp->locals+arg1
);
+
push_int(--(
Pike_fp->locals[arg1].u.integer)
)
;
} else {
-
assign
_svalue
_no_free
(Pike_
sp++,Pike_
fp->locals+arg1);
+
push
_svalue(Pike_fp->locals+arg1);
push_int(1); o_subtract(); assign_svalue(Pike_fp->locals+arg1,Pike_sp-1);
386:
BREAK; OPCODE1(F_POST_DEC_LOCAL, "local--")
-
assign
_svalue
_no_free
(
Pike_sp++,
Pike_fp->locals + arg1);
+
push
_svalue( Pike_fp->locals + arg1);
+
if( (Pike_fp->locals[arg1].type == PIKE_T_INT) #ifdef AUTO_BIGNUM && (!INT_TYPE_SUB_OVERFLOW(Pike_fp->locals[arg1].u.integer, 1))
395:
{ Pike_fp->locals[arg1].u.integer--; } else {
-
assign
_svalue
_no_free
(Pike_
sp++, Pike_
fp->locals + arg1);
+
push
_svalue(Pike_fp->locals + arg1);
push_int(1); o_subtract();
-
assign
_
svalue
(Pike_fp->locals + arg1
, Pike_sp-1
);
-
pop_stack();
+
stack
_
pop_to
(Pike_fp->locals + arg1);
} /* Pike_fp->locals[instr].u.integer--; */ BREAK;
413:
{ Pike_fp->locals[arg1].u.integer--; } else {
-
assign
_svalue
_no_free
(Pike_
sp++, Pike_
fp->locals + arg1);
+
push
_svalue(Pike_fp->locals + arg1);
push_int(1); o_subtract();
-
assign
_
svalue
(Pike_fp->locals + arg1
, Pike_sp-1
);
-
pop_stack();
+
stack
_
pop_to
(Pike_fp->locals + arg1);
} BREAK;
511:
{ instr=++ u->integer; pop_n_elems(2);
-
push_int(
u->integer
);
+
push_int(
instr
);
} else { lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++; push_int(1); f_add(2); assign_lvalue(Pike_sp-3, Pike_sp-1);
-
assign
_
svalue
(
Pike_sp-3, Pike_sp-1);
-
pop_n_elems(
2);
+
stack
_
unlink
(2);
} } BREAK;
534:
{ instr=-- u->integer; pop_n_elems(2);
-
push_int(
u->integer
);
+
push_int(
instr
);
} else { lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++; push_int(1); o_subtract(); assign_lvalue(Pike_sp-3, Pike_sp-1);
-
assign
_
svalue
(
Pike_sp-3, Pike_sp-1);
-
pop_n_elems(
2);
+
stack
_
unlink
(2);
} } BREAK;
555:
#endif ) {
-
instr=
-- u->integer;
+
-- u->integer;
pop_n_elems(2); }else{ lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;
602:
push_int(instr); } else { lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;
-
assign
_
svalue_no_free
(
Pike_sp,Pike_sp-1
);
Pike_sp++;
+
stack
_
dup
();
push_int(1); f_add(2); assign_lvalue(Pike_sp-4, Pike_sp-1);
-
assign
_
svalue
(
Pike_sp-4,
Pike
_
sp-
2);
-
pop
_
n
_
elems
(
3
);
+
pop
_
stack
(
);
+
stack
_
unlink(
2);
+
print
_
return
_
value
();
} } BREAK;
626:
push_int(instr); } else { lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;
-
assign
_
svalue_no_free
(
Pike_sp,Pike_sp-1
);
Pike_sp++;
+
stack
_
dup
();
push_int(1); o_subtract(); assign_lvalue(Pike_sp-4, Pike_sp-1);
-
assign
_
svalue
(
Pike_sp-4,
Pike
_
sp-
2);
-
pop
_
n
_
elems
(
3
);
+
pop
_
stack
(
);
+
stack
_
unlink(
2);
+
print
_
return
_
value
();
} } BREAK;