{"id":19409388,"url":"https://github.com/blindmindstudios/angelscript-jit-compiler","last_synced_at":"2025-04-09T20:15:35.709Z","repository":{"id":1806356,"uuid":"2730420","full_name":"BlindMindStudios/AngelScript-JIT-Compiler","owner":"BlindMindStudios","description":"A Just-In-Time compiler for the AngelScript language on x86 processors.","archived":false,"fork":false,"pushed_at":"2022-10-17T11:51:19.000Z","size":195,"stargazers_count":241,"open_issues_count":7,"forks_count":49,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-09T20:15:32.317Z","etag":null,"topics":["angelscript","angelscript-jit-compiler","c-plus-plus","jit"],"latest_commit_sha":null,"homepage":"www.blind-mind.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"kenglxn/QRGen","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlindMindStudios.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-11-08T00:16:04.000Z","updated_at":"2025-02-23T06:10:22.000Z","dependencies_parsed_at":"2023-01-11T16:06:03.923Z","dependency_job_id":null,"html_url":"https://github.com/BlindMindStudios/AngelScript-JIT-Compiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlindMindStudios%2FAngelScript-JIT-Compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlindMindStudios%2FAngelScript-JIT-Compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlindMindStudios%2FAngelScript-JIT-Compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlindMindStudios%2FAngelScript-JIT-Compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlindMindStudios","download_url":"https://codeload.github.com/BlindMindStudios/AngelScript-JIT-Compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angelscript","angelscript-jit-compiler","c-plus-plus","jit"],"created_at":"2024-11-10T12:11:29.692Z","updated_at":"2025-04-09T20:15:35.688Z","avatar_url":"https://github.com/BlindMindStudios.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Angelscript JIT Compiler\n========================\nA Just-In-Time Compiler for use with AngelScript.\n\nCurrently supports x86 and x86_64 processors on both Windows (using MSVC 2010 or later) and Linux (using GCC 4.6.2 or later)\n\nCompatible with version of 2.31.0 of the AngelScript library.\n\nLicense (MIT)\n-------------\n\nCopyright (C) 2012-2016 Blind Mind Studios\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nUtilizing the JIT\n-----------------\n\nThe JIT makes extensive use of C++11 additions, such as Lambdas and the auto keyword. For GCC, use \"-std=c++11\" to force the new standard. MSVC 2010 is compatible with all C++11 features utilized.\n\nThis short example shows the basics of utilizing the JIT. The folder containing \"angelscript.h\" should be an include path in the project.\nWhen including files into the project, choose one of \"virtual_asm_windows.cpp\" and \"virtual_asm_linux.cpp\" depending on your intended platform.\n\n    #include \"angelscript.h\"\n    #include \"as_jit.h\"\n\n    int main() {\n        asIScriptEngine* engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);\n\n        //Create the JIT Compiler. The build flags are explained below,\n        //as well as in as_jit.h\n        asCJITCompiler* jit = new asCJITCompiler(0);\n\n        //Enable JIT helper instructions; without these,\n        //the JIT will not be invoked\n        engine-\u003eSetEngineProperty(asEP_INCLUDE_JIT_INSTRUCTIONS, 1);\n\n        //Bind the JIT compiler to the engine\n        engine-\u003eSetJITCompiler(jit);\n\n        //Load your scripts. The JIT will allocate code pages and build\n        //native code; note that some native execution will occur\n        //(e.g. for global variables)\n        //The JIT is thread-safe, so multiple engines can use the same\n        //JIT Compiler, and multiple engines can be compiling at once\n        LoadAndCompileScripts();\n\n        //Optionally, you can finalize the JIT's code pages,\n        //preventing any alteration to the native code\n        jit-\u003efinalizePages();\n\n        //Now that the JIT is in place, the scripts will be executed\n        //almost entirely in native code\n        RunScripts();\n\n        //Clean up your engine. Code pages will automatically be cleared\n        //by the JIT when the engine is released.\n        DiscardModules();\n        engine-\u003eRelease();\n        delete jit;\n\n        return 0;\n    }\n\nBuild Flags\n-----------\n\n*JIT_NO_SUSPEND*\n\nThe JIT will not check for suspend events. Even if the AngelScript engine is set for fewer suspensions, some will remain, so this option is still useful.\n\n*JIT_SYSCALL_FPU_NORESET*\n\nDisables the FPU reset around functions for platforms that always clean up the FPU. MSVC appears to work fine without FPU resets, and the result will be slightly faster.\n\n*JIT_SYSCALL_NO_ERRORS*\n\nIf system functions never set exceptions on a script context, this produces a smaller and faster output. Setting exceptions with this option enabled will likely result in crashes.\n\n*JIT_ALLOC_SIMPLE*\n\nWhen using simple allocation (e.g. default new/delete or malloc/free) that does not read any script states, this produces smaller and faster outputs.\n\n*JIT_NO_SWITCHES*\n\nDisables native switch statements in the JIT. Disable this option for a smaller, but slower, output.\n\n*JIT_NO_SCRIPT_CALLS*\n\nDisables native script calls in the JIT. Native script calls are slightly faster, but may break on angelscript updates; disable this as a temporary workaround if they do.\n\n*JIT_FAST_REFCOUNT*\n\nReduces overhead involved in reference counting. No reference counting function may alter or inspect script contexts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblindmindstudios%2Fangelscript-jit-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblindmindstudios%2Fangelscript-jit-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblindmindstudios%2Fangelscript-jit-compiler/lists"}