SpiderMonkey 17 编辑

These release notes are an incomplete draft and were initially seeded from the (now-defunct) 1.8.8 release notes, which were themselves seeded from the 1.8.5 release notes, so lots of the information here isn't actually new to SpiderMonkey 17.

The Mozilla JavaScript team is pleased to announce the release of SpiderMonkey 17. You can download full source code here: http://ftp.mozilla.org/pub/mozilla.org/js/mozjs17.0.0.tar.gz (MD5 checksum: 20b6f8f1140ef6e47daa3b16965c9202).

SpiderMonkey 17 is the JavaScript engine that shipped in Firefox 17. It continues to improve performance over previous SpiderMonkey releases, with ongoing JIT compilation work and with the introduction of type inference to enable faster JITted code.  It also contains new language and API features described in detail below.

Please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. Or file bugs at bugzilla.mozilla.org under Product: Core, Component: JavaScript engine.

— 25 March 2013

Platform support

SpiderMonkey 17 is supported on all the platforms where Firefox 17 runs.

SpiderMonkey 17 includes a just-in-time compiler (JIT) that compiles JavaScript to machine code, for a significant speed increase. It is supported on x86, x86_64, and ARM architectures. On some other platforms (SPARC, MIPS), the JIT is provided but not supported.  On all other platforms the JIT is simply disabled; JavaScript code runs in an interpreter, as in previous versions. It's the same language, just not as fast.

Migrating to SpiderMonkey 17

The following features in earlier versions of SpiderMonkey have been dropped.

SpiderMonkey 17 is not binary-compatible with previous releases, nor is it source-code compatible. Many JSAPI types, functions, and callback signatures have changed, though most of them still have the same names and do the same things. Applications will need significant changes, but most of those changes will be detected by the C/C++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. Here is a list of the most significant changes.

  • A significant number of typedefs of built-in types, or of types which are now standardized, have been removed.

These and other changes are explained in detail below.

New JavaScript language features

JavaScript 17 includes significant updates to language features, yo.

typedef Changes

Many types have been removed from the JSAPI and replaced with simpler alternatives.  Including jsapi.h provides all these types, but more-specific headers also provide these types if you wish to use them in other code.

Obsolete typedefReplacement typeProvided by

uint8, int8, uint16, int16, uint32, int32, uint64, int64

uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_tmozilla/StdInt.h
uintN, intNunsigned (also known as unsigned int), int

N/A

jsdoubledoubleN/A
JSUintn, JSIntnunsigned (also known as unsigned int), intN/A
JSPackedBoolN/AN/A
jsrefcountN/AN/A


The fixed-size integer types are defined in one of the following ways:

  1. If the environment variable MOZ_CUSTOM_STDINT_H is set, that file will be included to provide definitions for these types.  The file must conform to the standard C99 <stdint.h> header interface in all respects, providing all that header's types and macro definitions.  (The msstdint project includes an implementation of this header for Microsoft Visual Studio which demonstrates what the C99 interface looks like.)
  2. Otherwise, if the compiler doesn't provide a usable <stdint.h> header, a custom implementation shipped with the SpiderMonkey source is used.  Currently only versions of Visual Studio prior to 2010 (also known as version 10) are known to be deficient in this manner, so the custom implementation (which is compatible with the one shipped in Visual Studio 2010 and later) is only invoked for those compilers.
  3. Otherwise <stdint.h> is used.

The environment variable is provided as a solution for embedders whose code requires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of Visual Studio.  In the long run we anticipate removing the environment variable-based overriding when we drop support for versions of Visual Studio prior to 2010.  In the meantime MOZ_CUSTOM_STDINT_H is intended to function as a bridge to always using the standard header.

For more information on the fixed-size integer types changes, see this blog post.

New C APIs

  • ...list and link to new APIs here...

New C++ helpers

While JSAPI remains a C API, the engine is now implemented in C++. Some C++ helpers have been introduced into the API, to help embedders writing C++ projects.  Please note that SpiderMonkey reserves the JS:: namespace for itself.

  • ...list new C++ helpers here...

Obsolete APIs

  • ...list obsolete methods/structs/APIs here...

Deleted APIs

API changes

Break out and discuss all API changes here...

JSClass Prototype has changed

A number of optional members have been removed from the JSCLass Prototype.

JSClass Callback changes

Many of the JSClass callbacks such as JSResolveOP, JSEnumerateOp and JSPropertyOp, have a type change on their arguments to JSHandleObject, JSHandleId, JSHandleMutableObjectetc. Atleast for the C API this wraps an extra pointer around these objects, so you would cast the argument to JSObject**, in the callback function.

Removal of JSContext* parameters to many methods

The JS_GetClass method now takes only a JSObject*, where previously it also required a JSContext* in threadsafe builds.  (The JS_GET_CLASS macro abstracting away this difference has accordingly been removed.)

Garbage Collection functions now take runtime argument

Most garbage collection functions now take a runtime argument instead of a context. The one exception to this is JS_MaybeGCwhich still takes a context as argument.

JavaScript shell changes

Detail added/removed methods here...

Known Issues

Detail any known issues here...

Future Direction

INCLUDE-FOLLOWUP-ON-EXPERIMENTAL-LIBRARY-VERSIONING-SCHEME-HERE

SpiderMonkey embedders should also be aware that

  • Mozilla has no plans to keep the JSAPI, nor the JSDBGAPI stable for embedders. We have chosen to concentrate on performance and correctness as primary concerns instead.
  • The team is considering the removal of TinyIDs
  • JS_THREADSAFE is going away, with future versions supporting only thread-safe builds
  • A new debugging API is on the way to replace JSD.
  • In the future every API is going to take Handles instead of raw pointers. Exact Stack Rooting is requirement for a (moving) Generational Garbage Collector.

Release Notes Errata

This is a list of changes which need to be made to the release notes ASAP. Feel free to fix any problems you spot -- this is a Wiki!

  • Don't add anything here -- this is for after the release notes are completed.  :-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:82 次

字数:12952

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文