• Content count

  • Joined

  • Last visited

Community Reputation

488 Neutral

About ThyReaper

  • Rank
  1. Yet another performance comparison (AS vs Small)

      1) It produces native x86 instructions with fallback to the VM under various conditions (some specific types of calls it can't handle natively, script exceptions, and any new ops that might be added since it was last updated).   2) The JIT requests a page from the OS which can be set to be executable. There is a rather simple class, CodePage, which is responsible for this allocation and can easily be changed. The JIT does expect that new code pages can be allocated dynamically, but a single large static page should be sufficient for most purposes. Jumping to the executable page is handled by the JIT instructions in the VM.   3) Native code runs between 2x and 10x faster depending on the exact code being executed and the architecture involved.
  2. Yet another performance comparison (AS vs Small)

    That's my limited understanding as well, and I believe the JIT does satisfy that requirement as long as its allocator does as well (though that could be replaced with a suitable allocator if needed).
  3. Yet another performance comparison (AS vs Small)

    If it would be possible for you to use our JIT, it would be fairly simple to add a custom line callback to it which caches the line number for each call. I'm not sure exactly what requirements exist for a real time program, but the JIT's behavior is simpler than most of what AngelScript's own compiler has to do.
  4. comparing handles via == and !=

    Here's a brief explanation of the differences:  Foo@ a, b; Foo c; //These compare the value of the referenced instances, typically via opCmp() a == b; a == c; c == b; //These compare handles (pointers) for equality @a == @b; a is b; a is c;
  5. BMS JIT crashes during script compilation

  6. BMS JIT crashes during script compilation

    In the future, please report issues with the JIT to the github page. I only check this forum occasionally, while the github page will notify me of new issues.   It looks like the function call being made for the FREE is larger than expected. I'll fix this shortly.
  7. Removing @?

      I'm aware of at least one project on Mac that uses our JIT, though they use GCC. If you use a different compiler it might take a fair amount of work to add support for it.     Looks like that change is simple enough to use a fallback for, at least temporarily. I'll also add native support for power operators at the same time.   Edit: While implementing the power ops, I noticed that overflow isn't detected when constants are resolved (e.g. 500 ** 3000 becomes 0 or #.INF depending, without printing a warning).
  8. Removing @?

      There are relatively few changes to Angelscript that require us to update the JIT. Most changes affect how the bytecode is assembled, rather than what a specific bytecode does. When new bytecodes are added, the JIT also falls back to Angelscript execution so it can continue to work. Most bytecode changes are relatively simple and I can easily keep it up to date.   Due to this, the last updated version is just a guarantee of what version works, not an indicator that other versions don't work.
  9. AngelScript works in debug mode but not in release

    If you're not using a custom assert(), then lines like assert( pEngine->RegisterObjectType("CScriptComponent2d", 0, asOBJ_REF|asOBJ_NOCOUNT) > -1 ); Turn into something like this in release: (void)0; Asserts are intended to only be run in debug code.   I suggest rewriting your lines like this: { int r= pEngine->RegisterObjectType("CScriptComponent2d", 0, asOBJ_REF|asOBJ_NOCOUNT); assert(r > -1 ); }
  10. Array not released

    If 'myType' needs to be garbage collected, or might need to be garbage collected (not sure of the exact logic for arrays), the array will also be garbage collected. The GC will hold a reference to whatever was added to it until the GC decides it can be deleted.
  11. QtScript vs AngelScript

    Array access in Angelscript is fairly slow, as each access is a function call. I believe Angelscript recently added fixed array access which would be a good fit for matrices, and should run much faster.
  12. Object Handle to Array's

    While the compiler could deduce that aptr[1] is a null pointer access, it is valid to have array handles and to access them in that way.
  13. Engine Cleanup Optimization

    I discovered a bottleneck in the cleanup process in AngelScript which caused our game to take much longer to shutdown than expected. It seems that all the time was being spent in ClearUnusedTypes() which used a linear search for removing types.   I replaced the vector with a set (emulated with a map, to be able to use the same data structures the library normally uses), removing the bottleneck. We've been using this change for a few weeks without issue.
  14. Unhandled exception On VS2013

    Your registration is asOBJ_APP_CLASS_CDAK, but it looks like you didn't register an assignment. Any mismatch in these flags tends to cause strange behavior, but I'm not sure if any assignments would be used for this code. The asOBJ_POD flag may also be conflicting here.
  15. Performance

    I'm not aware of any recent benchmarks compared to LuaJIT, but in the project I work on, using our JIT (, we typically achieve performance roughly 2x-3x slower than comparable C++, and at least 2x faster than general AngelScript, with specific tasks going much faster and almost as fast as native C++.