Displaying 11 results from an estimated 11 matches for "swfdecasscriptfunct".
2009 Mar 05
1
Question about SwfdecAsScriptFunction in swfdec
Hello,
I got a question about the script function class(SwfdecAsScriptFunction)
design in swfdec.
Why doesn't a script function mark its
target(SwfdecAsScriptFunction::target) in the marking phase? What if the
function's target has been destroyed while the function itself is still kept
alive? (Answer myself: then there would be a segfault when executing that
fun...
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
...SA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "swfdec_as_script_function.h"
+#include "swfdec_as_context.h"
+#include "swfdec_as_frame.h"
+#include "swfdec_as_stack.h"
+#include "swfdec_debug.h"
+
+G_DEFINE_TYPE (SwfdecAsScriptFunction, swfdec_as_script_function, SWFDEC_TYPE_AS_FUNCTION)
+
+static void
+swfdec_as_script_function_call (SwfdecAsFunction *function, SwfdecAsObject *thisp)
+{
+ SwfdecAsScriptFunction *script = SWFDEC_AS_SCRIPT_FUNCTION (function);
+ SwfdecAsFrame *frame;
+
+ frame = swfdec_as_frame_new (thisp, s...
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
...me);
swfdec_as_context_run (object->context);
}
diff --git a/libswfdec/swfdec_as_script_function.c b/libswfdec/swfdec_as_script_function.c
index 2f75150..bbe4eec 100644
--- a/libswfdec/swfdec_as_script_function.c
+++ b/libswfdec/swfdec_as_script_function.c
@@ -30,12 +30,12 @@
G_DEFINE_TYPE (SwfdecAsScriptFunction, swfdec_as_script_function, SWFDEC_TYPE_AS_FUNCTION)
static void
-swfdec_as_script_function_call (SwfdecAsFunction *function, SwfdecAsObject *thisp)
+swfdec_as_script_function_call (SwfdecAsFunction *function)
{
SwfdecAsScriptFunction *script = SWFDEC_AS_SCRIPT_FUNCTION (function);
Swf...
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
...frame);
swfdec_as_context_run (object->context);
diff --git a/libswfdec/swfdec_as_script_function.c b/libswfdec/swfdec_as_script_function.c
index bbe4eec..9278ffe 100644
--- a/libswfdec/swfdec_as_script_function.c
+++ b/libswfdec/swfdec_as_script_function.c
@@ -29,7 +29,7 @@
G_DEFINE_TYPE (SwfdecAsScriptFunction, swfdec_as_script_function, SWFDEC_TYPE_AS_FUNCTION)
-static void
+static SwfdecAsFrame *
swfdec_as_script_function_call (SwfdecAsFunction *function)
{
SwfdecAsScriptFunction *script = SWFDEC_AS_SCRIPT_FUNCTION (function);
@@ -38,6 +38,7 @@ swfdec_as_script_function_call (SwfdecAs
fram...
2007 Aug 17
0
Branch 'vivi' - 9 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c
...t;swfdec_as_stack.h"
#include "swfdec_as_strings.h"
#include "swfdec_debug.h"
@@ -114,20 +115,26 @@ SwfdecAsFunction *
swfdec_as_script_function_new (SwfdecAsScope *scope, SwfdecAsObject *target, SwfdecScript *script)
{
SwfdecAsValue val;
- SwfdecAsFunction *fun;
+ SwfdecAsScriptFunction *fun;
SwfdecAsObject *proto;
+ SwfdecAsContext *context;
g_return_val_if_fail (SWFDEC_IS_AS_SCOPE (scope), NULL);
g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (target), NULL);
g_return_val_if_fail (script != NULL, NULL);
- fun = swfdec_as_function_create (SWFDEC_AS_OBJECT (scope)-...
2007 Sep 13
0
5 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_scope.c libswfdec/swfdec_as_scope.h libswfdec/swfdec_as_script_function.c
...pe;
+ frame->scope_chain = g_slist_concat (frame->scope_chain, g_slist_copy (script->scope_chain));
frame->function = function;
frame->target = script->target;
frame->original_target = script->target;
@@ -65,8 +65,7 @@ swfdec_as_script_function_mark (SwfdecAs
{
SwfdecAsScriptFunction *script = SWFDEC_AS_SCRIPT_FUNCTION (object);
- if (script->scope)
- swfdec_as_object_mark (SWFDEC_AS_OBJECT (script->scope));
+ g_slist_foreach (script->scope_chain, (GFunc) swfdec_as_object_mark, NULL);
SWFDEC_AS_OBJECT_CLASS (swfdec_as_script_function_parent_class)->ma...
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
...tion.c b/libswfdec/swfdec_as_script_function.c
index 78bf52d..eff76b2 100644
--- a/libswfdec/swfdec_as_script_function.c
+++ b/libswfdec/swfdec_as_script_function.c
@@ -62,7 +62,7 @@ swfdec_as_script_function_dispose (GObje
static void
swfdec_as_script_function_mark (SwfdecAsObject *object)
{
- SwfdecAsScriptFunction *script= SWFDEC_AS_SCRIPT_FUNCTION (object);
+ SwfdecAsScriptFunction *script = SWFDEC_AS_SCRIPT_FUNCTION (object);
if (script->scope)
swfdec_as_object_mark (SWFDEC_AS_OBJECT (script->scope));
@@ -70,6 +70,26 @@ swfdec_as_script_function_mark (SwfdecAs
SWFDEC_AS_OBJECT_CLASS...
2007 Aug 17
0
Branch 'vivi' - 13 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_debugger.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c test/trace vivified/core vivified/ui
...wfdec/swfdec_as_script_function.c b/libswfdec/swfdec_as_script_function.c
index f8b6ad2..3ab7064 100644
--- a/libswfdec/swfdec_as_script_function.c
+++ b/libswfdec/swfdec_as_script_function.c
@@ -124,6 +124,8 @@ swfdec_as_script_function_new (SwfdecAsS
SWFDEC_TYPE_AS_SCRIPT_FUNCTION, sizeof (SwfdecAsScriptFunction));
if (fun == NULL)
return NULL;
+ SWFDEC_AS_SCRIPT_FUNCTION (fun)->scope = scope;
+ SWFDEC_AS_SCRIPT_FUNCTION (fun)->target = target;
proto = swfdec_as_object_new (SWFDEC_AS_OBJECT (scope)->context);
if (proto == NULL)
return NULL;
@@ -131,8 +133,6 @@ swfdec_as_scr...
2007 Aug 22
0
163 commits - autogen.sh configure.ac doc/swfdec-sections.txt libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec-gtk/swfdec_source.c libswfdec/Makefile.am libswfdec/swfdec_as_array.c
...ex 7623b7e..5800dbd 100644
--- a/libswfdec/swfdec_as_script_function.c
+++ b/libswfdec/swfdec_as_script_function.c
@@ -133,15 +133,17 @@ swfdec_as_script_function_new (SwfdecAsS
fun->script = script;
fun->target = target;
swfdec_as_object_add (SWFDEC_AS_OBJECT (fun), context, sizeof (SwfdecAsScriptFunction));
- swfdec_as_function_set_constructor (SWFDEC_AS_FUNCTION (fun));
/* set prototype */
- proto = swfdec_as_object_new (SWFDEC_AS_OBJECT (scope)->context);
+ proto = swfdec_as_object_new_empty (context);
if (proto == NULL)
return NULL;
- SWFDEC_AS_VALUE_SET_OBJECT (&val, SW...
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
...SwfdecAsFunction *fun;
SwfdecAsObject *proto;
g_return_val_if_fail (SWFDEC_IS_AS_SCOPE (scope), NULL);
+ g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (target), NULL);
fun = swfdec_as_function_create (SWFDEC_AS_OBJECT (scope)->context,
SWFDEC_TYPE_AS_SCRIPT_FUNCTION, sizeof (SwfdecAsScriptFunction));
@@ -105,6 +108,7 @@ swfdec_as_script_function_new (SwfdecAsS
SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
swfdec_as_object_set_variable (SWFDEC_AS_OBJECT (fun), SWFDEC_AS_STR_prototype, &val);
SWFDEC_AS_SCRIPT_FUNCTION (fun)->scope = scope;
+ SWFDEC_AS_SCRIPT_FUNCTION (fun)-...
2007 Jul 02
0
Branch 'as' - 24 commits - configure.ac doc/Makefile.am doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c
..._script_function.c
+++ b/libswfdec/swfdec_as_script_function.c
@@ -25,6 +25,7 @@
#include "swfdec_as_context.h"
#include "swfdec_as_frame.h"
#include "swfdec_as_stack.h"
+#include "swfdec_as_strings.h"
#include "swfdec_debug.h"
G_DEFINE_TYPE (SwfdecAsScriptFunction, swfdec_as_script_function, SWFDEC_TYPE_AS_FUNCTION)
diff --git a/libswfdec/swfdec_as_string.c b/libswfdec/swfdec_as_string.c
index 8515c7c..c7babe3 100644
--- a/libswfdec/swfdec_as_string.c
+++ b/libswfdec/swfdec_as_string.c
@@ -29,6 +29,7 @@
#include "swfdec_as_context.h"
#include...