Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

Angelscript on Raspberry Pi


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
131 replies to this topic

#121 Andreas Jonsson   Moderators   -  Reputation: 3352

Like
0Likes
Like

Posted 28 December 2012 - 07:03 PM

I logged in on your RPi today and did some tests. I found out that the error is happening with the test_addon_scripthandle.cpp test.

It would appear that there is something wrong with handling objects registered with the asOBJ_ASHANDLE flag. It could be that the code in as_callfunc_arm.cpp thinks the object is a handle, but in reality it is an object passed/returned by value.

The connection was terrible today and it was taking too long to update the screen to be bearable to continue debugging the code. I'll try again at a later time.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Sponsor:

#122 Tzarls   Members   -  Reputation: 872

Like
0Likes
Like

Posted 28 December 2012 - 07:09 PM

Actually I think there´s something maxing out the CPU, that´s why you´re seeing a slow screen refresh. I´ll reboot it now so you can continue debugging if you feel like doing it.

 

EDIT: Done! The RPi is waiting.


Edited by Tzarls, 28 December 2012 - 07:15 PM.


#123 Andreas Jonsson   Moderators   -  Reputation: 3352

Like
0Likes
Like

Posted 30 December 2012 - 09:44 AM

I found the problem. The flag AS_CALLEE_DESTROY_OBJ_BY_VAL was defined in as_config.h for gnuc/linux/arm, and this caused AngelScript to skip destroying the CScriptHandles that had been passed by value to the application function. This is what caused the memory leaks and the error message from the GC.

 

By removing the flag (that was there before you started this work) all tests pass successfully without any memory leaks.

 

Do you plan on doing anything further on the code? Otherwise I'd like to receive the code so I can merge it into the library.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#124 Tzarls   Members   -  Reputation: 872

Like
0Likes
Like

Posted 30 December 2012 - 11:55 AM

Great! So now the work is complete! Until a bug appears...laugh.png

 

I´ll send you the files later today so you can integrate them into the lib. I guess we´ll have to run some tests to check if the platform is being correctly identified when using "make" to build the lib.

 

Now.... All this exposure to ARM asm left me thinking... how difficult could it be to make a JIT compiler (based on an existing one for some other platform)? Maybe I´m being a bit optimistic, but hey, it won´t kill to ask, right?



#125 Andreas Jonsson   Moderators   -  Reputation: 3352

Like
0Likes
Like

Posted 30 December 2012 - 02:31 PM

I'm sure that it wouldn't be too difficult. Though it will likely be a lot of iterations of disassembly, implementation, and testing. smile.png

 

Quarnster has shared an early version that he implemented as a proof of concept.

 

http://asarmjit.svn.beanstalkapp.com/asarmjit/trunk/  (edit: it seems this link doesn't work anymore. Perhaps it's possible to find the project on google? Or maybe quarnster has it somewhere else?)

 

Perhaps his work and the JIT compiler that Blind Mind studios wrote for x86 can be combined:

 

https://github.com/BlindMindStudios/AngelScript-JIT-Compiler


Edited by Andreas Jonsson, 30 December 2012 - 02:34 PM.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#126 Tzarls   Members   -  Reputation: 872

Like
0Likes
Like

Posted 01 January 2013 - 05:53 PM

Files sent!



#127 Tzarls   Members   -  Reputation: 872

Like
0Likes
Like

Posted 01 January 2013 - 06:57 PM

One thing I forgot to mention is that when I build the lib on the RPi, I need to set the "no-threads" flag, otherwise I get lots of undefined symbol errors. What are the pre-requisites for getting threading to work with the lib?



#128 Andreas Jonsson   Moderators   -  Reputation: 3352

Like
0Likes
Like

Posted 01 January 2013 - 07:30 PM

The gnuc compiler/CPU needs to provide support for atomic instructions, and in your case it must have proper support for Posix threads.

 

Currently the as_config.h defines AS_NO_ATOMIC. You should probably remove that, and in the makefile make sure to link with pthreads when building your application.

 

What are the undefined symbols?


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#129 Tzarls   Members   -  Reputation: 872

Like
0Likes
Like

Posted 01 January 2013 - 10:47 PM

Mmmm.... this is weird. I just rebuilt the library removind the "no-threads" flag to post the errors I was getting, and guess what? It builds fine... I´m sure I was getting undefined references to thread-related functions, and I´m sure those errors went away when I added the flag...

 

About AS_NO_ATOMIC... what´s exactly its function? What kind of atomic operations does AS expect to be supported and when should them be supported?


Edited by Tzarls, 01 January 2013 - 11:19 PM.


#130 Andreas Jonsson   Moderators   -  Reputation: 3352

Like
0Likes
Like

Posted 02 January 2013 - 07:13 AM

It's for the reference counters. Check as_atomic.cpp. 

 

Regards,

Andreas


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#131 quarnster   Members   -  Reputation: 266

Like
0Likes
Like

Posted 10 January 2013 - 04:55 AM

http://asarmjit.svn....asarmjit/trunk/  (edit: it seems this link doesn't work anymore. Perhaps it's possible to find the project on google? Or maybe quarnster has it somewhere else?)

It lives in https://github.com/quarnster/asarmjit nowadays, although it's untouched since I last worked on it so probably needs changes to work at all and I never got around to implementing a satisfying solution to the floating point operations, so none of those byte codes were ever implemented.

 

There's also my AOT compiler at https://github.com/quarnster/asaot which IIRC tested successfully on Android, but again has been untouched for a while so might need changes too.

 

Not entierly related to Angelscript, but I also have a small standalone fork of Mozilla's nanojit at https://github.com/quarnster/nanojit/tree/master/nanojit if you want to write your own platform independent jit. At the time of the fork the License was MPL1.1/GPL 2.0/LGPL 2.1, but looks like the TOT version http://hg.mozilla.org/tamarin-redux/file/f5191c18b0e4/nanojit has been updated to MPL2.0. I don't recall exactly what the obligations under MPL1.1 are, but I know that MPL2.0 is not viral so that you can statically link in MPL2.0 code without having to make your whole program's source code available, nor do you need to make the object code (for re-linking) available. If you make any changes to the MPL2.0 licensed files themselves you have to make those source code changes available though.



#132 Andreas Jonsson   Moderators   -  Reputation: 3352

Like
0Likes
Like

Posted 19 January 2013 - 01:10 PM

Thanks for providing the updated links, I'll update the wiki.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS