search for: thisp

Displaying 20 results from an estimated 56 matches for "thisp".

Did you mean: this
2007 May 21
0
Branch 'as' - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c
...frame.c index 23b3c41..75e0534 100644 --- a/libswfdec/swfdec_as_frame.c +++ b/libswfdec/swfdec_as_frame.c @@ -68,7 +68,8 @@ swfdec_as_frame_mark (SwfdecAsObject *ob if (frame->script) { swfdec_as_object_mark (frame->var_object); } - swfdec_as_object_mark (frame->thisp); + if (frame->thisp) + swfdec_as_object_mark (frame->thisp); if (frame->target) swfdec_as_object_mark (frame->target); if (frame->function) @@ -76,7 +77,6 @@ swfdec_as_frame_mark (SwfdecAsObject *ob for (i = 0; i < frame->n_registers; i++) { swfdec_as_va...
2007 Nov 14
0
7 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_super.c libswfdec/swfdec_as_super.h
...--git a/libswfdec/swfdec_as_function.c b/libswfdec/swfdec_as_function.c index ef60c0b..c64df5e 100644 --- a/libswfdec/swfdec_as_function.c +++ b/libswfdec/swfdec_as_function.c @@ -164,10 +164,10 @@ swfdec_as_function_call (SwfdecAsFunction *function, SwfdecAsObject *thisp, guin if (frame == NULL) return; if (thisp != NULL) { - swfdec_as_super_new (frame, thisp, FALSE); + swfdec_as_super_new (frame, thisp, thisp->prototype); } else { SWFDEC_FIXME ("does the super object really reference the function when thisp is NULL?"); - sw...
2007 May 22
0
Branch 'as' - 9 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c
...return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL); + context = SWFDEC_AS_OBJECT (frame)->context; if (!swfdec_as_context_use_mem (context, sizeof (SwfdecAsSuper))) return NULL; ret = g_object_new (SWFDEC_TYPE_AS_SUPER, NULL); + super = SWFDEC_AS_SUPER (ret); + if (frame->thisp) { + SwfdecAsValue val; + super->object = frame->thisp; + swfdec_as_object_get_variable (frame->thisp, SWFDEC_AS_STR_constructor, &val); + if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) { + SwfdecAsObject *constructor = SWFDEC_AS_VALUE_GET_OBJECT (&val); + swfdec_a...
2007 May 23
0
Branch 'as' - 7 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_strings.c
...constructor, stupid diff --git a/libswfdec/swfdec_as_super.c b/libswfdec/swfdec_as_super.c index e5b9728..ffbc0b5 100644 --- a/libswfdec/swfdec_as_super.c +++ b/libswfdec/swfdec_as_super.c @@ -79,10 +79,10 @@ swfdec_as_super_new (SwfdecAsFrame *fram if (frame->thisp) { SwfdecAsValue val; super->object = frame->thisp; - swfdec_as_object_get_variable (frame->thisp, SWFDEC_AS_STR_constructor, &val); + swfdec_as_object_get_variable (frame->thisp, SWFDEC_AS_STR___proto__, &val); if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) { -...
2007 May 18
0
Branch 'as' - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_native_function.h
...; @@ -389,10 +390,11 @@ start: frame = context->frame; if (frame == context->last_frame) goto out; - if (frame->function && frame->function->native) { - if (frame->argc >= frame->function->min_args && - g_type_is_a (G_OBJECT_TYPE (frame->thisp), frame->function->type)) { - frame->function->native (frame->thisp, frame->argc, frame->argv, frame->return_value); + if (SWFDEC_IS_AS_NATIVE_FUNCTION (frame->function)) { + SwfdecAsNativeFunction *native = SWFDEC_AS_NATIVE_FUNCTION (frame->function); + if...
2007 Sep 14
0
4 commits - libswfdec/swfdec_as_function.c libswfdec/swfdec_as_object.c test/trace
...ec/swfdec_as_function.c b/libswfdec/swfdec_as_function.c index 3af3b46..b1fdec2 100644 --- a/libswfdec/swfdec_as_function.c +++ b/libswfdec/swfdec_as_function.c @@ -105,7 +105,9 @@ swfdec_as_function_set_constructor (Swfd * @function: the #SwfdecAsFunction to call * @thisp: this argument to use for the call or %NULL for none * @n_args: number of arguments to pass to the function - * @args: the arguments to pass or %NULL to read the last @n_args stack elements + * @args: the arguments to pass or %NULL to read the last @n_args stack elements. + * The memory mu...
2007 Jul 04
0
Branch 'as' - 25 commits - libswfdec/Makefile.am libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c
.../libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index f762252..bbe8060 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -593,10 +593,9 @@ swfdec_action_call (SwfdecAsContext *cx, swfdec_as_function_call (fun, thisp, n_args, swfdec_as_stack_peek (frame->stack, 0), swfdec_as_stack_peek (frame->stack, 1)); if (use_super) { - g_print ("replacing super object\n"); if (cx->frame->super && SWFDEC_AS_SUPER (frame->super)->object) { + SWFDEC_LOG ("replac...
2007 Feb 22
0
3 commits - libswfdec/swfdec_js.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c
...et_property (JSContext * if (!atom) return JS_FALSE; if (obj == NULL) { - if (cx->fp == NULL || cx->fp->scopeChain == NULL) + JSObject *pobj; + JSProperty *prop; + if (cx->fp == NULL || cx->fp->varobj == NULL) return JS_FALSE; - obj = cx->fp->thisp; + if (!js_FindProperty (cx, (jsid) atom, &obj, &pobj, &prop)) + return JS_FALSE; + if (pobj) + obj = pobj; + else + obj = cx->fp->varobj; } return OBJ_SET_PROPERTY (cx, obj, (jsid) atom, ret); } diff --git a/libswfdec/swfdec_script.c b/l...
2007 Apr 12
0
Branch 'as' - 15 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c
...context->frame = frame; frame->script = swfdec_script_ref (script); + frame->function_name = script->name; + SWFDEC_DEBUG ("new frame for function %s", frame->function_name); frame->pc = script->buffer->data; frame->stack = stack; frame->scope = thisp; diff-tree 605184459c5be15046a75e42ef912f0d12a7ecf6 (from 3c696bc51ec288dfe931bc23b1e297d4b7e169da) Author: Benjamin Otte <otte@gnome.org> Date: Thu Apr 12 13:38:16 2007 +0200 break on 0 action before invoking the debugger diff --git a/libswfdec/swfdec_as_context.c b/libsw...
2007 Jun 12
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_math.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c
...| 86 ++++++++++++++++++------------ 13 files changed, 250 insertions(+), 158 deletions(-) New commits: diff-tree e7db3c7145922223dbd67702992e5d47df703fa4 (from ed4f2f63fe303a3c06be46a52c3ed8ea07cbe29a) Author: Benjamin Otte <otte at gnome.org> Date: Tue Jun 12 21:56:24 2007 +0200 thisp may now be NULL diff --git a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c index 5d4435a..a63cf4d 100644 --- a/libswfdec/swfdec_as_context.c +++ b/libswfdec/swfdec_as_context.c @@ -446,8 +446,7 @@ start: SwfdecAsNativeFunction *native = SWFDEC_A...
2007 Feb 19
0
22 commits - libswfdec/js libswfdec/swfdec_debugger.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_script.c
...swfdec_js.c +++ b/libswfdec/swfdec_js.c @@ -338,7 +338,7 @@ swfdec_js_eval_set_property (JSContext * if (obj == NULL) { if (cx->fp == NULL || cx->fp->scopeChain == NULL) return JS_FALSE; - obj = JS_GetParent (cx, cx->fp->scopeChain); + obj = cx->fp->thisp; } return OBJ_SET_PROPERTY (cx, obj, (jsid) atom, ret); } diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c index d46687f..824861b 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -1643,11 +1643,11 @@ swfdec_action_def...
2007 Jun 27
0
Branch 'as' - 16 commits - configure.ac libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_script_function.c
...strchr (str, '/')) { - work = swfdec_js_slash_to_dot (str); - str = work; - } - if (obj == NULL && g_str_has_prefix (str, "this")) { - str += 4; - if (*str == '.') - str++; - if (cx->fp == NULL) - goto out; - obj = cx->fp->thisp; - } - cur = OBJECT_TO_JSVAL (obj); - while (str != NULL && *str != '\0') { - char *dot = strchr (str, '.'); - if (!JSVAL_IS_OBJECT (cur)) - goto out; - if (dot) { - if (!swfdec_js_eval_get_property (cx, obj, str, dot - str, &cur)) - goto out; -...
2007 Nov 12
0
20 commits - libswfdec/swfdec_as_function.c libswfdec/swfdec_as_string.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_load_object_as.c libswfdec/swfdec_movie_as_drawing.c libswfdec/swfdec_player_as.c
...wfdec_as_function_apply (SwfdecAsContext *cx, SwfdecAsObject *fun, +swfdec_as_function_apply (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SwfdecAsValue *argv_pass = NULL; int length = 0; + SwfdecAsFunction *fun; SwfdecAsObject *thisp; - if (argc > 0) { - thisp = swfdec_as_value_to_object (cx, &argv[0]); - } else { - thisp = NULL; - } - if (thisp == NULL) + SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_FUNCTION, &fun, "O", &thisp); + + if (thisp == NULL) { thisp = swfdec_as_object_new_empty (cx); +...
2007 Nov 15
0
4 commits - libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c test/trace
...me { SwfdecAsFrame * next; /* next frame (FIXME: keep a list in the context instead?) */ SwfdecAsFunction * function; /* function we're executing or NULL if toplevel */ - gboolean caller; /* this function can be used as arguments.caller */ SwfdecAsObject * thisp; /* this object in current frame or NULL if none */ SwfdecAsObject * super; /* super object in current frame or NULL if none */ gboolean construct; /* TRUE if this is the constructor for thisp */ diff --git a/libswfdec/swfdec_as_function.c b/libswfdec...
2007 Jul 30
0
10 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_super.c libswfdec/swfdec_video_movie_as.c test/trace
...30 @@ swfdec_as_frame_preload (SwfdecAsFrame * if (frame->script == NULL) return; - + /* setup */ object = SWFDEC_AS_OBJECT (frame); context = object->context; script = frame->script; - if (script->flags & SWFDEC_SCRIPT_PRELOAD_THIS) { - if (frame->thisp) { - SWFDEC_AS_VALUE_SET_OBJECT (&frame->registers[current_reg++], frame->thisp); - } else { - current_reg++; + + /* create arguments and super object if necessary */ + if ((script->flags & (SWFDEC_SCRIPT_PRELOAD_ARGS | SWFDEC_SCRIPT_SUPPRESS_ARGS)) != SWFDEC...
2007 Jul 13
0
3 commits - doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c
...FRAME, SwfdecAsFrameClass)) -struct _SwfdecAsFrame { - SwfdecAsScope scope_object; - - SwfdecAsFrame * next; /* next frame (FIXME: keep a list in the context instead?) */ - SwfdecAsFunction * function; /* function we're executing or NULL if toplevel */ - SwfdecAsObject * thisp; /* this object in current frame or NULL if none */ - SwfdecAsObject * super; /* super object in current frame or NULL if none */ - gboolean construct; /* TRUE if this is the constructor for thisp */ - SwfdecAsValue * return_value; /* pointer to where to store the...
2007 Mar 28
0
Branch 'as' - 3 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_types.c
...ass = SWFDEC_AS_OBJECT_CLASS (klass); + + object_class->dispose = swfdec_as_frame_dispose; + + asobject_class->mark = swfdec_as_frame_mark; +} + +static void +swfdec_as_frame_init (SwfdecAsFrame *frame) +{ +} + +SwfdecAsFrame * +swfdec_as_frame_new (SwfdecAsContext *context, SwfdecAsObject *thisp, SwfdecScript *script) +{ + SwfdecAsValue val; + SwfdecAsFrame *frame; + gsize size; + + g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL); + g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (thisp), NULL); + g_return_val_if_fail (script != NULL, NULL); + + size = sizeof (SwfdecAsObject...
2007 Apr 12
0
Branch 'as' - 14 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h
...;swfdec_as_function.c index 643fed5..8f404b7 100644 --- a/libswfdec/swfdec_as_function.c +++ b/libswfdec/swfdec_as_function.c @@ -139,7 +139,38 @@ swfdec_as_function_call (SwfdecAsFunctio frame->function_name = function->name; } else { frame = swfdec_as_frame_new (thisp, function->script); - /* FIXME: do the preloading here */ + SWFDEC_ERROR ("do the preloading here"); } } +/*** AS CODE ***/ + +static void +swfdec_as_function_construct (SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) +{ + +} + +...
2007 Jun 01
0
Branch 'as' - 2 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c libswfdec/swfdec_interval.c libswfdec/swfdec_interval.h libswfdec/swfdec_player_as.c libswfdec/swfdec_player.c
..._IS_AS_FUNCTION (fun), 0); + g_return_val_if_fail (n_args == 0 || args != NULL, 0); + + return swfdec_interval_new (player, msecs, repeat, SWFDEC_AS_OBJECT (fun), NULL, n_args, args); +} + +guint +swfdec_interval_new_object (SwfdecPlayer *player, guint msecs, gboolean repeat, + SwfdecAsObject *thisp, const char *fun_name, + guint n_args, const SwfdecAsValue *args) +{ + g_return_val_if_fail (SWFDEC_IS_PLAYER (player), 0); + g_return_val_if_fail (msecs > 0, 0); + g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (thisp), 0); + g_return_val_if_fail (fun_name != NULL, 0); + g_return_val_if_fail...
2007 Mar 29
0
Branch 'as' - 9 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c
...+ fun = g_object_new (SWFDEC_TYPE_AS_FUNCTION, NULL); + swfdec_as_object_add (SWFDEC_AS_OBJECT (fun), context, sizeof (SwfdecAsFunction)); + fun->native = native; + fun->min_args = min_args; + + return fun; +} + +void +swfdec_as_function_call (SwfdecAsFunction *function, SwfdecAsObject *thisp, guint n_args) +{ + SwfdecAsContext *context; + + g_return_if_fail (SWFDEC_IS_AS_FUNCTION (function)); + g_return_if_fail (SWFDEC_IS_AS_OBJECT (thisp)); + + context = thisp->context; + if (context->frame) { + guint available_args = swfdec_as_stack_get_size (context->frame->stack...