Displaying 19 results from an estimated 19 matches for "swfdec_action_call".
2007 Jul 07
0
Branch 'as' - 7 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_super.c libswfdec/swfdec_as_super.h libswfdec/swfdec_as_with.c test/trace
...t.c
index 2cabb64..7ade8ca 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -560,7 +560,7 @@ swfdec_action_trace (SwfdecAsContext *cx
/* stack looks like this: [ function, this, arg1, arg2, ... ] */
/* stack must be at least 2 elements big */
static gboolean
-swfdec_action_call (SwfdecAsContext *cx, guint n_args, gboolean use_super)
+swfdec_action_call (SwfdecAsContext *cx, guint n_args)
{
SwfdecAsFunction *fun;
SwfdecAsObject *thisp;
@@ -592,11 +592,9 @@ swfdec_action_call (SwfdecAsContext *cx,
swfdec_as_stack_pop_n (frame->stack, n_args);
swfdec_as_fun...
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
...tion), SWFDEC_AS_OBJECT (function)->prototype);
}
swfdec_as_frame_preload (frame);
}
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index c911276..cb44953 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -876,6 +876,7 @@ swfdec_action_call_method (SwfdecAsContext *cx, guint action, const guint8 *data
SwfdecAsFrame *frame = cx->frame;
SwfdecAsValue *val;
SwfdecAsObject *obj;
+ SwfdecAsObject *pobj = NULL;
guint n_args;
const char *name;
@@ -892,7 +893,7 @@ swfdec_action_call_method (SwfdecAsContext *cx, guint ac...
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
...in Otte <otte at gnome.org>
Date: Wed Jul 4 17:55:43 2007 +0100
remove g_prints
diff --git a/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 (f...
2007 Feb 01
0
Branch 'interpreter' - 9 commits - libswfdec/js libswfdec/swfdec_script.c libswfdec/swfdec_script.h player/swfdec_debug_stack.c test/trace
...t.c
@@ -161,7 +161,7 @@ swfdec_action_to_number (JSContext *cx,
static JSBool
swfdec_value_to_number_7 (JSContext *cx, jsval val, double *d)
{
- if (JSVAL_IS_NULL (val)) {
+ if (JSVAL_IS_OBJECT (val)) {
*d = *cx->runtime->jsNaN;
return JS_TRUE;
} else {
@@ -550,8 +550,10 @@ swfdec_action_call_function (JSContext *
JSStackFrame *fp = cx->fp;
const char *s;
guint32 n_args;
- JSObject *obj;
+ JSObject *obj, *pobj;
+ JSProperty *prop;
jsval fun;
+ JSAtom *atom;
s = swfdec_js_to_string (cx, fp->sp[-1]);
if (s == NULL)
@@ -561,7 +563,9 @@ swfdec_action_call_fun...
2007 Apr 04
0
Branch 'as' - 4 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...ll be the object the
+ * function is called on, sp[-3] is the first argument, followed by the rest of
+ * the arguments. The function removes all of these argumends from the stack
+ * and pushes the return value on top.
+ *
+ * Returns: JS_TRUE on success, JS_FALSE on failure.
+ **/
+static void
+swfdec_action_call (SwfdecAsContext *cx, guint n_args, guint flags)
+{
+ JSStackFrame *fp = cx->fp;
+ int i, j;
+ jsval tmp;
+ guint stacksize;
+
+ stacksize = fp->sp - fp->spbase;
+ g_assert (stacksize >= 2);
+ if (n_args + 2 > stacksize) {
+ SWFDEC_WARNING ("broken script. Want %u argu...
2007 Jan 29
0
Branch 'interpreter' - 18 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_sound.c libswfdec/swfdec_pattern.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_script.c
...(constructor);
+ if (JS_GetClass (object) != &js_FunctionClass)
+ goto fail;
+ clasp = ((JSFunction *) JS_GetPrivate (cx, object))->clasp;
+ object = JS_NewObject (cx, clasp, NULL, NULL);
+ if (object == NULL)
+ return JS_FALSE;
+ fp->sp[-2] = OBJECT_TO_JSVAL (object);
+ if (!swfdec_action_call (cx, n_args, JSINVOKE_CONSTRUCT))
+ return JS_FALSE;
+ fp->sp[-1] = OBJECT_TO_JSVAL (object);
+ return JS_TRUE;
+
+fail:
+ fp->sp -= n_args + 1;
+ fp->sp[-1] = JSVAL_VOID;
+ return JS_TRUE;
+}
+
/*** PRINT FUNCTIONS ***/
static char *
@@ -1276,7 +1318,7 @@ static const SwfdecAc...
2007 Sep 10
0
3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...Date: Sun Sep 9 21:58:48 2007 +0200
don't ERROR about missing functions, just WARN
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index 71a5663..564c35a 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -801,7 +801,7 @@ swfdec_action_call_function (SwfdecAsCon
SWFDEC_AS_VALUE_SET_UNDEFINED (fun);
}
if (!swfdec_action_call (cx, n_args)) {
- SWFDEC_ERROR ("no function named %s", name);
+ SWFDEC_WARNING ("no function named %s", name);
}
}
@@ -855,7 +855,7 @@ swfdec_action_call_method (SwfdecAs...
2007 May 29
0
Branch 'as' - 6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_tag.c player/swfplay.c
..., swfdec_action_delete2 } },
[SWFDEC_AS_ACTION_DEFINE_LOCAL] = { "DefineLocal", NULL, 2, 0, { NULL, NULL, swfdec_action_define_local, swfdec_action_define_local, swfdec_action_define_local } },
[SWFDEC_AS_ACTION_CALL_FUNCTION] = { "CallFunction", NULL, -1, 1, { NULL, NULL, swfdec_action_call_function, swfdec_action_call_function, swfdec_action_call_function } },
[SWFDEC_AS_ACTION_RETURN] = { "Return", NULL, 1, 0, { NULL, NULL, swfdec_action_return, swfdec_action_return, swfdec_action_return } },
diff-tree 91a151966efb877bc00d769a59700857e8534353 (from e43ad1b2e784b00f6ba8b...
2007 Mar 05
0
5 commits - libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c test/trace
...(constructor);
+ if (JS_GetClass (object) != &js_FunctionClass)
+ goto fail;
+ clasp = ((JSFunction *) JS_GetPrivate (cx, object))->clasp;
+ object = JS_NewObject (cx, clasp, NULL, NULL);
+ if (object == NULL)
+ return JS_FALSE;
+ fp->sp[-2] = OBJECT_TO_JSVAL (object);
+ if (!swfdec_action_call (cx, n_args, JSINVOKE_CONSTRUCT))
+ return JS_FALSE;
+ fp->sp[-1] = OBJECT_TO_JSVAL (object);
+ return JS_TRUE;
+
+fail:
+ fp->sp -= 2 + n_args;
+ fp->sp[-1] = JSVAL_VOID;
+ return JS_TRUE;
+}
+
+static JSBool
swfdec_action_init_object (JSContext *cx, guint action, const guint8 *d...
2007 Mar 09
0
17 commits - libswfdec/js libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_root_movie.c
...on, const guint8 *data, guint len)
{
/* FIXME: supply API for this */
SwfdecBits bits;
+ guint stackspace = cx->fp->spend - cx->fp->sp;
swfdec_bits_init_data (&bits, data, len);
while (swfdec_bits_left (&bits) && stackspace-- > 0) {
@@ -644,7 +681,7 @@ swfdec_action_call_function (JSContext *
return JS_FALSE;
if (!JS_ValueToECMAUint32 (cx, fp->sp[-2], &n_args))
return JS_FALSE;
- if (n_args + 2 > (guint) (fp->sp - fp->spbase))
+ if (!swfdec_script_ensure_stack (cx, n_args + 2))
return JS_FALSE;
if (!(atom = js_Atomize (cx,...
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
...guint n_args,
+ SwfdecAsValue * args,
+ SwfdecAsValue * return_value);
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index cc2bf34..11ae005 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -658,6 +658,8 @@ swfdec_action_call (SwfdecAsContext *cx,
SwfdecAsFunction *fun;
SwfdecAsObject *thisp;
SwfdecAsFrame *frame = cx->frame;
+ SwfdecAsValue retval;
+ guint i;
if (!SWFDEC_AS_VALUE_IS_OBJECT (swfdec_as_stack_peek (frame->stack, 1)) ||
!SWFDEC_AS_VALUE_IS_OBJECT (swfdec_as_stack_peek (frame-&g...
2007 Mar 11
0
10 commits - libswfdec/js libswfdec/swfdec_js_color.c libswfdec/swfdec_js_connection.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_js_video.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_script.c player/.gitignore
...Date: Sun Mar 11 21:51:06 2007 +0100
fix handling of missing arguments to be in line with the official player
diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index 2860e24..4b17af1 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -650,8 +650,16 @@ swfdec_action_call (JSContext *cx, guint
JSStackFrame *fp = cx->fp;
int i, j;
jsval tmp;
+ guint stacksize;
- g_assert ((guint) (fp->sp - fp->spbase) >= n_args + 2);
+ stacksize = fp->sp - fp->spbase;
+ g_assert (stacksize >= 2);
+ if (n_args + 2 > stacksize) {
+ SWFDEC_WARN...
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
...at gnome.org>
Date: Tue May 22 11:46:45 2007 +0200
fix CallMethod with empty this
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index 7862e57..63b53a6 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -659,11 +659,12 @@ swfdec_action_call_method (SwfdecAsConte
SWFDEC_AS_VALUE_SET_STRING (val, SWFDEC_AS_STR_EMPTY);
}
if (obj) {
- SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_peek (frame->stack, 3), obj);
if (SWFDEC_AS_VALUE_IS_STRING (val) &&
SWFDEC_AS_VALUE_GET_STRING (val) == SWFDEC_AS_STR_EMPTY) {
+...
2007 Jan 31
0
Branch 'interpreter' - 20 commits - autogen.sh configure.ac libswfdec/js libswfdec/swfdec_debug.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_script.c
...tion, BitRShift, BitLShift and BitURShift
includes some fixes like implementing the function with name case
diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index c398e62..b172ec6 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -387,6 +387,33 @@ swfdec_action_call (JSContext *cx, guint
return js_Invoke (cx, n_args, flags);
}
+/* FIXME: lots of overlap with swfdec_action_call_method */
+static JSBool
+swfdec_action_call_function (JSContext *cx, guint action, const guint8 *data, guint len)
+{
+ JSStackFrame *fp = cx->fp;
+ const char *s;
+ guint32...
2007 Jan 25
0
Branch 'interpreter' - 28 commits - configure.ac libswfdec/js libswfdec/swfdec_buffer.c libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_player.c
...{ NULL, NULL, swfdec_action_increment, swfdec_action_increment, swfdec_action_increment } },
+ [0x51] = { "Decrement", NULL, 1, 1, { NULL, NULL, swfdec_action_decrement, swfdec_action_decrement, swfdec_action_decrement } },
[0x52] = { "CallMethod", NULL, -1, 1, { NULL, NULL, swfdec_action_call_method, swfdec_action_call_method, swfdec_action_call_method } },
[0x53] = { "NewMethod", NULL },
/* version 6 */
diff-tree f2e4bc2ff2bfa289f325e525619b79dcf4815f9c (from 568f6fdf0b44ea7cfcc87b33ed4ac09e88bbd47e)
Author: Benjamin Otte <otte@gnome.org>
Date: Mon Jan 22 10:23:...
2007 Feb 06
0
109 commits - configure.ac libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h
...t.c
@@ -161,7 +161,7 @@ swfdec_action_to_number (JSContext *cx,
static JSBool
swfdec_value_to_number_7 (JSContext *cx, jsval val, double *d)
{
- if (JSVAL_IS_NULL (val)) {
+ if (JSVAL_IS_OBJECT (val)) {
*d = *cx->runtime->jsNaN;
return JS_TRUE;
} else {
@@ -550,8 +550,10 @@ swfdec_action_call_function (JSContext *
JSStackFrame *fp = cx->fp;
const char *s;
guint32 n_args;
- JSObject *obj;
+ JSObject *obj, *pobj;
+ JSProperty *prop;
jsval fun;
+ JSAtom *atom;
s = swfdec_js_to_string (cx, fp->sp[-1]);
if (s == NULL)
@@ -561,7 +563,9 @@ swfdec_action_call_fun...
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
...swfdec_as_function_call (fun, thisp, length, argv_pass, ret);
swfdec_as_context_run (cx);
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index ab6b41c..7d6686f 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -865,7 +865,6 @@ swfdec_action_call_function (SwfdecAsContext *cx, guint action, const guint8 *da
frame = swfdec_action_call (cx, n_args);
if (frame) {
swfdec_as_frame_preload (frame);
- frame->update_caller = TRUE;
} else {
SWFDEC_WARNING ("no function named %s", name);
}
diff --git a/libswfdec/...
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
...: Mon Feb 19 08:16:40 2007 +0100
warn if a function does not exist, so it's easy to see what to implement
diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index 6972c81..d923039 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -639,6 +639,10 @@ swfdec_action_call_function (JSContext *
return JS_FALSE;
if (!JS_GetProperty (cx, obj, s, &fun))
return JS_FALSE;
+ if (!JSVAL_IS_OBJECT (fun)) {
+ SWFDEC_WARNING ("%s:%s is not a function",
+ JS_GetClass (obj)->name, s);
+ }
fp->sp[-1] = fun;
fp->sp[-2] = OBJECT_TO_JSV...
2007 Aug 27
0
8 commits - libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_number.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h test/trace vivified/core
...;);
}
- *swfdec_as_stack_peek (cx, 3) = *swfdec_as_stack_peek (cx, 2);
- *swfdec_as_stack_peek (cx, 2) = *swfdec_as_stack_peek (cx, 1);
- swfdec_as_object_get_variable (SWFDEC_AS_VALUE_GET_OBJECT (swfdec_as_stack_peek (cx, 2)),
- SWFDEC_AS_STR_startDrag, swfdec_as_stack_peek (cx, 1));
- swfdec_action_call (cx, n_args);
- /* FIXME: the return value will still be written to this position */
- swfdec_as_stack_pop (cx);
+ swfdec_as_stack_pop_n (cx, stack_size);
}
static void
diff-tree d4f1574dbc732c6092051da047ef96d0f5b491bd (from cbb7de493f899904f433377fa2b36c43964666db)
Author: Benjamin Otte &l...