• Content count

  • Joined

  • Last visited

Community Reputation

290 Neutral

About brightening-eyes

  • Rank


  • Github
  1. Segfault on GCC 6 release builds

    try it with clang, or without any optimizations like -o2 to see that works or not, maybe there is a bug in GCC (as said that kDevelop and qt and chromium have problem with it) and, was this segfault exist in previous versions? if yes, this is a bug in gcc
  2. generating asm code using AngelScript's Jit Capability feature

    hi again, i have a question: in (for example asBC_JMP), do the code in ExecuteNext will be executed or not? i mean, this code which AngelScript has in asBC_JMP:         l_bc += 2 + asBC_INTARG(l_bc); do this executed or not? if yes, i don't need to execute it in asm level and just jump in that part of the code
  3. generating asm code using AngelScript's Jit Capability feature

    so, instead of writing, dword_ptr(a.zax(), 2)); i have to write, word_ptr(a.zax(), 2));
  4. generating asm code using AngelScript's Jit Capability feature

    okay, instead of using for example asBC_SWORDARG0, can i use +1 to retrieve parameters? because in assembly, everything is offset based and, what about jumps? i want to use jmp, what do you recommend? i think it should be like this: a.push(a.zax());, ptr(regs, ASMJIT_OFFSET_OF(asSVMRegisters, programPointer)));, dword_ptr(a.zax(), 2)); a.add(dword_ptr(a.zax()), 1); //asBC_INTARG;, ASMJIT_OFFSET_OF(asSVMRegisters, programPointer)), dword_ptr(a.zax()); a.pop(a.zax()); unfortunately, the compiler's generated asm will not help because everything is turned into constance, and dirring the execution everything will be loaded into memory and i have to change the memory with asmjit
  5. hello, as the topic title says, i want to generate asm code using AngelScript's Jit capability feature using AsmJit now, for example, i want to decrement a variable, i should do this:         case asBC_DecVi:             a.dec(ptr(par1, ASMJIT_OFFSET_OF(asSVMRegisters, stackFramePointer)- asBC_SWORDARG0(bc)));             break; par1 is the asSVMRegisters struct which is passed as the first parameter and, ASMJIT_OFFSET_OF is like offsetof macro, but defined in asmjit as far as i know, i must retrieve the asSVMRegisters as the first parameter (which i get on the AllocArgs function of the assembler) now, i have this assembly code which is not correct: dec [ebx+3] par1 is on the ebx and ASMJIT_OFFSET_OF() return's 4, if decremented by 1 with asBC_SWORDARG0(), return's 3 ok, what am i doing wrong? this is my JitEntry:         case asBC_JitEntry:   , a.getOffset()- firstEntry);             break; a is the assembler, getOffset return's the position of the asm code and firstEntry is the position of the function when it was started to execute
  6. AngelScript execution speed?

    I get a 1750kB file for a no-debug static lib (whereas Squirrel, which I happen to have compiled for another project, is a mere 431 kB).   A program that looks like this: int main() { auto scriptengine = asCreateScriptEngine(ANGELSCRIPT_VERSION); return 0; } me a 1MB executable (stripped).   But don't get me wrong, I didn't mean to say Angelscript was bad. When saying "the only bad thing I can say about Angelscript", that was rather meant to indicate that I'm actually pretty happy with it, in particular with its speed (which was the "issue" in this thread) but also with the ease of use.   Somewhat bigger executable than I would ideally like, well OK, ... but you know, look at the size of some executables, and how much rubbish they load on top of that in DLLs! In that light, what's a megabyte.   Some office program from a well-known mainstream manufacturer which doesn't do anything but... text... (and doesn't even do it well) is so darn huge it wouldn't even run on a computer that is slightly older than 5-6 years. :)   @samoth, you can do some optimization checks with your compiler to reduce the size for example, -o3 optimizes your code a little for you and, something intresting: i've compiled AngelScript without jit compiler and only with jit instructions and with bytecode optimization into the app, it executed the scripts faster, (i didn't attach a jit compiler into it) this script: void main() { InitTimer(); for(auto i=-100000;i<=100000;i++) { cout<<i; } cout<<"\nexecution success\n"; cout<<"the execution took "+GetTime()+" seconds\n"; } it took 38.2324 seconds which is grate
  7. AngelScript execution speed?

    and a suggestion for byte-code optimization: in my idea, it would be good to be able to add callbacks for byte-code optimization for example like this: void asIScriptEngine::addByteCodeOptimizationCallback(asByteCodeLoadOptimizeCallback*, asByteCodeSaveOptimizeCallback*); and the loading and saving can be like this: void (asByteCodeLoadOptimizeCallback*) (asEBCInstr instruction, asDWORD* byteCode); void (asByteCodeSaveOptimizeCallback*) (asEBCInstr instruction, asDWORD* byteCode); although that was something like a simple theory, and that was a suggestion
  8. AngelScript execution speed?

    hi, AngelScript is easy to add to an application, and it has a syntax similar to C++, which i love and i'll use it i've only showed my tests that i've done and the result, nothing else at least when i've tryed the AngelScript with that JIT Compiler, it crashed the application anyway, AngelScript is my favorite scripting language, although lua is faster (i appriciate your grate work that you are doing on AngelScript) anyway, sorry
  9. AngelScript execution speed?

    ok, i don't know why lua is so fast, with a simple syntax and 100 kb of interpreter, which is only in ansi C (luajit as far as i know, turn's the code into asm which make's it so fast) but anyway, for fibonacci, the AngelScript is a little bit slow (i don't want to compair it with c because c work's completely different from AngelScript and it is compiled to native code, not byteCode) i think, AngelScript's byteCode must be optimized more
  10. AngelScript execution speed?

    no, i not mean that, i mean AngelScript is slower than it should be
  11. AngelScript execution speed?

    ok, this is fibonacci test which i got from and modified that on the sandbox, which is executed on 261.941 seconds int fibR(int n) {     if (n < 2) return n;     return (fibR(n-2) + fibR(n-1)); } int fibI(int n) {     int last = 0;     int cur = 1;     --n;     while(n > 0)     {         --n;         int tmp = cur;         cur = last + cur;         last = tmp;     }     return cur; } void main() { InitTimer();     const int N = 43;     cout<<"fib: "+fibR(N);     cout<<" = "+fibI(N);     cout<<"\n"; cout<<"the execution took "+GetTime()+" seconds\n"; } also, i've forgot to say my computer information that i've tested these: windows 7 32 bit ultimate, 2 gb ram, intel (r) 2.90 GHZ cpu some applications running on background such as my screen reader, skype, etc
  12. AngelScript execution speed?

    hello, i wanted to test AngelScript execution speed, so, i've executed a loop from -100000 to 100000, in C++, the execution took about 37.7 seconds, but in AngelScript, it took about 96.3 seconds i don't know, the AngelScript is eaven slower than lua (from other tests that i've read) this is the script which is executed on the AngelScript: void main() { InitTimer(); for(auto i=-100000;i<=100000;i++) { cout<<i<<"\n"; } cout<<"\nexecution success\n"; cout<<"the execution took "+GetTime()+" seconds\n"; } note that C++ streams must be registered with AngelScript also note that, systimer in basic compression library is used and, this is the C++ code #include <iostream> #include <bcl/systimer.h> using namespace std; int main() { InitTimer(); for(auto i=-100000;i<=100000;i++) { cout<<i<<"\n"; } cout<<"\nexecution success\n"; cout<<"the execution took "<<GetTime()<<" seconds\n"; }
  13. hello, why for example cResourceManager i write my classes and functions like this: class resource_manager { private: std::vector<resource> resources; public: resource get_resource(int id); }; in my idea (just in my idea itself), it's the best style for coding
  14. std::stringstream crash

    hi, it has been fixed by changing ss<<data; to ss<<*data; i don't know why it fixe's the crash, although data somehow refer's to nullptr and, trace_handler() doesn't do anything with data pointer, it just retrieve's it's contents and put's it into the log file thank you all again
  15. std::stringstream crash

    hi again, this is a sample test app that i've written, but it doesn't crash //a test app that allow's me to test my gamedata struct with stringstream in order to serialize it #include <iostream> #include <string> #include <sstream> #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> #include <boost/serialization/string.hpp> #include <boost/serialization/serialization.hpp> #include "gamedata.hpp" //uses using namespace std; using namespace boost; using namespace boost::archive; using namespace boost::serialization; int main(int argc, char** argv) { gamedata gd; //i want to serialize this gd.username="test"; gd.password="test"; gd.rank=3; gd.userpass_incorrect=false; gd.account_not_exist=true; gd.mac_address="00:00:00:00"; gd.hdd_serial="0x8FE00"; gd.ip_address=""; gd.x=500; gd.y=800; gd.z=0;; gd.is_banned=false; gd.kicked=false; gd.notify=true; gd.pm_user="test_pm"; gd.chat_user="test_chat"; gd.message="this is a test message"; gd.came_online=false; gd.went_offline=false; gd.server_message="server\'s message"; gd.motd="message of the day"; stringstream st; //this is needed for serializing the struct text_oarchive oa(st); oa<<gd; cout<<"serialized data: "<<st.str()<<std::endl; system("pause"); return 0; } i don't know what make's my app to crash i've initialized all the variables in my gamedata structure