pike.git/
src/
builtin.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2017-11-18
2017-11-18 10:13:13 by Arne Goedeke <el@laramies.com>
b3de55707b1e8ddf87a7e0368b0999dfb242b9f5 (
76
lines) (+
59
/-
17
)
[
Show
|
Annotate
]
Branch:
arne/faster_calls_again
automap: use new callsite API
4438:
push_array(ret=allocate_array(size)); types = 0;
+
if (d != depth) {
for(x=0;x<size;x++) { for(e=0;e<args;e++)
4456:
} }
-
if(d == depth)
-
apply_svalue(fun,args);
-
else
+
low_automap(d+1,depth,fun,real_args,args); stack_pop_to_no_free (ITEM(ret) + x); types |= 1 << TYPEOF(ITEM(ret)[x]); }
-
+
} else if (TYPEOF(*fun) == T_INT) {
+
push_int(size);
+
f_allocate(1);
+
} else {
+
struct pike_callsite C;
+
callsite_init(&C);
+
callsite_set_args(&C, 0);
+
callsite_resolve_svalue(&C, fun);
+
callsite_prepare(&C);
+
/* We need to do this manually, because
+
* currently no arguments are on the stack, yet */
+
C.args = args;
+
if (C.frame) {
+
C.frame->args = args;
+
C.frame->flags |= PIKE_FRAME_NO_REUSE;
+
}
+
+
for(x=0;x<size;x++)
+
{
+
for(e=0;e<args;e++)
+
{
+
if(TYPEOF(real_args[e]) == T_OBJECT &&
+
real_args[e].u.object->prog == automap_marker_program &&
+
OBJ2_AUTOMAP_MARKER(real_args[e].u.object)->depth >= d)
+
{
+
#ifdef PIKE_DEBUG
+
if(x >= tmpargs[e].u.array->size)
+
Pike_fatal("low_automap failed to determine size!\n");
+
#endif
+
push_svalue(ITEM(tmpargs[e].u.array)+x);
+
}else{
+
push_svalue(tmpargs+e);
+
}
+
}
+
+
if (x) callsite_reset(&C);
+
callsite_execute(&C);
+
callsite_return(&C);
+
stack_pop_to_no_free (ITEM(ret) + x);
+
types |= 1 << TYPEOF(ITEM(ret)[x]);
+
}
+
callsite_free(&C);
+
}
ret->type_field = types; stack_unlink(args); }