Home > SpiderMonkey > JS_ALWAYS_INLINE

JS_ALWAYS_INLINE

December 4th, 2012 Leave a comment Go to comments

在SpiderMonkey的代码库中经常可以看到一个函数名前面定义了一个宏 JS_ALWAYS_INLINE,这个宏定义在js/src/jstypes.h中:

而 MOZ_ALWAYS_INLINE 定义在mfbt/Attributes.h中:

而这里的 MOZ_INLINE 也定义在mfbt/Attributes.h中:

 

 

这个定义文件放在mfbt目录下,这个目录的全称是“Mozilla Framework Based on Templates (MFBT)”,作用在[1]中有解释:

The Mozilla Framework Based on Templates (“mfbt”) is the central repository for macros, functions, and data structures used throughout Mozilla code, including in the JavaScript engine.

[1]: https://developer.mozilla.org/en-US/docs/Mozilla/MFBT

  1. No comments yet.
  1. No trackbacks yet.