Commit graph

33 commits

Author SHA1 Message Date
Oliver Buchtala
306b265af9 Merge branch 'devel' of git://github.com/oliver----/swig-v8 into devel
Conflicts:
	Lib/javascript/v8/javascriptcode.swg
2013-08-31 03:47:08 +02:00
Eric Wing
65a0be8876 v8: variable name bug fix in my template modifications for pointers to structs. 2013-08-31 03:46:07 +02:00
Eric Wing
f8feeacb68 v8: Removed the extern "C" around the initialize function because it makes no sense since it requires a C++ templates object as a parameter. 2013-08-31 03:46:07 +02:00
Eric Wing
ed729f7d3a This brings over the memory leak fixes for pointers to structs with a %extend destructor from my Neha fork. The generator was not generating and connecting the needed code for the requested destructor to the v8 dtor finalizer.
I did not realize this branch has some JavaScriptCore stuff in it too. Unfortunately, it seems to have its own unique problems (like creating C++ files when it should be generating C files). My changes are targeted for v8, and I don't think my JSCore changes fully reach in this JSCore implementation so more work would need to be done to get this branch working. I think my Neha fork is in better shape at the moment.

Also, I did port over the 'NULL out the dtor function pointer' in the %nodefaultdtor fix to v8.

Usage case:
struct MyData {
%extend {
~MyData() {
FreeData($self);
}
}
};
%newobject CreateData;
struct MyData* CreateData(void);
%delobject FreeData;
void FreeData(struct MyData* the_data);

where the use case is something like:
var my_data = example.CreateData();
my_data = null;
2013-08-31 03:46:07 +02:00
Oliver Buchtala
b511e33121 Remove std::iostream relicts from generated v8 wrapper code. 2013-08-31 03:34:38 +02:00
Oliver Buchtala
d3aa8e06fb Bugfix: treat persistent V8 references correctly.
V8 is somewhat inconvenient regarding invoke of destructors for C++ proxies.
2013-08-31 03:34:38 +02:00
Oliver Buchtala
31feff8586 Add missing return statement in v8 code template. 2013-08-31 03:34:38 +02:00
Oliver Buchtala
31844ac72a Simplify the signature of the v8 module intializer. 2013-08-31 03:23:11 +02:00
Oliver Buchtala
008adca72f Provide more control about the target object/namespace where a v8 module is registered to. 2013-08-31 03:23:10 +02:00
Oliver Buchtala
86cb621466 Add comments to v8 code templates.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13829 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:16:42 +00:00
Oliver Buchtala
9b06144d39 Fix handling of overloaded ctors in v8 emitter.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13827 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:16:09 +00:00
Oliver Buchtala
131a106204 Improve names and comments of code templates for javascript emitters.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13826 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:15:51 +00:00
Oliver Buchtala
7c7d1cf3b9 Fix errors related to wrapping and destruction of (undefined) SWIG_TYPES.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13824 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:15:12 +00:00
Oliver Buchtala
f814a8e702 Fix errors concerning object wrapping and cleanup in v8 emitter.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13819 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:14:02 +00:00
Oliver Buchtala
d13289cc91 Fix function dispatching for v8.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13812 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:12:18 +00:00
Oliver Buchtala
68f0f859f8 Fix name collision in generated v8 initializer.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13811 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:11:51 +00:00
Oliver Buchtala
da6307a19e Enable overloading ctors for v8.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13810 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:11:32 +00:00
Oliver Buchtala
a4f8e4c1c3 Fix bug in v8 ctor emitter.
This bug leaded to flaky crashes of v8 engine.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13807 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:10:42 +00:00
Oliver Buchtala
f1e9b21dfd Add missing swig_type_info registration in v8 emitter.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13799 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:08:50 +00:00
Oliver Buchtala
21bdb78f1c Activate SwigModuleInitializer for in v8 emitter.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13798 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:08:33 +00:00
Oliver Buchtala
46cff47ada Several fixes in generator for v8 initializer function.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13796 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:08:03 +00:00
Oliver Buchtala
cda09239ad Several fixes in v8 emitter and code templates.
Achieves first compile of example "class" after re-integration.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13793 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:06:58 +00:00
Oliver Buchtala
78442b2764 Several adaptations and fixes on the way to get V8 emitter running.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13788 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:05:37 +00:00
Oliver Buchtala
32a32633ba Add support for static member variables and functions to v8 module.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13759 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:51:47 +00:00
Oliver Buchtala
badf090cb5 Extend and rename v8 helper functions.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13756 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:51:00 +00:00
Oliver Buchtala
65d4769af8 Add initial support for argument marshalling using typemaps to v8 module.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13755 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:50:41 +00:00
Oliver Buchtala
71bee1e78c Complement variable processing in v8 generator.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13753 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:50:06 +00:00
Oliver Buchtala
285badb95b Improve v8 generator regarding registration of function wrappers.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13751 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:49:32 +00:00
Oliver Buchtala
9a599be8ab Fix order of registration in v8 generator.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13749 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:49:02 +00:00
Oliver Buchtala
886f17c343 Implement namespace support for v8 generator.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13748 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:48:43 +00:00
Oliver Buchtala
6c90d1eb6d Minor improvements in v8 emitter implementation
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13746 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:48:11 +00:00
Oliver Buchtala
a0b71935f2 Update v8 code generator specification.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13744 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:47:38 +00:00
Oliver Buchtala
3c30e2d382 Add initial Javascript V8 emitter implementation.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13743 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:47:19 +00:00