简体   繁体   English

将ASM.JS代码插入到vanilla javascript中

[英]Inserting ASM.JS code into vanilla javascript

只是一个简单的问题,我可以在一组普通的javascript中包含一段asm.js代码,作为函数或其他方式,类似于我如何将ASM代码放入需要特殊优化的区域的C程序中?

Yes. 是。 Use the 使用

"use asm";

prologue directive on top of the function block (ie function or file) that is asm. 在asm的功能块(即函数或文件)之上的prologue指令。 Full example: 完整示例:

function MyAsmModule() {
    "use asm";
    // module body
}

See http://asmjs.org/spec/latest/#introduction for more information 有关更多信息,请参见http://asmjs.org/spec/latest/#introduction

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM