зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE
This commit is contained in:
Коммит
3b217cc771
|
@ -1,4 +1,4 @@
|
|||
BasedOnStyle: Mozilla
|
||||
BasedOnStyle: Google
|
||||
|
||||
# Prevent the loss of indentation with these macros
|
||||
MacroBlockBegin: "^\
|
||||
|
@ -20,12 +20,3 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END_INHERITED$"
|
|||
|
||||
SortIncludes: false
|
||||
|
||||
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterEnum: true
|
||||
AfterStruct: true
|
||||
AfterFunction: true
|
||||
AfterClass: true
|
||||
SplitEmptyFunction: true
|
||||
|
||||
|
|
|
@ -14,8 +14,6 @@ ipc/testshell/.*
|
|||
# Generated code
|
||||
js/src/builtin/intl/TimeZoneDataGenerated.h
|
||||
js/src/jsapi-tests/.*
|
||||
# See bug 1395584
|
||||
js/src/vm/Opcodes.h
|
||||
|
||||
# Ignored because of bug 1506117 & 1342657
|
||||
layout/style/nsCSSAnonBoxList.h
|
||||
|
@ -44,11 +42,23 @@ browser/extensions/mortar/ppapi/.*
|
|||
db/sqlite3/src/.*
|
||||
devtools/client/sourceeditor/codemirror/.*
|
||||
devtools/client/sourceeditor/tern/.*
|
||||
dom/canvas/test/webgl-conf/checkout/closure-library/
|
||||
dom/canvas/test/webgl-conf/checkout/closure-library/.*
|
||||
dom/media/gmp/rlz/.*
|
||||
dom/media/gmp/widevine-adapter/content_decryption_module.h
|
||||
dom/media/gmp/widevine-adapter/content_decryption_module_export.h
|
||||
dom/media/gmp/widevine-adapter/content_decryption_module_ext.h
|
||||
dom/media/gmp/widevine-adapter/content_decryption_module_proxy.h
|
||||
dom/media/platforms/ffmpeg/libav53/.*
|
||||
dom/media/platforms/ffmpeg/libav54/.*
|
||||
dom/media/platforms/ffmpeg/libav55/.*
|
||||
dom/media/webaudio/FFTBlock.cpp
|
||||
dom/media/webaudio/blink/.*
|
||||
dom/media/webspeech/recognition/endpointer.cc
|
||||
dom/media/webspeech/recognition/endpointer.h
|
||||
dom/media/webspeech/recognition/energy_endpointer.cc
|
||||
dom/media/webspeech/recognition/energy_endpointer.h
|
||||
dom/media/webspeech/recognition/energy_endpointer_params.cc
|
||||
dom/media/webspeech/recognition/energy_endpointer_params.h
|
||||
editor/libeditor/tests/browserscope/lib/richtext/.*
|
||||
editor/libeditor/tests/browserscope/lib/richtext2/.*
|
||||
extensions/spellcheck/hunspell/src/.*
|
||||
|
|
|
@ -839,7 +839,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "euclid"
|
||||
version = "0.19.0"
|
||||
version = "0.19.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1418,7 +1418,7 @@ version = "0.0.1"
|
|||
dependencies = [
|
||||
"app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hashglobe 0.1.0",
|
||||
"selectors 0.20.0",
|
||||
"servo_arc 0.1.1",
|
||||
|
@ -1874,7 +1874,7 @@ version = "0.13.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -2368,7 +2368,7 @@ dependencies = [
|
|||
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fallible 0.0.1",
|
||||
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hashglobe 0.1.0",
|
||||
|
@ -2424,7 +2424,7 @@ dependencies = [
|
|||
"app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
"malloc_size_of_derive 0.0.1",
|
||||
"selectors 0.20.0",
|
||||
|
@ -2946,7 +2946,6 @@ dependencies = [
|
|||
"core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-text 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"dwrote 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"freetype 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2974,7 +2973,7 @@ dependencies = [
|
|||
"core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"dwrote 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.80 (git+https://github.com/servo/serde?branch=deserialize_from_enums9)",
|
||||
|
@ -2990,7 +2989,7 @@ dependencies = [
|
|||
"core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"dwrote 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3205,7 +3204,7 @@ dependencies = [
|
|||
"checksum encoding_rs 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f1a79fa56c329a5b087de13748054fb3b974c4a672c12c71f0b66e35c5addec5"
|
||||
"checksum env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0561146661ae44c579e993456bc76d11ce1e0c7d745e57b2fa7146b6e49fa2ad"
|
||||
"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3"
|
||||
"checksum euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "70a2ebdf55fb9d6329046e026329a55ef8fbaae5ea833f56e170beb3125a8a5f"
|
||||
"checksum euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)" = "600657e7e5c03bfbccdc68721bc3b5abcb761553973387124eae9c9e4f02c210"
|
||||
"checksum failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6dd377bcc1b1b7ce911967e3ec24fa19c3224394ec05b54aa7b083d498341ac7"
|
||||
"checksum failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "64c2d913fe8ed3b6c6518eedf4538255b989945c14c2a7d5cbff62a5e2120596"
|
||||
"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
|
||||
|
|
|
@ -1385,10 +1385,6 @@ pref("geo.provider.use_gpsd", true);
|
|||
|
||||
#endif
|
||||
|
||||
// Necko IPC security checks only needed for app isolation for cookies/cache/etc:
|
||||
// currently irrelevant for desktop e10s
|
||||
pref("network.disable.ipc.security", true);
|
||||
|
||||
// CustomizableUI debug logging.
|
||||
pref("browser.uiCustomization.debug", false);
|
||||
|
||||
|
|
|
@ -3,11 +3,16 @@ const gCompleteState = Ci.nsIWebProgressListener.STATE_STOP +
|
|||
|
||||
var gFrontProgressListener = {
|
||||
onProgressChange(aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress) {
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress) {
|
||||
},
|
||||
|
||||
onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
if (aRequest &&
|
||||
aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec == "about:blank") {
|
||||
// ignore initial about blank
|
||||
return;
|
||||
}
|
||||
var state = "onStateChange";
|
||||
info("FrontProgress: " + state + " 0x" + aStateFlags.toString(16));
|
||||
ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
|
||||
|
@ -16,6 +21,11 @@ var gFrontProgressListener = {
|
|||
},
|
||||
|
||||
onLocationChange(aWebProgress, aRequest, aLocationURI, aFlags) {
|
||||
if (aRequest &&
|
||||
aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec == "about:blank") {
|
||||
// ignore initial about blank
|
||||
return;
|
||||
}
|
||||
var state = "onLocationChange";
|
||||
info("FrontProgress: " + state + " " + aLocationURI.spec);
|
||||
ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
|
||||
|
@ -28,6 +38,11 @@ var gFrontProgressListener = {
|
|||
|
||||
onSecurityChange(aWebProgress, aRequest, aOldState, aState,
|
||||
aContentBlockingLogJSON) {
|
||||
if (aRequest &&
|
||||
aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec == "about:blank") {
|
||||
// ignore initial about blank
|
||||
return;
|
||||
}
|
||||
var state = "onSecurityChange";
|
||||
info("FrontProgress: " + state + " 0x" + aState.toString(16));
|
||||
ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
|
||||
|
@ -38,6 +53,11 @@ var gFrontProgressListener = {
|
|||
|
||||
var gAllProgressListener = {
|
||||
onStateChange(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
if (aRequest &&
|
||||
aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec == "about:blank") {
|
||||
// ignore initial about blank
|
||||
return;
|
||||
}
|
||||
var state = "onStateChange";
|
||||
info("AllProgress: " + state + " 0x" + aStateFlags.toString(16));
|
||||
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
|
||||
|
@ -52,8 +72,12 @@ var gAllProgressListener = {
|
|||
}
|
||||
},
|
||||
|
||||
onLocationChange(aBrowser, aWebProgress, aRequest, aLocationURI,
|
||||
aFlags) {
|
||||
onLocationChange(aBrowser, aWebProgress, aRequest, aLocationURI, aFlags) {
|
||||
if (aRequest &&
|
||||
aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec == "about:blank") {
|
||||
// ignore initial about blank
|
||||
return;
|
||||
}
|
||||
var state = "onLocationChange";
|
||||
info("AllProgress: " + state + " " + aLocationURI.spec);
|
||||
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
|
||||
|
@ -63,12 +87,22 @@ var gAllProgressListener = {
|
|||
},
|
||||
|
||||
onStatusChange(aBrowser, aWebProgress, aRequest, aStatus, aMessage) {
|
||||
if (aRequest &&
|
||||
aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec == "about:blank") {
|
||||
// ignore initial about blank
|
||||
return;
|
||||
}
|
||||
var state = "onStatusChange";
|
||||
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
|
||||
},
|
||||
|
||||
onSecurityChange(aBrowser, aWebProgress, aRequest, aOldState, aState,
|
||||
aContentBlockingLogJSON) {
|
||||
if (aRequest &&
|
||||
aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec == "about:blank") {
|
||||
// ignore initial about blank
|
||||
return;
|
||||
}
|
||||
var state = "onSecurityChange";
|
||||
info("AllProgress: " + state + " 0x" + aState.toString(16));
|
||||
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
|
||||
|
|
|
@ -44,10 +44,6 @@ buildscript {
|
|||
url repository
|
||||
}
|
||||
}
|
||||
// For in tree plugins.
|
||||
maven {
|
||||
url "file://${gradle.mozconfig.topsrcdir}/mobile/android/gradle/m2repo"
|
||||
}
|
||||
}
|
||||
|
||||
ext.kotlin_version = '1.2.41'
|
||||
|
@ -59,6 +55,7 @@ buildscript {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'org.mozilla.apilint:apilint:0.1.3'
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
|
|
@ -84,7 +84,7 @@ nsJSPrincipals::Destroy(JSPrincipals *jsprin)
|
|||
#ifdef DEBUG
|
||||
|
||||
// Defined here so one can do principals->dump() in the debugger
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
JSPrincipals::dump()
|
||||
{
|
||||
if (debugToken == nsJSPrincipals::DEBUG_TOKEN) {
|
||||
|
|
|
@ -2294,7 +2294,7 @@ Inspector.prototype = {
|
|||
.getBoolPref("devtools.screenshot.clipboard.enabled");
|
||||
const args = {
|
||||
file: true,
|
||||
selector: this.selectionCssSelector,
|
||||
nodeActorID: this.selection.nodeFront.actorID,
|
||||
clipboard: clipboardEnabled,
|
||||
};
|
||||
const screenshotFront = this.target.getFront("screenshot");
|
||||
|
|
|
@ -52,6 +52,7 @@ support-files =
|
|||
helper_events_test_runner.js
|
||||
helper_markup_accessibility_navigation.js
|
||||
helper_outerhtml_test_runner.js
|
||||
helper_screenshot_node.js
|
||||
helper_style_attr_test_runner.js
|
||||
lib_babel_6.21.0_min.js
|
||||
lib_jquery_1.0.js
|
||||
|
@ -170,6 +171,9 @@ skip-if = verify
|
|||
[browser_markup_pagesize_02.js]
|
||||
[browser_markup_pseudo_on_reload.js]
|
||||
[browser_markup_remove_xul_attributes.js]
|
||||
[browser_markup_screenshot_node.js]
|
||||
[browser_markup_screenshot_node_iframe.js]
|
||||
[browser_markup_screenshot_node_shadowdom.js]
|
||||
[browser_markup_search_01.js]
|
||||
[browser_markup_shadowdom.js]
|
||||
[browser_markup_shadowdom_clickreveal.js]
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
/* import-globals-from helper_screenshot_node.js */
|
||||
|
||||
"use strict";
|
||||
|
||||
loadHelperScript("helper_screenshot_node.js");
|
||||
|
||||
const TEST_URL = `data:text/html;charset=utf8,
|
||||
<div id="blue-node" style="width:30px;height:30px;background:rgb(0, 0, 255)"></div>`;
|
||||
|
||||
// Test that the "Screenshot Node" feature works with a regular node in the main document.
|
||||
add_task(async function() {
|
||||
const { inspector, toolbox } = await openInspectorForURL(encodeURI(TEST_URL));
|
||||
|
||||
info("Select the blue node");
|
||||
await selectNode("#blue-node", inspector);
|
||||
|
||||
info("Take a screenshot of the blue node and verify it looks as expected");
|
||||
const blueScreenshot = await takeNodeScreenshot(inspector);
|
||||
await assertSingleColorScreenshotImage(blueScreenshot, 30, 30, { r: 0, g: 0, b: 255 });
|
||||
|
||||
await toolbox.destroy();
|
||||
});
|
|
@ -0,0 +1,27 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
/* import-globals-from helper_screenshot_node.js */
|
||||
|
||||
"use strict";
|
||||
|
||||
loadHelperScript("helper_screenshot_node.js");
|
||||
|
||||
const TEST_URL = `data:text/html;charset=utf8,
|
||||
<iframe
|
||||
src="data:text/html;charset=utf8,
|
||||
<div style='width:30px;height:30px;background:rgb(255, 0, 0)'></div>"></iframe>`;
|
||||
|
||||
// Test that the "Screenshot Node" feature works with a node inside an iframe.
|
||||
add_task(async function() {
|
||||
const { inspector, toolbox } = await openInspectorForURL(encodeURI(TEST_URL));
|
||||
|
||||
info("Select the red node");
|
||||
const redNode = await getNodeFrontInFrame("div", "iframe", inspector);
|
||||
await selectNode(redNode, inspector);
|
||||
|
||||
info("Take a screenshot of the red node and verify it looks as expected");
|
||||
const redScreenshot = await takeNodeScreenshot(inspector);
|
||||
await assertSingleColorScreenshotImage(redScreenshot, 30, 30, { r: 255, g: 0, b: 0 });
|
||||
|
||||
await toolbox.destroy();
|
||||
});
|
|
@ -0,0 +1,36 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
/* import-globals-from helper_screenshot_node.js */
|
||||
|
||||
"use strict";
|
||||
|
||||
loadHelperScript("helper_screenshot_node.js");
|
||||
|
||||
const TEST_URL = `data:text/html;charset=utf8,
|
||||
<test-component></test-component>
|
||||
<script>
|
||||
'use strict';
|
||||
customElements.define('test-component', class extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
let shadowRoot = this.attachShadow({mode: 'open'});
|
||||
shadowRoot.innerHTML =
|
||||
'<div style="width:30px;height:30px;background:rgb(0, 128, 0)"></div>';
|
||||
}
|
||||
});
|
||||
</script>`;
|
||||
|
||||
// Test that the "Screenshot Node" feature works with a node inside a shadow root.
|
||||
add_task(async function() {
|
||||
const { inspector, toolbox } = await openInspectorForURL(encodeURI(TEST_URL));
|
||||
|
||||
info("Select the green node");
|
||||
const greenNode = await getNodeFrontInShadowDom("div", "test-component", inspector);
|
||||
await selectNode(greenNode, inspector);
|
||||
|
||||
info("Take a screenshot of the green node and verify it looks as expected");
|
||||
const greenScreenshot = await takeNodeScreenshot(inspector);
|
||||
await assertSingleColorScreenshotImage(greenScreenshot, 30, 30, { r: 0, g: 128, b: 0 });
|
||||
|
||||
await toolbox.destroy();
|
||||
});
|
|
@ -0,0 +1,84 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
function colorAt(image, x, y) {
|
||||
// Create a test canvas element.
|
||||
const HTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
const canvas = document.createElementNS(HTML_NS, "canvas");
|
||||
canvas.width = image.width;
|
||||
canvas.height = image.height;
|
||||
|
||||
// Draw the image in the canvas
|
||||
const context = canvas.getContext("2d");
|
||||
context.drawImage(image, 0, 0, image.width, image.height);
|
||||
|
||||
// Return the color found at the provided x,y coordinates as a "r, g, b" string.
|
||||
const [r, g, b] = context.getImageData(x, y, 1, 1).data;
|
||||
return { r, g, b };
|
||||
}
|
||||
|
||||
function waitUntilScreenshot() {
|
||||
return new Promise(async function(resolve) {
|
||||
const { Downloads } = require("resource://gre/modules/Downloads.jsm");
|
||||
const list = await Downloads.getList(Downloads.ALL);
|
||||
|
||||
const view = {
|
||||
onDownloadAdded: download => {
|
||||
download.whenSucceeded().then(() => {
|
||||
resolve(download.target.path);
|
||||
list.removeView(view);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
await list.addView(view);
|
||||
});
|
||||
}
|
||||
|
||||
async function resetDownloads() {
|
||||
info("Reset downloads");
|
||||
const { Downloads } = require("resource://gre/modules/Downloads.jsm");
|
||||
const publicList = await Downloads.getList(Downloads.PUBLIC);
|
||||
const downloads = await publicList.getAll();
|
||||
for (const download of downloads) {
|
||||
publicList.remove(download);
|
||||
await download.finalize(true);
|
||||
}
|
||||
}
|
||||
|
||||
async function takeNodeScreenshot(inspector) {
|
||||
// Cleanup all downloads at the end of the test.
|
||||
registerCleanupFunction(resetDownloads);
|
||||
|
||||
info("Call screenshotNode() and wait until the screenshot is found in the Downloads");
|
||||
const whenScreenshotSucceeded = waitUntilScreenshot();
|
||||
inspector.screenshotNode();
|
||||
const filePath = await whenScreenshotSucceeded;
|
||||
|
||||
info("Create an image using the downloaded fileas source");
|
||||
const image = new Image();
|
||||
image.src = OS.Path.toFileURI(filePath);
|
||||
await once(image, "load");
|
||||
|
||||
return image;
|
||||
}
|
||||
/* exported takeNodeScreenshot */
|
||||
|
||||
/**
|
||||
* Check that the provided image has the expected width, height, and color.
|
||||
* NOTE: This test assumes that the image is only made of a single color and will only
|
||||
* check one pixel.
|
||||
*/
|
||||
async function assertSingleColorScreenshotImage(image, width, height, { r, g, b }) {
|
||||
is(image.width, width, "node screenshot has the expected width");
|
||||
is(image.height, height, "node screenshot has the expected height");
|
||||
|
||||
const color = colorAt(image, 0, 0);
|
||||
is(color.r, r, "node screenshot has the expected red component");
|
||||
is(color.g, g, "node screenshot has the expected green component");
|
||||
is(color.b, b, "node screenshot has the expected blue component");
|
||||
}
|
||||
/* exported assertSingleColorScreenshotImage */
|
|
@ -236,6 +236,31 @@ var getNodeFrontInFrame = async function(selector, frameSelector,
|
|||
return inspector.walker.querySelector(nodes[0], selector);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the NodeFront for a node that matches a given css selector inside a shadow root.
|
||||
*
|
||||
* @param {String} selector
|
||||
* CSS selector of the node inside the shadow root.
|
||||
* @param {String|NodeFront} hostSelector
|
||||
* Selector or front of the element to which the shadow root is attached.
|
||||
* @param {InspectorPanel} inspector
|
||||
* The instance of InspectorPanel currently loaded in the toolbox
|
||||
* @return {Promise} Resolves the node front when the inspector is updated with the new
|
||||
* node.
|
||||
*/
|
||||
var getNodeFrontInShadowDom = async function(selector, hostSelector, inspector) {
|
||||
const hostFront = await getNodeFront(hostSelector, inspector);
|
||||
const {nodes} = await inspector.walker.children(hostFront);
|
||||
|
||||
// Find the shadow root in the children of the host element.
|
||||
const shadowRoot = nodes.filter(node => node.isShadowRoot)[0];
|
||||
if (!shadowRoot) {
|
||||
throw new Error("Could not find a shadow root under selector: " + hostSelector);
|
||||
}
|
||||
|
||||
return inspector.walker.querySelector(shadowRoot, selector);
|
||||
};
|
||||
|
||||
var focusSearchBoxUsingShortcut = async function(panelWin, callback) {
|
||||
info("Focusing search box");
|
||||
const searchBox = panelWin.document.getElementById("inspector-searchbox");
|
||||
|
|
|
@ -272,7 +272,7 @@ WebConsole.prototype = {
|
|||
|
||||
this._parserService.start(
|
||||
"resource://devtools/client/debugger/new/dist/parser-worker.js",
|
||||
this.browserWindow);
|
||||
this.chromeUtilsWindow);
|
||||
return this._parserService;
|
||||
},
|
||||
|
||||
|
|
|
@ -15,6 +15,14 @@ exports.ScreenshotActor = protocol.ActorClassWithSpec(screenshotSpec, {
|
|||
},
|
||||
|
||||
capture: function(args) {
|
||||
if (args.nodeActorID) {
|
||||
const nodeActor = this.conn.getActor(args.nodeActorID);
|
||||
if (!nodeActor) {
|
||||
throw new Error(
|
||||
`Screenshot actor failed to find Node actor for '${args.nodeActorID}'`);
|
||||
}
|
||||
args.rawNode = nodeActor.rawNode;
|
||||
}
|
||||
return captureScreenshot(args, this.document);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -48,7 +48,7 @@ exports.captureScreenshot = captureScreenshot;
|
|||
* area of the browser window
|
||||
*/
|
||||
function createScreenshotDataURL(document, args) {
|
||||
const window = document.defaultView;
|
||||
let window = document.defaultView;
|
||||
let left = 0;
|
||||
let top = 0;
|
||||
let width;
|
||||
|
@ -65,6 +65,9 @@ function createScreenshotDataURL(document, args) {
|
|||
width = window.innerWidth + window.scrollMaxX - window.scrollMinX;
|
||||
height = window.innerHeight + window.scrollMaxY - window.scrollMinY;
|
||||
filename = filename.replace(".png", "-fullpage.png");
|
||||
} else if (args.rawNode) {
|
||||
window = args.rawNode.ownerDocument.defaultView;
|
||||
({ top, left, width, height } = getRect(window, args.rawNode, window));
|
||||
} else if (args.selector) {
|
||||
const node = window.document.querySelector(args.selector);
|
||||
({ top, left, width, height } = getRect(window, node, window));
|
||||
|
|
|
@ -7,7 +7,7 @@ import re
|
|||
import sys
|
||||
|
||||
def read_reserved_word_list(filename):
|
||||
macro_pat = re.compile(r"^\s*macro\(([^,]+), *[^,]+, *[^\)]+\)\s*\\?$")
|
||||
macro_pat = re.compile(r"^\s*MACRO\(([^,]+), *[^,]+, *[^\)]+\)\s*\\?$")
|
||||
|
||||
reserved_word_list = []
|
||||
with open(filename, 'r') as f:
|
||||
|
|
|
@ -2251,8 +2251,9 @@ nsGlobalWindowOuter::SetOpenerWindow(nsPIDOMWindowOuter* aOpener,
|
|||
nsWeakPtr opener = do_GetWeakReference(aOpener);
|
||||
if (opener == mOpener) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(
|
||||
!aOpener || (GetBrowsingContext() && GetBrowsingContext()->GetOpener() ==
|
||||
aOpener->GetBrowsingContext()));
|
||||
!aOpener || !aOpener->GetDocShell() ||
|
||||
(GetBrowsingContext() &&
|
||||
GetBrowsingContext()->GetOpener() == aOpener->GetBrowsingContext()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,10 +92,10 @@ struct nsStyleSizes
|
|||
#define NS_ARENA_SIZES_FIELD(classname) mArena##classname
|
||||
|
||||
struct nsArenaSizes {
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(Other, mLineBoxes) \
|
||||
macro(Style, mRuleNodes) \
|
||||
macro(Style, mComputedStyles)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(Other, mLineBoxes) \
|
||||
MACRO(Style, mRuleNodes) \
|
||||
MACRO(Style, mComputedStyles)
|
||||
|
||||
nsArenaSizes()
|
||||
:
|
||||
|
@ -156,35 +156,35 @@ struct nsArenaSizes {
|
|||
|
||||
class nsWindowSizes
|
||||
{
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(DOM, mDOMElementNodesSize) \
|
||||
macro(DOM, mDOMTextNodesSize) \
|
||||
macro(DOM, mDOMCDATANodesSize) \
|
||||
macro(DOM, mDOMCommentNodesSize) \
|
||||
macro(DOM, mDOMEventTargetsSize) \
|
||||
macro(DOM, mDOMMediaQueryLists) \
|
||||
macro(DOM, mDOMPerformanceUserEntries) \
|
||||
macro(DOM, mDOMPerformanceResourceEntries) \
|
||||
macro(DOM, mDOMOtherSize) \
|
||||
macro(Style, mLayoutStyleSheetsSize) \
|
||||
macro(Style, mLayoutShadowDomStyleSheetsSize) \
|
||||
macro(Style, mLayoutShadowDomAuthorStyles) \
|
||||
macro(Other, mLayoutPresShellSize) \
|
||||
macro(Style, mLayoutStyleSetsStylistRuleTree) \
|
||||
macro(Style, mLayoutStyleSetsStylistElementAndPseudosMaps) \
|
||||
macro(Style, mLayoutStyleSetsStylistInvalidationMap) \
|
||||
macro(Style, mLayoutStyleSetsStylistRevalidationSelectors) \
|
||||
macro(Style, mLayoutStyleSetsStylistOther) \
|
||||
macro(Style, mLayoutStyleSetsOther) \
|
||||
macro(Style, mLayoutElementDataObjects) \
|
||||
macro(Other, mLayoutTextRunsSize) \
|
||||
macro(Other, mLayoutPresContextSize) \
|
||||
macro(Other, mLayoutFramePropertiesSize) \
|
||||
macro(Style, mLayoutComputedValuesDom) \
|
||||
macro(Style, mLayoutComputedValuesNonDom) \
|
||||
macro(Style, mLayoutComputedValuesVisited) \
|
||||
macro(Other, mPropertyTablesSize) \
|
||||
macro(Other, mBindingsSize) \
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(DOM, mDOMElementNodesSize) \
|
||||
MACRO(DOM, mDOMTextNodesSize) \
|
||||
MACRO(DOM, mDOMCDATANodesSize) \
|
||||
MACRO(DOM, mDOMCommentNodesSize) \
|
||||
MACRO(DOM, mDOMEventTargetsSize) \
|
||||
MACRO(DOM, mDOMMediaQueryLists) \
|
||||
MACRO(DOM, mDOMPerformanceUserEntries) \
|
||||
MACRO(DOM, mDOMPerformanceResourceEntries) \
|
||||
MACRO(DOM, mDOMOtherSize) \
|
||||
MACRO(Style, mLayoutStyleSheetsSize) \
|
||||
MACRO(Style, mLayoutShadowDomStyleSheetsSize) \
|
||||
MACRO(Style, mLayoutShadowDomAuthorStyles) \
|
||||
MACRO(Other, mLayoutPresShellSize) \
|
||||
MACRO(Style, mLayoutStyleSetsStylistRuleTree) \
|
||||
MACRO(Style, mLayoutStyleSetsStylistElementAndPseudosMaps) \
|
||||
MACRO(Style, mLayoutStyleSetsStylistInvalidationMap) \
|
||||
MACRO(Style, mLayoutStyleSetsStylistRevalidationSelectors) \
|
||||
MACRO(Style, mLayoutStyleSetsStylistOther) \
|
||||
MACRO(Style, mLayoutStyleSetsOther) \
|
||||
MACRO(Style, mLayoutElementDataObjects) \
|
||||
MACRO(Other, mLayoutTextRunsSize) \
|
||||
MACRO(Other, mLayoutPresContextSize) \
|
||||
MACRO(Other, mLayoutFramePropertiesSize) \
|
||||
MACRO(Style, mLayoutComputedValuesDom) \
|
||||
MACRO(Style, mLayoutComputedValuesNonDom) \
|
||||
MACRO(Style, mLayoutComputedValuesVisited) \
|
||||
MACRO(Other, mPropertyTablesSize) \
|
||||
MACRO(Other, mBindingsSize) \
|
||||
|
||||
public:
|
||||
explicit nsWindowSizes(mozilla::SizeOfState& aState)
|
||||
|
|
|
@ -119,15 +119,15 @@ inline CSPDirective CSP_StringToCSPDirective(const nsAString& aDir)
|
|||
return nsIContentSecurityPolicy::NO_DIRECTIVE;
|
||||
}
|
||||
|
||||
#define FOR_EACH_CSP_KEYWORD(macro) \
|
||||
macro(CSP_SELF, "'self'") \
|
||||
macro(CSP_UNSAFE_INLINE, "'unsafe-inline'") \
|
||||
macro(CSP_UNSAFE_EVAL, "'unsafe-eval'") \
|
||||
macro(CSP_NONE, "'none'") \
|
||||
macro(CSP_NONCE, "'nonce-") \
|
||||
macro(CSP_REQUIRE_SRI_FOR, "require-sri-for") \
|
||||
macro(CSP_REPORT_SAMPLE, "'report-sample'") \
|
||||
macro(CSP_STRICT_DYNAMIC, "'strict-dynamic'")
|
||||
#define FOR_EACH_CSP_KEYWORD(MACRO) \
|
||||
MACRO(CSP_SELF, "'self'") \
|
||||
MACRO(CSP_UNSAFE_INLINE, "'unsafe-inline'") \
|
||||
MACRO(CSP_UNSAFE_EVAL, "'unsafe-eval'") \
|
||||
MACRO(CSP_NONE, "'none'") \
|
||||
MACRO(CSP_NONCE, "'nonce-") \
|
||||
MACRO(CSP_REQUIRE_SRI_FOR, "require-sri-for") \
|
||||
MACRO(CSP_REPORT_SAMPLE, "'report-sample'") \
|
||||
MACRO(CSP_STRICT_DYNAMIC, "'strict-dynamic'")
|
||||
|
||||
enum CSPKeyword {
|
||||
#define KEYWORD_ENUM(id_, string_) id_,
|
||||
|
|
|
@ -25,7 +25,6 @@ bincode = "1.0"
|
|||
bitflags = "1.0"
|
||||
byteorder = "1.0"
|
||||
cfg-if = "0.1.2"
|
||||
euclid = "0.19"
|
||||
fxhash = "0.2.1"
|
||||
gleam = "0.6.3"
|
||||
image = { optional = true, version = "0.20" }
|
||||
|
|
|
@ -159,7 +159,6 @@ extern crate dwrote;
|
|||
extern crate app_units;
|
||||
extern crate bincode;
|
||||
extern crate byteorder;
|
||||
extern crate euclid;
|
||||
extern crate fxhash;
|
||||
extern crate gleam;
|
||||
extern crate num_traits;
|
||||
|
@ -202,4 +201,5 @@ pub use renderer::{RendererStats, SceneBuilderHooks, ThreadListener, ShaderPreca
|
|||
pub use renderer::MAX_VERTEX_TEXTURE_WIDTH;
|
||||
pub use shade::{Shaders, WrShaders};
|
||||
pub use webrender_api as api;
|
||||
pub use resource_cache::intersect_for_tile;
|
||||
pub use webrender_api::euclid;
|
||||
pub use resource_cache::intersect_for_tile;
|
|
@ -18,7 +18,7 @@ bincode = "1.0"
|
|||
bitflags = "1.0"
|
||||
byteorder = "1.2.1"
|
||||
ipc-channel = {version = "0.11.0", optional = true}
|
||||
euclid = { version = "0.19", features = ["serde"] }
|
||||
euclid = { version = "0.19.3", features = ["serde"] }
|
||||
serde = { version = "=1.0.80", features = ["rc"] }
|
||||
serde_derive = { version = "=1.0.80", features = ["deserialize_in_place"] }
|
||||
serde_bytes = "0.10"
|
||||
|
|
|
@ -27,7 +27,7 @@ extern crate core_foundation;
|
|||
extern crate core_graphics;
|
||||
#[cfg(target_os = "windows")]
|
||||
extern crate dwrote;
|
||||
extern crate euclid;
|
||||
pub extern crate euclid;
|
||||
#[cfg(feature = "ipc")]
|
||||
extern crate ipc_channel;
|
||||
extern crate serde;
|
||||
|
|
|
@ -7,7 +7,7 @@ license = "MPL-2.0"
|
|||
[dependencies]
|
||||
rayon = "1"
|
||||
thread_profiler = "0.1.1"
|
||||
euclid = { version = "0.19", features = ["serde"] }
|
||||
euclid = { version = "0.19.3", features = ["serde"] }
|
||||
app_units = "0.7"
|
||||
gleam = "0.6.3"
|
||||
log = "0.4"
|
||||
|
|
|
@ -1 +1 @@
|
|||
9ab93fda1abe8a7ce5c9e83cdfd577946bfcd53c
|
||||
262edcb7d48deb72509141e14e1c7d914c1970fb
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "js/TypeDecls.h"
|
||||
#include "js/Utility.h"
|
||||
|
||||
extern MOZ_COLD JS_PUBLIC_API(void) JS_ReportOutOfMemory(JSContext* cx);
|
||||
extern MOZ_COLD JS_PUBLIC_API void JS_ReportOutOfMemory(JSContext* cx);
|
||||
|
||||
namespace js {
|
||||
|
||||
|
@ -54,7 +54,7 @@ class SystemAllocPolicy : public AllocPolicyBase
|
|||
}
|
||||
};
|
||||
|
||||
MOZ_COLD JS_FRIEND_API(void) ReportOutOfMemory(JSContext* cx);
|
||||
MOZ_COLD JS_FRIEND_API void ReportOutOfMemory(JSContext* cx);
|
||||
|
||||
/*
|
||||
* Allocation policy that calls the system memory functions and reports errors
|
||||
|
@ -73,8 +73,8 @@ class TempAllocPolicy : public AllocPolicyBase
|
|||
* Non-inline helper to call JSRuntime::onOutOfMemory with minimal
|
||||
* code bloat.
|
||||
*/
|
||||
JS_FRIEND_API(void*) onOutOfMemory(AllocFunction allocFunc, size_t nbytes,
|
||||
void* reallocPtr = nullptr);
|
||||
JS_FRIEND_API void* onOutOfMemory(AllocFunction allocFunc, size_t nbytes,
|
||||
void* reallocPtr = nullptr);
|
||||
|
||||
template <typename T>
|
||||
T* onOutOfMemoryTyped(AllocFunction allocFunc, size_t numElems, void* reallocPtr = nullptr) {
|
||||
|
@ -120,7 +120,7 @@ class TempAllocPolicy : public AllocPolicyBase
|
|||
js_free(p);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(void) reportAllocOverflow() const;
|
||||
JS_FRIEND_API void reportAllocOverflow() const;
|
||||
|
||||
bool checkSimulatedOOM() const {
|
||||
if (js::oom::ShouldFailWithOOM()) {
|
||||
|
|
|
@ -78,7 +78,7 @@ typedef bool
|
|||
|
||||
namespace JS {
|
||||
|
||||
extern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;
|
||||
extern JS_PUBLIC_DATA const HandleValue UndefinedHandleValue;
|
||||
|
||||
namespace detail {
|
||||
|
||||
|
@ -86,11 +86,11 @@ namespace detail {
|
|||
* Compute |this| for the |vp| inside a JSNative, either boxing primitives or
|
||||
* replacing with the global object as necessary.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ComputeThis(JSContext* cx, JS::Value* vp, MutableHandleObject thisObject);
|
||||
|
||||
#ifdef JS_DEBUG
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
CheckIsValidConstructible(const Value& v);
|
||||
#endif
|
||||
|
||||
|
@ -326,7 +326,7 @@ class MOZ_STACK_CLASS CallArgs : public detail::CallArgsBase<detail::IncludeUsed
|
|||
* Returns true if there are at least |required| arguments passed in. If
|
||||
* false, it reports an error message on the context.
|
||||
*/
|
||||
JS_PUBLIC_API(bool) requireAtLeast(JSContext* cx, const char* fnname, unsigned required) const;
|
||||
JS_PUBLIC_API bool requireAtLeast(JSContext* cx, const char* fnname, unsigned required) const;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ typedef bool (*NativeImpl)(JSContext* cx, const CallArgs& args);
|
|||
namespace detail {
|
||||
|
||||
// DON'T CALL THIS DIRECTLY. It's for use only by CallNonGenericMethod!
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CallMethodIfWrapped(JSContext* cx, IsAcceptableThis test, NativeImpl impl, const CallArgs& args);
|
||||
|
||||
} // namespace detail
|
||||
|
|
|
@ -129,7 +129,7 @@ class UTF8CharsZ : public mozilla::RangedPtr<unsigned char>
|
|||
* to others. This differs from UTF8CharsZ in that the chars are
|
||||
* const and it disallows assignment.
|
||||
*/
|
||||
class JS_PUBLIC_API(ConstUTF8CharsZ)
|
||||
class JS_PUBLIC_API ConstUTF8CharsZ
|
||||
{
|
||||
const char* data_;
|
||||
|
||||
|
@ -242,7 +242,7 @@ template <typename CharT>
|
|||
extern UTF8CharsZ
|
||||
CharsToNewUTF8CharsZ(JSContext* maybeCx, const mozilla::Range<CharT> chars);
|
||||
|
||||
JS_PUBLIC_API(uint32_t)
|
||||
JS_PUBLIC_API uint32_t
|
||||
Utf8ToOneUcs4Char(const uint8_t* utf8Buffer, int utf8Length);
|
||||
|
||||
/*
|
||||
|
@ -251,13 +251,13 @@ Utf8ToOneUcs4Char(const uint8_t* utf8Buffer, int utf8Length);
|
|||
* - On success, returns a malloc'd TwoByteCharsZ, and updates |outlen| to hold
|
||||
* its length; the length value excludes the trailing null.
|
||||
*/
|
||||
extern JS_PUBLIC_API(TwoByteCharsZ)
|
||||
extern JS_PUBLIC_API TwoByteCharsZ
|
||||
UTF8CharsToNewTwoByteCharsZ(JSContext* cx, const UTF8Chars utf8, size_t* outlen);
|
||||
|
||||
/*
|
||||
* Like UTF8CharsToNewTwoByteCharsZ, but for ConstUTF8CharsZ.
|
||||
*/
|
||||
extern JS_PUBLIC_API(TwoByteCharsZ)
|
||||
extern JS_PUBLIC_API TwoByteCharsZ
|
||||
UTF8CharsToNewTwoByteCharsZ(JSContext* cx, const ConstUTF8CharsZ& utf8, size_t* outlen);
|
||||
|
||||
/*
|
||||
|
@ -265,17 +265,17 @@ UTF8CharsToNewTwoByteCharsZ(JSContext* cx, const ConstUTF8CharsZ& utf8, size_t*
|
|||
* will be replaced by \uFFFD. No exception will be thrown for malformed UTF-8
|
||||
* input.
|
||||
*/
|
||||
extern JS_PUBLIC_API(TwoByteCharsZ)
|
||||
extern JS_PUBLIC_API TwoByteCharsZ
|
||||
LossyUTF8CharsToNewTwoByteCharsZ(JSContext* cx, const UTF8Chars utf8, size_t* outlen);
|
||||
|
||||
extern JS_PUBLIC_API(TwoByteCharsZ)
|
||||
extern JS_PUBLIC_API TwoByteCharsZ
|
||||
LossyUTF8CharsToNewTwoByteCharsZ(JSContext* cx, const ConstUTF8CharsZ& utf8, size_t* outlen);
|
||||
|
||||
/*
|
||||
* Returns the length of the char buffer required to encode |s| as UTF8.
|
||||
* Does not include the null-terminator.
|
||||
*/
|
||||
JS_PUBLIC_API(size_t)
|
||||
JS_PUBLIC_API size_t
|
||||
GetDeflatedUTF8StringLength(JSFlatString* s);
|
||||
|
||||
/*
|
||||
|
@ -290,7 +290,7 @@ GetDeflatedUTF8StringLength(JSFlatString* s);
|
|||
* than the length of the string, if the buffer is exhausted before the string
|
||||
* is fully encoded).
|
||||
*/
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
DeflateStringToUTF8Buffer(JSFlatString* src, mozilla::RangedPtr<char> dst,
|
||||
size_t* dstlenp = nullptr, size_t* numcharsp = nullptr);
|
||||
|
||||
|
@ -309,7 +309,7 @@ enum class SmallestEncoding {
|
|||
* codepoints are <128 then ASCII, otherwise if all codepoints are <256
|
||||
* Latin-1, else UTF16.
|
||||
*/
|
||||
JS_PUBLIC_API(SmallestEncoding)
|
||||
JS_PUBLIC_API SmallestEncoding
|
||||
FindSmallestEncoding(UTF8Chars utf8);
|
||||
|
||||
/*
|
||||
|
@ -318,7 +318,7 @@ FindSmallestEncoding(UTF8Chars utf8);
|
|||
* report an error if the string contains non-Latin-1 codepoints. Returns
|
||||
* Latin1CharsZ() on failure.
|
||||
*/
|
||||
extern JS_PUBLIC_API(Latin1CharsZ)
|
||||
extern JS_PUBLIC_API Latin1CharsZ
|
||||
UTF8CharsToNewLatin1CharsZ(JSContext* cx, const UTF8Chars utf8, size_t* outlen);
|
||||
|
||||
/*
|
||||
|
@ -326,14 +326,14 @@ UTF8CharsToNewLatin1CharsZ(JSContext* cx, const UTF8Chars utf8, size_t* outlen);
|
|||
* storing its length (excluding null terminator) in |*outlen|. Non-Latin-1
|
||||
* codepoints are replaced by '?'. Returns Latin1CharsZ() on failure.
|
||||
*/
|
||||
extern JS_PUBLIC_API(Latin1CharsZ)
|
||||
extern JS_PUBLIC_API Latin1CharsZ
|
||||
LossyUTF8CharsToNewLatin1CharsZ(JSContext* cx, const UTF8Chars utf8, size_t* outlen);
|
||||
|
||||
/*
|
||||
* Returns true if all characters in the given null-terminated string are
|
||||
* ASCII, i.e. < 0x80, false otherwise.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
StringIsASCII(const char* s);
|
||||
|
||||
} // namespace JS
|
||||
|
@ -355,7 +355,7 @@ inline void JS_free(JS::UTF8CharsZ& ptr) { js_free((void*)ptr.get()); }
|
|||
* contains any nulls. Avoid using this function if possible, because it will
|
||||
* eventually be removed.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JS::UniqueChars)
|
||||
extern JS_PUBLIC_API JS::UniqueChars
|
||||
JS_EncodeStringToLatin1(JSContext* cx, JSString* str);
|
||||
|
||||
/**
|
||||
|
@ -375,7 +375,7 @@ JS_EncodeStringToLatin1(JSContext* cx, JSString* str);
|
|||
* Avoid using this function if possible, because we'll remove it once we can
|
||||
* devise a better API for the task.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JS::UniqueChars)
|
||||
extern JS_PUBLIC_API JS::UniqueChars
|
||||
JS_EncodeStringToUTF8(JSContext* cx, JS::Handle<JSString*> str);
|
||||
|
||||
/**
|
||||
|
@ -394,7 +394,7 @@ JS_EncodeStringToUTF8(JSContext* cx, JS::Handle<JSString*> str);
|
|||
* Avoid using this function if possible, because we'll remove it once we can
|
||||
* devise a better API for the task.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JS::UniqueChars)
|
||||
extern JS_PUBLIC_API JS::UniqueChars
|
||||
JS_EncodeStringToASCII(JSContext* cx, JSString* str);
|
||||
|
||||
#endif /* js_CharacterEncoding_h */
|
||||
|
|
|
@ -36,7 +36,7 @@ class Shape;
|
|||
|
||||
// This is equal to JSFunction::class_. Use it in places where you don't want
|
||||
// to #include jsfun.h.
|
||||
extern JS_FRIEND_DATA(const js::Class* const) FunctionClassPtr;
|
||||
extern JS_FRIEND_DATA const js::Class* const FunctionClassPtr;
|
||||
|
||||
} // namespace js
|
||||
|
||||
|
@ -65,7 +65,7 @@ enum class IsArrayAnswer
|
|||
* revoked, or if |obj| is a proxy whose target (at any number of hops) is a
|
||||
* revoked proxy, this method throws a TypeError and returns false.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsArray(JSContext* cx, HandleObject obj, bool* isArray);
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ IsArray(JSContext* cx, HandleObject obj, bool* isArray);
|
|||
*
|
||||
* Most users will want the overload above, not this one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsArray(JSContext* cx, HandleObject obj, IsArrayAnswer* answer);
|
||||
|
||||
/**
|
||||
|
@ -192,20 +192,20 @@ class ObjectOpResult
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool) failCantRedefineProp();
|
||||
JS_PUBLIC_API(bool) failReadOnly();
|
||||
JS_PUBLIC_API(bool) failGetterOnly();
|
||||
JS_PUBLIC_API(bool) failCantDelete();
|
||||
JS_PUBLIC_API bool failCantRedefineProp();
|
||||
JS_PUBLIC_API bool failReadOnly();
|
||||
JS_PUBLIC_API bool failGetterOnly();
|
||||
JS_PUBLIC_API bool failCantDelete();
|
||||
|
||||
JS_PUBLIC_API(bool) failCantSetInterposed();
|
||||
JS_PUBLIC_API(bool) failCantDefineWindowElement();
|
||||
JS_PUBLIC_API(bool) failCantDeleteWindowElement();
|
||||
JS_PUBLIC_API(bool) failCantDeleteWindowNamedProperty();
|
||||
JS_PUBLIC_API(bool) failCantPreventExtensions();
|
||||
JS_PUBLIC_API(bool) failCantSetProto();
|
||||
JS_PUBLIC_API(bool) failNoNamedSetter();
|
||||
JS_PUBLIC_API(bool) failNoIndexedSetter();
|
||||
JS_PUBLIC_API(bool) failNotDataDescriptor();
|
||||
JS_PUBLIC_API bool failCantSetInterposed();
|
||||
JS_PUBLIC_API bool failCantDefineWindowElement();
|
||||
JS_PUBLIC_API bool failCantDeleteWindowElement();
|
||||
JS_PUBLIC_API bool failCantDeleteWindowNamedProperty();
|
||||
JS_PUBLIC_API bool failCantPreventExtensions();
|
||||
JS_PUBLIC_API bool failCantSetProto();
|
||||
JS_PUBLIC_API bool failNoNamedSetter();
|
||||
JS_PUBLIC_API bool failNoIndexedSetter();
|
||||
JS_PUBLIC_API bool failNotDataDescriptor();
|
||||
|
||||
uint32_t failureCode() const {
|
||||
MOZ_ASSERT(!ok());
|
||||
|
@ -257,8 +257,8 @@ class ObjectOpResult
|
|||
}
|
||||
|
||||
/* Helper function for checkStrictErrorOrWarning's slow path. */
|
||||
JS_PUBLIC_API(bool) reportStrictErrorOrWarning(JSContext* cx, HandleObject obj, HandleId id, bool strict);
|
||||
JS_PUBLIC_API(bool) reportStrictErrorOrWarning(JSContext* cx, HandleObject obj, bool strict);
|
||||
JS_PUBLIC_API bool reportStrictErrorOrWarning(JSContext* cx, HandleObject obj, HandleId id, bool strict);
|
||||
JS_PUBLIC_API bool reportStrictErrorOrWarning(JSContext* cx, HandleObject obj, bool strict);
|
||||
|
||||
/*
|
||||
* Convenience method. Return true if ok() or if strict is false; otherwise
|
||||
|
@ -558,7 +558,7 @@ typedef bool
|
|||
(* DeletePropertyOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
|
||||
JS::ObjectOpResult& result);
|
||||
|
||||
class JS_FRIEND_API(ElementAdder)
|
||||
class JS_FRIEND_API ElementAdder
|
||||
{
|
||||
public:
|
||||
enum GetBehavior {
|
||||
|
@ -1067,7 +1067,7 @@ bool
|
|||
Unbox(JSContext* cx, JS::HandleObject obj, JS::MutableHandleValue vp);
|
||||
|
||||
#ifdef DEBUG
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
HasObjectMovedOp(JSObject* obj);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ template<typename UnitT> class SourceText;
|
|||
* The provided buffer is interpreted as UTF-8 data. An error is reported if
|
||||
* a UTF-8 encoding error is encountered.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_Utf8BufferIsCompilableUnit(JSContext* cx, JS::Handle<JSObject*> obj,
|
||||
const char* utf8, size_t length);
|
||||
|
||||
|
@ -67,10 +67,10 @@ JS_Utf8BufferIsCompilableUnit(JSContext* cx, JS::Handle<JSObject*> obj,
|
|||
/**
|
||||
* Evaluate a script in the scope of the current global of cx.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_ExecuteScript(JSContext* cx, JS::Handle<JSScript*> script, JS::MutableHandle<JS::Value> rval);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_ExecuteScript(JSContext* cx, JS::Handle<JSScript*> script);
|
||||
|
||||
/**
|
||||
|
@ -78,11 +78,11 @@ JS_ExecuteScript(JSContext* cx, JS::Handle<JSScript*> script);
|
|||
* the global object on it; that's implicit. It needs to contain the other
|
||||
* objects that should end up on the script's scope chain.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_ExecuteScript(JSContext* cx, JS::AutoVector<JSObject*>& envChain,
|
||||
JS::Handle<JSScript*> script, JS::MutableHandle<JS::Value> rval);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_ExecuteScript(JSContext* cx, JS::AutoVector<JSObject*>& envChain, JS::Handle<JSScript*> script);
|
||||
|
||||
namespace JS {
|
||||
|
@ -91,21 +91,21 @@ namespace JS {
|
|||
* Like the above, but handles a cross-compartment script. If the script is
|
||||
* cross-compartment, it is cloned into the current compartment before executing.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CloneAndExecuteScript(JSContext* cx, Handle<JSScript*> script, MutableHandle<Value> rval);
|
||||
|
||||
/**
|
||||
* Like CloneAndExecuteScript above, but allows executing under a non-syntactic
|
||||
* environment chain.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CloneAndExecuteScript(JSContext* cx, AutoVector<JSObject*>& envChain, Handle<JSScript*> script,
|
||||
MutableHandle<Value> rval);
|
||||
|
||||
/**
|
||||
* Evaluate the given source buffer in the scope of the current global of cx.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
Evaluate(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
SourceText<char16_t>& srcBuf, MutableHandle<Value> rval);
|
||||
|
||||
|
@ -114,7 +114,7 @@ Evaluate(JSContext* cx, const ReadOnlyCompileOptions& options,
|
|||
* the global object on it; that's implicit. It needs to contain the other
|
||||
* objects that should end up on the script's scope chain.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
Evaluate(JSContext* cx, AutoVector<JSObject*>& envChain, const ReadOnlyCompileOptions& options,
|
||||
SourceText<char16_t>& srcBuf, MutableHandle<Value> rval);
|
||||
|
||||
|
@ -123,7 +123,7 @@ Evaluate(JSContext* cx, AutoVector<JSObject*>& envChain, const ReadOnlyCompileOp
|
|||
* and return the completion value in |rval|. If the data contains invalid
|
||||
* UTF-8, an error is reported.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
EvaluateUtf8(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
const char* bytes, size_t length, MutableHandle<Value> rval);
|
||||
|
||||
|
@ -135,7 +135,7 @@ EvaluateUtf8(JSContext* cx, const ReadOnlyCompileOptions& options,
|
|||
* This function may eventually be removed, such that *only* bytes containing
|
||||
* UTF-8 source text may be directly compiled. Avoid using it if you can.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
EvaluateLatin1(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
const char* bytes, size_t length, MutableHandle<Value> rval);
|
||||
|
||||
|
@ -145,14 +145,14 @@ EvaluateLatin1(JSContext* cx, const ReadOnlyCompileOptions& options,
|
|||
* [necessarily] UTF-8.) If the contents contain any malformed UTF-8, an error
|
||||
* is reported.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
EvaluateUtf8Path(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
const char* filename, MutableHandle<Value> rval);
|
||||
|
||||
/**
|
||||
* |script| will always be set. On failure, it will be set to nullptr.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
Compile(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
SourceText<char16_t>& srcBuf, MutableHandle<JSScript*> script);
|
||||
|
||||
|
@ -162,7 +162,7 @@ Compile(JSContext* cx, const ReadOnlyCompileOptions& options,
|
|||
*
|
||||
* |script| is always set to the compiled script or to null in case of error.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileUtf8(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
const char* bytes, size_t length, MutableHandle<JSScript*> script);
|
||||
|
||||
|
@ -176,7 +176,7 @@ CompileUtf8(JSContext* cx, const ReadOnlyCompileOptions& options,
|
|||
* compiling them. UTF-8 compilation is currently experimental and has
|
||||
* known bugs. Use only if you're willing to tolerate unspecified bugs!
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileUtf8DontInflate(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
const char* bytes, size_t length, MutableHandle<JSScript*> script);
|
||||
|
||||
|
@ -189,7 +189,7 @@ CompileUtf8DontInflate(JSContext* cx, const ReadOnlyCompileOptions& options,
|
|||
*
|
||||
* |script| is always set to the compiled script or to null in case of error.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileLatin1(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
const char* bytes, size_t length, MutableHandle<JSScript*> script);
|
||||
|
||||
|
@ -199,7 +199,7 @@ CompileLatin1(JSContext* cx, const ReadOnlyCompileOptions& options,
|
|||
*
|
||||
* |script| is always set to the compiled script or to null in case of error.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileUtf8File(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
FILE* file, MutableHandle<JSScript*> script);
|
||||
|
||||
|
@ -213,7 +213,7 @@ CompileUtf8File(JSContext* cx, const ReadOnlyCompileOptions& options,
|
|||
* compiling them. UTF-8 compilation is currently experimental and has
|
||||
* known bugs. Use only if you're willing to tolerate unspecified bugs!
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileUtf8FileDontInflate(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
FILE* file, MutableHandle<JSScript*> script);
|
||||
|
||||
|
@ -224,11 +224,11 @@ CompileUtf8FileDontInflate(JSContext* cx, const ReadOnlyCompileOptions& options,
|
|||
*
|
||||
* |script| is always set to the compiled script or to null in case of error.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileUtf8Path(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
const char* filename, MutableHandle<JSScript*> script);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
SourceText<char16_t>& srcBuf, MutableHandle<JSScript*> script);
|
||||
|
||||
|
@ -239,7 +239,7 @@ CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options
|
|||
* user currently needs it. Such way could be added in the future if it's ever
|
||||
* needed.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileLatin1ForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
const char* bytes, size_t length,
|
||||
MutableHandle<JSScript*> script);
|
||||
|
@ -251,7 +251,7 @@ CompileLatin1ForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& o
|
|||
* objects, followed by the current global of the compartment cx is in. This
|
||||
* global must not be explicitly included in the scope chain.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileFunction(JSContext* cx, AutoVector<JSObject*>& envChain,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const char* name, unsigned nargs, const char* const* argnames,
|
||||
|
@ -260,7 +260,7 @@ CompileFunction(JSContext* cx, AutoVector<JSObject*>& envChain,
|
|||
/**
|
||||
* Same as above, but taking UTF-8 encoded const char* for the function body.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileFunctionUtf8(JSContext* cx, AutoVector<JSObject*>& envChain,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const char* name, unsigned nargs, const char* const* argnames,
|
||||
|
@ -271,7 +271,7 @@ CompileFunctionUtf8(JSContext* cx, AutoVector<JSObject*>& envChain,
|
|||
* script, for debugging purposes. Calling this function is optional, but should
|
||||
* be done before script execution if it is required.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
InitScriptSourceElement(JSContext* cx, Handle<JSScript*> script,
|
||||
Handle<JSObject*> element, Handle<JSString*> elementAttrName = nullptr);
|
||||
|
||||
|
@ -279,7 +279,7 @@ InitScriptSourceElement(JSContext* cx, Handle<JSScript*> script,
|
|||
* For a script compiled with the hideScriptFromDebugger option, expose the
|
||||
* script to the debugger by calling the debugger's onNewScript hook.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
ExposeScriptToDebugger(JSContext* cx, Handle<JSScript*> script);
|
||||
|
||||
} /* namespace JS */
|
||||
|
|
|
@ -82,7 +82,7 @@ enum class AsmJSOption : uint8_t
|
|||
* Use this in code that needs to propagate compile options from one
|
||||
* compilation unit to another.
|
||||
*/
|
||||
class JS_PUBLIC_API(TransitiveCompileOptions)
|
||||
class JS_PUBLIC_API TransitiveCompileOptions
|
||||
{
|
||||
protected:
|
||||
/**
|
||||
|
@ -151,7 +151,7 @@ class JS_PUBLIC_API(TransitiveCompileOptions)
|
|||
void operator=(const TransitiveCompileOptions&) = delete;
|
||||
};
|
||||
|
||||
class JS_PUBLIC_API(CompileOptions);
|
||||
class JS_PUBLIC_API CompileOptions;
|
||||
|
||||
/**
|
||||
* The class representing a full set of compile options.
|
||||
|
@ -161,7 +161,7 @@ class JS_PUBLIC_API(CompileOptions);
|
|||
* is protected anyway); instead, create instances only of the derived classes:
|
||||
* CompileOptions and OwningCompileOptions.
|
||||
*/
|
||||
class JS_PUBLIC_API(ReadOnlyCompileOptions)
|
||||
class JS_PUBLIC_API ReadOnlyCompileOptions
|
||||
: public TransitiveCompileOptions
|
||||
{
|
||||
public:
|
||||
|
@ -228,7 +228,7 @@ class JS_PUBLIC_API(ReadOnlyCompileOptions)
|
|||
* comes to refer to the object that owns this, then the whole cycle, and
|
||||
* anything else it entrains, will never be freed.
|
||||
*/
|
||||
class JS_PUBLIC_API(OwningCompileOptions) final
|
||||
class JS_PUBLIC_API OwningCompileOptions final
|
||||
: public ReadOnlyCompileOptions
|
||||
{
|
||||
PersistentRooted<JSObject*> elementRoot;
|
||||
|
@ -359,7 +359,7 @@ class JS_PUBLIC_API(OwningCompileOptions) final
|
|||
* create an instance of this type, it's up to you to guarantee that
|
||||
* everything you store in it will outlive it.
|
||||
*/
|
||||
class MOZ_STACK_CLASS JS_PUBLIC_API(CompileOptions) final
|
||||
class MOZ_STACK_CLASS JS_PUBLIC_API CompileOptions final
|
||||
: public ReadOnlyCompileOptions
|
||||
{
|
||||
private:
|
||||
|
|
|
@ -26,51 +26,51 @@
|
|||
namespace js {
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToBoolean. */
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ToBooleanSlow(JS::HandleValue v);
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToNumber. */
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ToNumberSlow(JSContext* cx, JS::HandleValue v, double* dp);
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToInt8. */
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ToInt8Slow(JSContext *cx, JS::HandleValue v, int8_t *out);
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToUint8. */
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ToUint8Slow(JSContext *cx, JS::HandleValue v, uint8_t *out);
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToInt16. */
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ToInt16Slow(JSContext *cx, JS::HandleValue v, int16_t *out);
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToInt32. */
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ToInt32Slow(JSContext* cx, JS::HandleValue v, int32_t* out);
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToUint32. */
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ToUint32Slow(JSContext* cx, JS::HandleValue v, uint32_t* out);
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToUint16. */
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ToUint16Slow(JSContext* cx, JS::HandleValue v, uint16_t* out);
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToInt64. */
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ToInt64Slow(JSContext* cx, JS::HandleValue v, int64_t* out);
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToUint64. */
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ToUint64Slow(JSContext* cx, JS::HandleValue v, uint64_t* out);
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToString. */
|
||||
extern JS_PUBLIC_API(JSString*)
|
||||
extern JS_PUBLIC_API JSString*
|
||||
ToStringSlow(JSContext* cx, JS::HandleValue v);
|
||||
|
||||
/* DO NOT CALL THIS. Use JS::ToObject. */
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
ToObjectSlow(JSContext* cx, JS::HandleValue v, bool reportScanStack);
|
||||
|
||||
} // namespace js
|
||||
|
@ -85,7 +85,7 @@ namespace detail {
|
|||
* needed, and that the compartments for cx and v are correct.
|
||||
* Also check that GC would be safe at this point.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
AssertArgumentsAreSane(JSContext* cx, HandleValue v);
|
||||
#else
|
||||
inline void AssertArgumentsAreSane(JSContext* cx, HandleValue v)
|
||||
|
@ -102,7 +102,7 @@ inline void AssertArgumentsAreSane(JSContext* cx, HandleValue v)
|
|||
* wish to fall back to the ES6 default conversion behavior shared by most
|
||||
* objects in JS, codified as OrdinaryToPrimitive.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
OrdinaryToPrimitive(JSContext* cx, HandleObject obj, JSType type, MutableHandleValue vp);
|
||||
|
||||
/* ES6 draft 20141224, 7.1.2. */
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace JS {
|
|||
* operations requiring instantaneous correctness, to guarantee correct
|
||||
* behavior.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
ResetTimeZone();
|
||||
|
||||
class ClippedTime;
|
||||
|
@ -122,7 +122,7 @@ TimeValue(ClippedTime time)
|
|||
// Create a new Date object whose [[DateValue]] internal slot contains the
|
||||
// clipped |time|. (Users who must represent times outside that range must use
|
||||
// another representation.)
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
NewDateObject(JSContext* cx, ClippedTime time);
|
||||
|
||||
// Year is a year, month is 0-11, day is 1-based. The return value is a number
|
||||
|
@ -130,7 +130,7 @@ NewDateObject(JSContext* cx, ClippedTime time);
|
|||
//
|
||||
// Consistent with the MakeDate algorithm defined in ECMAScript, this value is
|
||||
// *not* clipped! Use JS::TimeClip if you need a clipped date.
|
||||
JS_PUBLIC_API(double)
|
||||
JS_PUBLIC_API double
|
||||
MakeDate(double year, unsigned month, unsigned day);
|
||||
|
||||
// Year is a year, month is 0-11, day is 1-based, and time is in milliseconds.
|
||||
|
@ -138,22 +138,22 @@ MakeDate(double year, unsigned month, unsigned day);
|
|||
//
|
||||
// Consistent with the MakeDate algorithm defined in ECMAScript, this value is
|
||||
// *not* clipped! Use JS::TimeClip if you need a clipped date.
|
||||
JS_PUBLIC_API(double)
|
||||
JS_PUBLIC_API double
|
||||
MakeDate(double year, unsigned month, unsigned day, double time);
|
||||
|
||||
// Takes an integer number of milliseconds since the epoch and returns the
|
||||
// year. Can return NaN, and will do so if NaN is passed in.
|
||||
JS_PUBLIC_API(double)
|
||||
JS_PUBLIC_API double
|
||||
YearFromTime(double time);
|
||||
|
||||
// Takes an integer number of milliseconds since the epoch and returns the
|
||||
// month (0-11). Can return NaN, and will do so if NaN is passed in.
|
||||
JS_PUBLIC_API(double)
|
||||
JS_PUBLIC_API double
|
||||
MonthFromTime(double time);
|
||||
|
||||
// Takes an integer number of milliseconds since the epoch and returns the
|
||||
// day (1-based). Can return NaN, and will do so if NaN is passed in.
|
||||
JS_PUBLIC_API(double)
|
||||
JS_PUBLIC_API double
|
||||
DayFromTime(double time);
|
||||
|
||||
// Takes an integer year and returns the number of days from epoch to the given
|
||||
|
@ -162,14 +162,14 @@ DayFromTime(double time);
|
|||
// the ECMAScript specification. Nonfinite years, years containing fractional
|
||||
// components, and years outside ECMAScript's date range are not handled with
|
||||
// any particular intelligence. Garbage in, garbage out.
|
||||
JS_PUBLIC_API(double)
|
||||
JS_PUBLIC_API double
|
||||
DayFromYear(double year);
|
||||
|
||||
// Takes an integer number of milliseconds since the epoch and an integer year,
|
||||
// returns the number of days in that year. If |time| is nonfinite, returns NaN.
|
||||
// Otherwise |time| *must* correspond to a time within the valid year |year|.
|
||||
// This should usually be ensured by computing |year| as |JS::DayFromYear(time)|.
|
||||
JS_PUBLIC_API(double)
|
||||
JS_PUBLIC_API double
|
||||
DayWithinYear(double time, double year);
|
||||
|
||||
// The callback will be a wrapper function that accepts a single double (the time
|
||||
|
@ -179,13 +179,13 @@ using ReduceMicrosecondTimePrecisionCallback = double(*)(double);
|
|||
|
||||
// Set a callback into the toolkit/components/resistfingerprinting function that
|
||||
// will centralize time resolution and jitter into one place.
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
SetReduceMicrosecondTimePrecisionCallback(ReduceMicrosecondTimePrecisionCallback callback);
|
||||
|
||||
// Sets the time resolution for fingerprinting protection, and whether jitter
|
||||
// should occur. If resolution is set to zero, then no rounding or jitter will
|
||||
// occur. This is used if the callback above is not specified.
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
SetTimeResolutionUsec(uint32_t resolution, bool jitter);
|
||||
|
||||
} // namespace JS
|
||||
|
|
|
@ -262,12 +262,12 @@ class BuilderOrigin : public Builder {
|
|||
|
||||
// Tell Debuggers in |cx| to use |mallocSizeOf| to find the size of
|
||||
// malloc'd blocks.
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
SetDebuggerMallocSizeOf(JSContext* cx, mozilla::MallocSizeOf mallocSizeOf);
|
||||
|
||||
// Get the MallocSizeOf function that the given context is using to find the
|
||||
// size of malloc'd blocks.
|
||||
JS_PUBLIC_API(mozilla::MallocSizeOf)
|
||||
JS_PUBLIC_API mozilla::MallocSizeOf
|
||||
GetDebuggerMallocSizeOf(JSContext* cx);
|
||||
|
||||
|
||||
|
@ -285,22 +285,22 @@ GetDebuggerMallocSizeOf(JSContext* cx);
|
|||
// Determine whether it's necessary to call FireOnGarbageCollectionHook() after
|
||||
// a GC. This is only required if there are debuggers with an
|
||||
// onGarbageCollection hook observing a global in the set of collected zones.
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
FireOnGarbageCollectionHookRequired(JSContext* cx);
|
||||
|
||||
// For each Debugger that observed a debuggee involved in the given GC event,
|
||||
// call its `onGarbageCollection` hook.
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
FireOnGarbageCollectionHook(JSContext* cx, GarbageCollectionEvent::Ptr&& data);
|
||||
|
||||
|
||||
// Return true if the given value is a Debugger object, false otherwise.
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
IsDebugger(JSObject& obj);
|
||||
|
||||
// Append each of the debuggee global objects observed by the Debugger object
|
||||
// |dbgObj| to |vector|. Returns true on success, false on failure.
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
GetDebuggeeGlobals(JSContext* cx, JSObject& dbgObj, AutoObjectVector& vector);
|
||||
|
||||
|
||||
|
@ -317,7 +317,7 @@ GetDebuggeeGlobals(JSContext* cx, JSObject& dbgObj, AutoObjectVector& vector);
|
|||
// call the appropriate |Entry| member function to indicate where we've begun
|
||||
// execution.
|
||||
|
||||
class MOZ_STACK_CLASS JS_PUBLIC_API(AutoEntryMonitor) {
|
||||
class MOZ_STACK_CLASS JS_PUBLIC_API AutoEntryMonitor {
|
||||
JSContext* cx_;
|
||||
AutoEntryMonitor* savedMonitor_;
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ class JSErrorNotes
|
|||
JSErrorCallback errorCallback, void* userRef,
|
||||
const unsigned errorNumber, ...);
|
||||
|
||||
JS_PUBLIC_API(size_t) length();
|
||||
JS_PUBLIC_API size_t length();
|
||||
|
||||
// Create a deep copy of notes.
|
||||
js::UniquePtr<JSErrorNotes> copy(JSContext* cx);
|
||||
|
@ -200,8 +200,8 @@ class JSErrorNotes
|
|||
}
|
||||
};
|
||||
|
||||
JS_PUBLIC_API(iterator) begin();
|
||||
JS_PUBLIC_API(iterator) end();
|
||||
JS_PUBLIC_API iterator begin();
|
||||
JS_PUBLIC_API iterator end();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,7 +26,7 @@ struct JSFreeOp;
|
|||
#pragma GCC diagnostic ignored "-Wattributes"
|
||||
#endif // JS_BROKEN_GCC_ATTRIBUTE_WARNING
|
||||
|
||||
class JS_PUBLIC_API(JSTracer);
|
||||
class JS_PUBLIC_API JSTracer;
|
||||
|
||||
#ifdef JS_BROKEN_GCC_ATTRIBUTE_WARNING
|
||||
#pragma GCC diagnostic pop
|
||||
|
@ -416,7 +416,7 @@ enum Reason {
|
|||
/**
|
||||
* Get a statically allocated C string explaining the given GC reason.
|
||||
*/
|
||||
extern JS_PUBLIC_API(const char*)
|
||||
extern JS_PUBLIC_API const char*
|
||||
ExplainReason(JS::gcreason::Reason reason);
|
||||
|
||||
} /* namespace gcreason */
|
||||
|
@ -438,13 +438,13 @@ ExplainReason(JS::gcreason::Reason reason);
|
|||
/**
|
||||
* Schedule the given zone to be collected as part of the next GC.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
PrepareZoneForGC(Zone* zone);
|
||||
|
||||
/**
|
||||
* Schedule all zones to be collected in the next GC.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
PrepareForFullGC(JSContext* cx);
|
||||
|
||||
/**
|
||||
|
@ -452,21 +452,21 @@ PrepareForFullGC(JSContext* cx);
|
|||
* previous incremental slice must be selected in subsequent slices as well.
|
||||
* This function selects those slices automatically.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
PrepareForIncrementalGC(JSContext* cx);
|
||||
|
||||
/**
|
||||
* Returns true if any zone in the system has been scheduled for GC with one of
|
||||
* the functions above or by the JS engine.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsGCScheduled(JSContext* cx);
|
||||
|
||||
/**
|
||||
* Undoes the effect of the Prepare methods above. The given zone will not be
|
||||
* collected in the next GC.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
SkipZoneForGC(Zone* zone);
|
||||
|
||||
/*
|
||||
|
@ -484,7 +484,7 @@ SkipZoneForGC(Zone* zone);
|
|||
* to objects will be cleared and all unreferenced objects will be removed from
|
||||
* the system.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
NonIncrementalGC(JSContext* cx, JSGCInvocationKind gckind, gcreason::Reason reason);
|
||||
|
||||
/*
|
||||
|
@ -516,7 +516,7 @@ NonIncrementalGC(JSContext* cx, JSGCInvocationKind gckind, gcreason::Reason reas
|
|||
* Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or
|
||||
* shorter than the requested interval.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
StartIncrementalGC(JSContext* cx, JSGCInvocationKind gckind, gcreason::Reason reason,
|
||||
int64_t millis = 0);
|
||||
|
||||
|
@ -528,7 +528,7 @@ StartIncrementalGC(JSContext* cx, JSGCInvocationKind gckind, gcreason::Reason re
|
|||
* Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or
|
||||
* shorter than the requested interval.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
IncrementalGCSlice(JSContext* cx, gcreason::Reason reason, int64_t millis = 0);
|
||||
|
||||
/**
|
||||
|
@ -537,7 +537,7 @@ IncrementalGCSlice(JSContext* cx, gcreason::Reason reason, int64_t millis = 0);
|
|||
* this is equivalent to NonIncrementalGC. When this function returns,
|
||||
* IsIncrementalGCInProgress(cx) will always be false.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
FinishIncrementalGC(JSContext* cx, gcreason::Reason reason);
|
||||
|
||||
/**
|
||||
|
@ -546,7 +546,7 @@ FinishIncrementalGC(JSContext* cx, gcreason::Reason reason);
|
|||
* state. This may take an arbitrarily long time. When this function returns,
|
||||
* IsIncrementalGCInProgress(cx) will always be false.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
AbortIncrementalGC(JSContext* cx);
|
||||
|
||||
namespace dbg {
|
||||
|
@ -612,7 +612,7 @@ enum GCProgress {
|
|||
GC_CYCLE_END
|
||||
};
|
||||
|
||||
struct JS_PUBLIC_API(GCDescription) {
|
||||
struct JS_PUBLIC_API GCDescription {
|
||||
bool isZone_;
|
||||
bool isComplete_;
|
||||
JSGCInvocationKind invocationKind_;
|
||||
|
@ -636,7 +636,7 @@ struct JS_PUBLIC_API(GCDescription) {
|
|||
JS::dbg::GarbageCollectionEvent::Ptr toGCEvent(JSContext* cx) const;
|
||||
};
|
||||
|
||||
extern JS_PUBLIC_API(UniqueChars)
|
||||
extern JS_PUBLIC_API UniqueChars
|
||||
MinorGcToJSON(JSContext* cx);
|
||||
|
||||
typedef void
|
||||
|
@ -647,7 +647,7 @@ typedef void
|
|||
* callback may be used for GC notifications as well as to perform additional
|
||||
* marking.
|
||||
*/
|
||||
extern JS_PUBLIC_API(GCSliceCallback)
|
||||
extern JS_PUBLIC_API GCSliceCallback
|
||||
SetGCSliceCallback(JSContext* cx, GCSliceCallback callback);
|
||||
|
||||
/**
|
||||
|
@ -675,7 +675,7 @@ using GCNurseryCollectionCallback = void(*)(JSContext* cx, GCNurseryProgress pro
|
|||
* Set the nursery collection callback for the given runtime. When set, it will
|
||||
* be called at the start and end of every nursery collection.
|
||||
*/
|
||||
extern JS_PUBLIC_API(GCNurseryCollectionCallback)
|
||||
extern JS_PUBLIC_API GCNurseryCollectionCallback
|
||||
SetGCNurseryCollectionCallback(JSContext* cx, GCNurseryCollectionCallback callback);
|
||||
|
||||
typedef void
|
||||
|
@ -685,7 +685,7 @@ typedef void
|
|||
* The purge gray callback is called after any COMPARTMENT_REVIVED GC in which
|
||||
* the majority of compartments have been marked gray.
|
||||
*/
|
||||
extern JS_PUBLIC_API(DoCycleCollectionCallback)
|
||||
extern JS_PUBLIC_API DoCycleCollectionCallback
|
||||
SetDoCycleCollectionCallback(JSContext* cx, DoCycleCollectionCallback callback);
|
||||
|
||||
/**
|
||||
|
@ -694,7 +694,7 @@ SetDoCycleCollectionCallback(JSContext* cx, DoCycleCollectionCallback callback);
|
|||
* There is not currently a way to re-enable incremental GC once it has been
|
||||
* disabled on the runtime.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
DisableIncrementalGC(JSContext* cx);
|
||||
|
||||
/**
|
||||
|
@ -705,27 +705,27 @@ DisableIncrementalGC(JSContext* cx);
|
|||
* GCDescription returned by GCSliceCallback may help narrow down the cause if
|
||||
* collections are not happening incrementally when expected.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsIncrementalGCEnabled(JSContext* cx);
|
||||
|
||||
/**
|
||||
* Returns true while an incremental GC is ongoing, both when actively
|
||||
* collecting and between slices.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsIncrementalGCInProgress(JSContext* cx);
|
||||
|
||||
/**
|
||||
* Returns true while an incremental GC is ongoing, both when actively
|
||||
* collecting and between slices.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsIncrementalGCInProgress(JSRuntime* rt);
|
||||
|
||||
/**
|
||||
* Returns true if the most recent GC ran incrementally.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
WasIncrementalGC(JSRuntime* rt);
|
||||
|
||||
/*
|
||||
|
@ -737,7 +737,7 @@ WasIncrementalGC(JSRuntime* rt);
|
|||
*/
|
||||
|
||||
/** Ensure that generational GC is disabled within some scope. */
|
||||
class JS_PUBLIC_API(AutoDisableGenerationalGC)
|
||||
class JS_PUBLIC_API AutoDisableGenerationalGC
|
||||
{
|
||||
JSContext* cx;
|
||||
|
||||
|
@ -750,7 +750,7 @@ class JS_PUBLIC_API(AutoDisableGenerationalGC)
|
|||
* Returns true if generational allocation and collection is currently enabled
|
||||
* on the given runtime.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsGenerationalGCEnabled(JSRuntime* rt);
|
||||
|
||||
/**
|
||||
|
@ -758,7 +758,7 @@ IsGenerationalGCEnabled(JSRuntime* rt);
|
|||
* never GC. Subclasses can use assertions or the hazard analysis to ensure no
|
||||
* GC happens.
|
||||
*/
|
||||
class JS_PUBLIC_API(AutoRequireNoGC)
|
||||
class JS_PUBLIC_API AutoRequireNoGC
|
||||
{
|
||||
protected:
|
||||
AutoRequireNoGC() {}
|
||||
|
@ -773,7 +773,7 @@ class JS_PUBLIC_API(AutoRequireNoGC)
|
|||
* This works by entering a GC unsafe region, which is checked on allocation and
|
||||
* on GC.
|
||||
*/
|
||||
class JS_PUBLIC_API(AutoAssertNoGC) : public AutoRequireNoGC
|
||||
class JS_PUBLIC_API AutoAssertNoGC : public AutoRequireNoGC
|
||||
{
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
JSContext* cx_;
|
||||
|
@ -805,13 +805,13 @@ class JS_PUBLIC_API(AutoAssertNoGC) : public AutoRequireNoGC
|
|||
* on this class.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
class JS_PUBLIC_API(AutoSuppressGCAnalysis) : public AutoAssertNoGC
|
||||
class JS_PUBLIC_API AutoSuppressGCAnalysis : public AutoAssertNoGC
|
||||
{
|
||||
public:
|
||||
explicit AutoSuppressGCAnalysis(JSContext* cx = nullptr) : AutoAssertNoGC(cx) {}
|
||||
} JS_HAZ_GC_SUPPRESSED;
|
||||
#else
|
||||
class JS_PUBLIC_API(AutoSuppressGCAnalysis) : public AutoRequireNoGC
|
||||
class JS_PUBLIC_API AutoSuppressGCAnalysis : public AutoRequireNoGC
|
||||
{
|
||||
public:
|
||||
explicit AutoSuppressGCAnalysis(JSContext* cx = nullptr) {}
|
||||
|
@ -826,7 +826,7 @@ class JS_PUBLIC_API(AutoSuppressGCAnalysis) : public AutoRequireNoGC
|
|||
* This is useful to make the static analysis ignore code that runs in GC
|
||||
* callbacks.
|
||||
*/
|
||||
class JS_PUBLIC_API(AutoAssertGCCallback) : public AutoSuppressGCAnalysis
|
||||
class JS_PUBLIC_API AutoAssertGCCallback : public AutoSuppressGCAnalysis
|
||||
{
|
||||
public:
|
||||
#ifdef DEBUG
|
||||
|
@ -849,13 +849,13 @@ class JS_PUBLIC_API(AutoAssertGCCallback) : public AutoSuppressGCAnalysis
|
|||
* We only do the assertion checking in DEBUG builds.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
class JS_PUBLIC_API(AutoCheckCannotGC) : public AutoAssertNoGC
|
||||
class JS_PUBLIC_API AutoCheckCannotGC : public AutoAssertNoGC
|
||||
{
|
||||
public:
|
||||
explicit AutoCheckCannotGC(JSContext* cx = nullptr) : AutoAssertNoGC(cx) {}
|
||||
} JS_HAZ_GC_INVALIDATED;
|
||||
#else
|
||||
class JS_PUBLIC_API(AutoCheckCannotGC) : public AutoRequireNoGC
|
||||
class JS_PUBLIC_API AutoCheckCannotGC : public AutoRequireNoGC
|
||||
{
|
||||
public:
|
||||
explicit AutoCheckCannotGC(JSContext* cx = nullptr) {}
|
||||
|
@ -865,7 +865,7 @@ class JS_PUBLIC_API(AutoCheckCannotGC) : public AutoRequireNoGC
|
|||
/*
|
||||
* Internal to Firefox.
|
||||
*/
|
||||
extern JS_FRIEND_API(void)
|
||||
extern JS_FRIEND_API void
|
||||
NotifyGCRootsRemoved(JSContext* cx);
|
||||
|
||||
} /* namespace JS */
|
||||
|
@ -877,30 +877,30 @@ NotifyGCRootsRemoved(JSContext* cx);
|
|||
* JS::TraceEdge whenever the root contains a traceable thing.
|
||||
* data: the data argument to pass to each invocation of traceOp.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_AddExtraGCRootsTracer(JSContext* cx, JSTraceDataOp traceOp, void* data);
|
||||
|
||||
/** Undo a call to JS_AddExtraGCRootsTracer. */
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_RemoveExtraGCRootsTracer(JSContext* cx, JSTraceDataOp traceOp, void* data);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_GC(JSContext* cx);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_MaybeGC(JSContext* cx);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_SetGCCallback(JSContext* cx, JSGCCallback cb, void* data);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_SetObjectsTenuredCallback(JSContext* cx, JSObjectsTenuredCallback cb,
|
||||
void* data);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_AddFinalizeCallback(JSContext* cx, JSFinalizeCallback cb, void* data);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_RemoveFinalizeCallback(JSContext* cx, JSFinalizeCallback cb);
|
||||
|
||||
/*
|
||||
|
@ -937,46 +937,46 @@ JS_RemoveFinalizeCallback(JSContext* cx, JSFinalizeCallback cb);
|
|||
* re-inserted with the correct hash.
|
||||
*/
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_AddWeakPointerZonesCallback(JSContext* cx, JSWeakPointerZonesCallback cb, void* data);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_RemoveWeakPointerZonesCallback(JSContext* cx, JSWeakPointerZonesCallback cb);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_AddWeakPointerCompartmentCallback(JSContext* cx, JSWeakPointerCompartmentCallback cb,
|
||||
void* data);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_RemoveWeakPointerCompartmentCallback(JSContext* cx, JSWeakPointerCompartmentCallback cb);
|
||||
|
||||
namespace JS {
|
||||
template <typename T> class Heap;
|
||||
}
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_UpdateWeakPointerAfterGC(JS::Heap<JSObject*>* objp);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_UpdateWeakPointerAfterGCUnbarriered(JSObject** objp);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_SetGCParameter(JSContext* cx, JSGCParamKey key, uint32_t value);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_ResetGCParameter(JSContext* cx, JSGCParamKey key);
|
||||
|
||||
extern JS_PUBLIC_API(uint32_t)
|
||||
extern JS_PUBLIC_API uint32_t
|
||||
JS_GetGCParameter(JSContext* cx, JSGCParamKey key);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_SetGCParametersBasedOnAvailableMemory(JSContext* cx, uint32_t availMem);
|
||||
|
||||
/**
|
||||
* Create a new JSString whose chars member refers to external memory, i.e.,
|
||||
* memory requiring application-specific finalization.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JSString*)
|
||||
extern JS_PUBLIC_API JSString*
|
||||
JS_NewExternalString(JSContext* cx, const char16_t* chars, size_t length,
|
||||
const JSStringFinalizer* fin);
|
||||
|
||||
|
@ -987,7 +987,7 @@ JS_NewExternalString(JSContext* cx, const char16_t* chars, size_t length,
|
|||
* external string allocated by a previous call and |*allocatedExternal| is set
|
||||
* to false. If |*allocatedExternal| is false, |fin| won't be called.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JSString*)
|
||||
extern JS_PUBLIC_API JSString*
|
||||
JS_NewMaybeExternalString(JSContext* cx, const char16_t* chars, size_t length,
|
||||
const JSStringFinalizer* fin, bool* allocatedExternal);
|
||||
|
||||
|
@ -995,21 +995,21 @@ JS_NewMaybeExternalString(JSContext* cx, const char16_t* chars, size_t length,
|
|||
* Return whether 'str' was created with JS_NewExternalString or
|
||||
* JS_NewExternalStringWithClosure.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_IsExternalString(JSString* str);
|
||||
|
||||
/**
|
||||
* Return the 'fin' arg passed to JS_NewExternalString.
|
||||
*/
|
||||
extern JS_PUBLIC_API(const JSStringFinalizer*)
|
||||
extern JS_PUBLIC_API const JSStringFinalizer*
|
||||
JS_GetExternalStringFinalizer(JSString* str);
|
||||
|
||||
namespace JS {
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsIdleGCTaskNeeded(JSRuntime* rt);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
RunIdleTimeGCTask(JSRuntime* rt);
|
||||
|
||||
} // namespace JS
|
||||
|
@ -1022,7 +1022,7 @@ namespace gc {
|
|||
* of the current state of memory (both GC heap memory and GCthing-controlled
|
||||
* malloc memory.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
NewMemoryInfoObject(JSContext* cx);
|
||||
|
||||
} /* namespace gc */
|
||||
|
|
|
@ -19,7 +19,7 @@ struct JSStringFinalizer;
|
|||
/* These values are private to the JS engine. */
|
||||
namespace js {
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
CurrentThreadCanAccessZone(JS::Zone* zone);
|
||||
|
||||
namespace gc {
|
||||
|
@ -97,7 +97,7 @@ enum class ChunkLocation : uint32_t
|
|||
|
||||
#ifdef JS_DEBUG
|
||||
/* When downcasting, ensure we are actually the right type. */
|
||||
extern JS_FRIEND_API(void)
|
||||
extern JS_FRIEND_API void
|
||||
AssertGCThingHasType(js::gc::Cell* cell, JS::TraceKind kind);
|
||||
#else
|
||||
inline void
|
||||
|
@ -257,7 +257,7 @@ struct Symbol {
|
|||
* is for use when that is not possible because a single pointer must point
|
||||
* to several kinds of GC thing.
|
||||
*/
|
||||
class JS_FRIEND_API(GCCellPtr)
|
||||
class JS_FRIEND_API GCCellPtr
|
||||
{
|
||||
public:
|
||||
// Construction from a void* and trace kind.
|
||||
|
@ -452,14 +452,14 @@ CellIsMarkedGray(const Cell* cell)
|
|||
return TenuredCellIsMarkedGray(cell);
|
||||
}
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CellIsMarkedGrayIfKnown(const Cell* cell);
|
||||
|
||||
#ifdef DEBUG
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CellIsNotGray(const Cell* cell);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ObjectIsMarkedBlack(const JSObject* obj);
|
||||
#endif
|
||||
|
||||
|
@ -532,7 +532,7 @@ GetTenuredGCThingZone(GCCellPtr thing)
|
|||
return js::gc::detail::GetGCThingZone(thing.unsafeAsUIntPtr());
|
||||
}
|
||||
|
||||
extern JS_PUBLIC_API(Zone*)
|
||||
extern JS_PUBLIC_API Zone*
|
||||
GetNurseryStringZone(JSString* str);
|
||||
|
||||
static MOZ_ALWAYS_INLINE Zone*
|
||||
|
@ -544,7 +544,7 @@ GetStringZone(JSString* str)
|
|||
return GetNurseryStringZone(str);
|
||||
}
|
||||
|
||||
extern JS_PUBLIC_API(Zone*)
|
||||
extern JS_PUBLIC_API Zone*
|
||||
GetObjectZone(JSObject* obj);
|
||||
|
||||
static MOZ_ALWAYS_INLINE bool
|
||||
|
@ -556,13 +556,13 @@ GCThingIsMarkedGray(GCCellPtr thing)
|
|||
return js::gc::detail::CellIsMarkedGrayIfKnown(thing.asCell());
|
||||
}
|
||||
|
||||
extern JS_PUBLIC_API(JS::TraceKind)
|
||||
extern JS_PUBLIC_API JS::TraceKind
|
||||
GCThingTraceKind(void* thing);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
EnableNurseryStrings(JSContext* cx);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
DisableNurseryStrings(JSContext* cx);
|
||||
|
||||
/*
|
||||
|
@ -571,21 +571,21 @@ DisableNurseryStrings(JSContext* cx);
|
|||
* mutator code in-between GC slices. At other times, the barrier may be elided
|
||||
* for performance.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsIncrementalBarrierNeeded(JSContext* cx);
|
||||
|
||||
/*
|
||||
* Notify the GC that a reference to a JSObject is about to be overwritten.
|
||||
* This method must be called if IsIncrementalBarrierNeeded.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
IncrementalPreWriteBarrier(JSObject* obj);
|
||||
|
||||
/*
|
||||
* Notify the GC that a weak reference to a GC thing has been read.
|
||||
* This method must be called if IsIncrementalBarrierNeeded.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
IncrementalReadBarrier(GCCellPtr thing);
|
||||
|
||||
/**
|
||||
|
@ -593,7 +593,7 @@ IncrementalReadBarrier(GCCellPtr thing);
|
|||
* JS::TraceKind::Shape. |thing| should be non-null. The return value indicates
|
||||
* if anything was unmarked.
|
||||
*/
|
||||
extern JS_FRIEND_API(bool)
|
||||
extern JS_FRIEND_API bool
|
||||
UnmarkGrayGCThingRecursively(GCCellPtr thing);
|
||||
|
||||
} // namespace JS
|
||||
|
@ -642,7 +642,7 @@ ExposeGCThingToActiveJS(JS::GCCellPtr thing)
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
EdgeNeedsSweepUnbarrieredSlow(T* thingp);
|
||||
|
||||
static MOZ_ALWAYS_INLINE bool
|
||||
|
|
|
@ -81,7 +81,7 @@ JSID_TO_STRING(jsid id)
|
|||
* N.B. if a jsid is backed by a string which has not been interned, that
|
||||
* string must be appropriately rooted to avoid being collected by the GC.
|
||||
*/
|
||||
JS_PUBLIC_API(jsid)
|
||||
JS_PUBLIC_API jsid
|
||||
INTERNED_STRING_TO_JSID(JSContext* cx, JSString* str);
|
||||
|
||||
static MOZ_ALWAYS_INLINE bool
|
||||
|
@ -177,8 +177,8 @@ JSID_IS_EMPTY(const jsid id)
|
|||
constexpr const jsid JSID_VOID;
|
||||
constexpr const jsid JSID_EMPTY = jsid::fromRawBits(JSID_TYPE_EMPTY);
|
||||
|
||||
extern JS_PUBLIC_DATA(const JS::HandleId) JSID_VOIDHANDLE;
|
||||
extern JS_PUBLIC_DATA(const JS::HandleId) JSID_EMPTYHANDLE;
|
||||
extern JS_PUBLIC_DATA const JS::HandleId JSID_VOIDHANDLE;
|
||||
extern JS_PUBLIC_DATA const JS::HandleId JSID_EMPTYHANDLE;
|
||||
|
||||
namespace JS {
|
||||
|
||||
|
|
|
@ -27,10 +27,10 @@ enum class InitState {
|
|||
* manner, so this (internal -- embedders, don't use!) variable doesn't need to
|
||||
* be atomic.
|
||||
*/
|
||||
extern JS_PUBLIC_DATA(InitState)
|
||||
extern JS_PUBLIC_DATA InitState
|
||||
libraryInitState;
|
||||
|
||||
extern JS_PUBLIC_API(const char*)
|
||||
extern JS_PUBLIC_API const char*
|
||||
InitWithFailureDiagnostic(bool isDebugBuild);
|
||||
|
||||
} // namespace detail
|
||||
|
@ -48,7 +48,7 @@ typedef void (*JS_ICUFreeFn)(const void*, void* p);
|
|||
* *must* be called before JS_Init. Don't use it unless you know what you're
|
||||
* doing!
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_SetICUMemoryFunctions(JS_ICUAllocFn allocFn,
|
||||
JS_ICUReallocFn reallocFn,
|
||||
JS_ICUFreeFn freeFn);
|
||||
|
@ -65,7 +65,7 @@ using GMPFreeFn = void (*)(void* p, size_t size);
|
|||
// This function can be used to track memory used by GMP. If it is
|
||||
// called, it *must* be called before JS_Init so that same functions are
|
||||
// used for all allocations.
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
SetGMPMemoryFunctions(GMPAllocFn allocFn,
|
||||
GMPReallocFn reallocFn,
|
||||
GMPFreeFn freeFn);
|
||||
|
@ -144,7 +144,7 @@ JS_IsInitialized(void)
|
|||
* is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so
|
||||
* again). This restriction may eventually be lifted.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_ShutDown(void);
|
||||
|
||||
#endif /* js_Initialization_h */
|
||||
|
|
|
@ -29,7 +29,7 @@ using JSONWriteCallback = bool (*)(const char16_t* buf, uint32_t len, void* data
|
|||
* writing stringified data by repeated calls of |callback|, with each such
|
||||
* call passed |data| as argument.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_Stringify(JSContext* cx, JS::MutableHandle<JS::Value> value, JS::Handle<JSObject*> replacer,
|
||||
JS::Handle<JS::Value> space, JSONWriteCallback callback, void* data);
|
||||
|
||||
|
@ -52,7 +52,7 @@ namespace JS {
|
|||
* NOT attempting to get the "toJSON" property from things, since that could
|
||||
* clearly have side-effects.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ToJSONMaybeSafely(JSContext* cx, JS::Handle<JSObject*> input,
|
||||
JSONWriteCallback callback, void* data);
|
||||
|
||||
|
@ -61,13 +61,13 @@ ToJSONMaybeSafely(JSContext* cx, JS::Handle<JSObject*> input,
|
|||
/**
|
||||
* Performs the JSON.parse operation as specified by ECMAScript.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_ParseJSON(JSContext* cx, const char16_t* chars, uint32_t len, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
/**
|
||||
* Performs the JSON.parse operation as specified by ECMAScript.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_ParseJSON(JSContext* cx, JS::Handle<JSString*> str, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
/**
|
||||
|
@ -75,7 +75,7 @@ JS_ParseJSON(JSContext* cx, JS::Handle<JSString*> str, JS::MutableHandle<JS::Val
|
|||
* given |reviver| argument as the corresponding optional argument to that
|
||||
* function.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_ParseJSONWithReviver(JSContext* cx, const char16_t* chars, uint32_t len,
|
||||
JS::Handle<JS::Value> reviver, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
|
@ -84,7 +84,7 @@ JS_ParseJSONWithReviver(JSContext* cx, const char16_t* chars, uint32_t len,
|
|||
* given |reviver| argument as the corresponding optional argument to that
|
||||
* function.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_ParseJSONWithReviver(JSContext* cx, JS::Handle<JSString*> str, JS::Handle<JS::Value> reviver,
|
||||
JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace JS { union Value; }
|
|||
*
|
||||
* The locale string remains owned by the caller.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
JS_SetDefaultLocale(JSRuntime* rt, const char* locale);
|
||||
|
||||
/**
|
||||
|
@ -43,11 +43,11 @@ JS_SetDefaultLocale(JSRuntime* rt, const char* locale);
|
|||
* XXX Bug 1483961 means it's difficult to interpret the meaning of a null
|
||||
* return value for the time being, and we should fix this!
|
||||
*/
|
||||
extern JS_PUBLIC_API(JS::UniqueChars)
|
||||
extern JS_PUBLIC_API JS::UniqueChars
|
||||
JS_GetDefaultLocale(JSContext* cx);
|
||||
|
||||
/** Reset the default locale to OS defaults. */
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_ResetDefaultLocale(JSRuntime* rt);
|
||||
|
||||
using JSLocaleToUpperCase =
|
||||
|
@ -87,13 +87,13 @@ struct JSLocaleCallbacks
|
|||
* |callbacks| must persist as long as the |JSRuntime|. Pass |nullptr| to
|
||||
* restore default behavior.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_SetLocaleCallbacks(JSRuntime* rt, const JSLocaleCallbacks* callbacks);
|
||||
|
||||
/**
|
||||
* Return the current locale callbacks, which may be nullptr.
|
||||
*/
|
||||
extern JS_PUBLIC_API(const JSLocaleCallbacks*)
|
||||
extern JS_PUBLIC_API const JSLocaleCallbacks*
|
||||
JS_GetLocaleCallbacks(JSRuntime* rt);
|
||||
|
||||
#endif /* js_LocaleSensitive_h */
|
||||
|
|
|
@ -16,27 +16,27 @@
|
|||
|
||||
struct JSContext;
|
||||
|
||||
extern JS_PUBLIC_API(void*)
|
||||
extern JS_PUBLIC_API void*
|
||||
JS_malloc(JSContext* cx, size_t nbytes);
|
||||
|
||||
extern JS_PUBLIC_API(void*)
|
||||
extern JS_PUBLIC_API void*
|
||||
JS_realloc(JSContext* cx, void* p, size_t oldBytes, size_t newBytes);
|
||||
|
||||
/**
|
||||
* A wrapper for |js_free(p)| that may delay |js_free(p)| invocation as a
|
||||
* performance optimization. |cx| may be nullptr.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_free(JSContext* cx, void* p);
|
||||
|
||||
/**
|
||||
* A wrapper for |js_free(p)| that may delay |js_free(p)| invocation as a
|
||||
* performance optimization as specified by the given JSFreeOp instance.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_freeop(JSFreeOp* fop, void* p);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_updateMallocCounter(JSContext* cx, size_t nbytes);
|
||||
|
||||
#endif /* js_MemoryFunctions_h */
|
||||
|
|
|
@ -109,7 +109,7 @@ namespace js {
|
|||
* We need to define this value here, rather than in the code which actually
|
||||
* generates the memory reports, because NotableStringInfo uses this value.
|
||||
*/
|
||||
JS_FRIEND_API(size_t) MemoryReportingSundriesThreshold();
|
||||
JS_FRIEND_API size_t MemoryReportingSundriesThreshold();
|
||||
|
||||
/**
|
||||
* This hash policy avoids flattening ropes (which perturbs the site being
|
||||
|
@ -161,16 +161,16 @@ namespace JS {
|
|||
|
||||
struct ClassInfo
|
||||
{
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(Objects, GCHeapUsed, objectsGCHeap) \
|
||||
macro(Objects, MallocHeap, objectsMallocHeapSlots) \
|
||||
macro(Objects, MallocHeap, objectsMallocHeapElementsNormal) \
|
||||
macro(Objects, MallocHeap, objectsMallocHeapElementsAsmJS) \
|
||||
macro(Objects, MallocHeap, objectsMallocHeapMisc) \
|
||||
macro(Objects, NonHeap, objectsNonHeapElementsNormal) \
|
||||
macro(Objects, NonHeap, objectsNonHeapElementsShared) \
|
||||
macro(Objects, NonHeap, objectsNonHeapElementsWasm) \
|
||||
macro(Objects, NonHeap, objectsNonHeapCodeWasm)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(Objects, GCHeapUsed, objectsGCHeap) \
|
||||
MACRO(Objects, MallocHeap, objectsMallocHeapSlots) \
|
||||
MACRO(Objects, MallocHeap, objectsMallocHeapElementsNormal) \
|
||||
MACRO(Objects, MallocHeap, objectsMallocHeapElementsAsmJS) \
|
||||
MACRO(Objects, MallocHeap, objectsMallocHeapMisc) \
|
||||
MACRO(Objects, NonHeap, objectsNonHeapElementsNormal) \
|
||||
MACRO(Objects, NonHeap, objectsNonHeapElementsShared) \
|
||||
MACRO(Objects, NonHeap, objectsNonHeapElementsWasm) \
|
||||
MACRO(Objects, NonHeap, objectsNonHeapCodeWasm)
|
||||
|
||||
ClassInfo()
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -218,13 +218,13 @@ struct ClassInfo
|
|||
|
||||
struct ShapeInfo
|
||||
{
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(Other, GCHeapUsed, shapesGCHeapTree) \
|
||||
macro(Other, GCHeapUsed, shapesGCHeapDict) \
|
||||
macro(Other, GCHeapUsed, shapesGCHeapBase) \
|
||||
macro(Other, MallocHeap, shapesMallocHeapTreeTables) \
|
||||
macro(Other, MallocHeap, shapesMallocHeapDictTables) \
|
||||
macro(Other, MallocHeap, shapesMallocHeapTreeKids)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(Other, GCHeapUsed, shapesGCHeapTree) \
|
||||
MACRO(Other, GCHeapUsed, shapesGCHeapDict) \
|
||||
MACRO(Other, GCHeapUsed, shapesGCHeapBase) \
|
||||
MACRO(Other, MallocHeap, shapesMallocHeapTreeTables) \
|
||||
MACRO(Other, MallocHeap, shapesMallocHeapDictTables) \
|
||||
MACRO(Other, MallocHeap, shapesMallocHeapTreeKids)
|
||||
|
||||
ShapeInfo()
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -293,12 +293,12 @@ struct NotableClassInfo : public ClassInfo
|
|||
/** Data for tracking JIT-code memory usage. */
|
||||
struct CodeSizes
|
||||
{
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(_, NonHeap, ion) \
|
||||
macro(_, NonHeap, baseline) \
|
||||
macro(_, NonHeap, regexp) \
|
||||
macro(_, NonHeap, other) \
|
||||
macro(_, NonHeap, unused)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(_, NonHeap, ion) \
|
||||
MACRO(_, NonHeap, baseline) \
|
||||
MACRO(_, NonHeap, regexp) \
|
||||
MACRO(_, NonHeap, other) \
|
||||
MACRO(_, NonHeap, unused)
|
||||
|
||||
CodeSizes()
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -320,15 +320,15 @@ struct GCSizes
|
|||
{
|
||||
// |nurseryDecommitted| is marked as NonHeap rather than GCHeapDecommitted
|
||||
// because we don't consider the nursery to be part of the GC heap.
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(_, MallocHeap, marker) \
|
||||
macro(_, NonHeap, nurseryCommitted) \
|
||||
macro(_, MallocHeap, nurseryMallocedBuffers) \
|
||||
macro(_, MallocHeap, storeBufferVals) \
|
||||
macro(_, MallocHeap, storeBufferCells) \
|
||||
macro(_, MallocHeap, storeBufferSlots) \
|
||||
macro(_, MallocHeap, storeBufferWholeCells) \
|
||||
macro(_, MallocHeap, storeBufferGenerics)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(_, MallocHeap, marker) \
|
||||
MACRO(_, NonHeap, nurseryCommitted) \
|
||||
MACRO(_, MallocHeap, nurseryMallocedBuffers) \
|
||||
MACRO(_, MallocHeap, storeBufferVals) \
|
||||
MACRO(_, MallocHeap, storeBufferCells) \
|
||||
MACRO(_, MallocHeap, storeBufferSlots) \
|
||||
MACRO(_, MallocHeap, storeBufferWholeCells) \
|
||||
MACRO(_, MallocHeap, storeBufferGenerics)
|
||||
|
||||
GCSizes()
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -354,11 +354,11 @@ struct GCSizes
|
|||
*/
|
||||
struct StringInfo
|
||||
{
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(Strings, GCHeapUsed, gcHeapLatin1) \
|
||||
macro(Strings, GCHeapUsed, gcHeapTwoByte) \
|
||||
macro(Strings, MallocHeap, mallocHeapLatin1) \
|
||||
macro(Strings, MallocHeap, mallocHeapTwoByte)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(Strings, GCHeapUsed, gcHeapLatin1) \
|
||||
MACRO(Strings, GCHeapUsed, gcHeapTwoByte) \
|
||||
MACRO(Strings, MallocHeap, mallocHeapLatin1) \
|
||||
MACRO(Strings, MallocHeap, mallocHeapTwoByte)
|
||||
|
||||
StringInfo()
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -435,8 +435,8 @@ struct NotableStringInfo : public StringInfo
|
|||
*/
|
||||
struct ScriptSourceInfo
|
||||
{
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(_, MallocHeap, misc)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(_, MallocHeap, misc)
|
||||
|
||||
ScriptSourceInfo()
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -498,11 +498,11 @@ struct NotableScriptSourceInfo : public ScriptSourceInfo
|
|||
|
||||
struct HelperThreadStats
|
||||
{
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(_, MallocHeap, stateData) \
|
||||
macro(_, MallocHeap, parseTask) \
|
||||
macro(_, MallocHeap, ionBuilder) \
|
||||
macro(_, MallocHeap, wasmCompile)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(_, MallocHeap, stateData) \
|
||||
MACRO(_, MallocHeap, parseTask) \
|
||||
MACRO(_, MallocHeap, ionBuilder) \
|
||||
MACRO(_, MallocHeap, wasmCompile)
|
||||
|
||||
explicit HelperThreadStats()
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -523,8 +523,8 @@ struct HelperThreadStats
|
|||
*/
|
||||
struct GlobalStats
|
||||
{
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(_, MallocHeap, tracelogger)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(_, MallocHeap, tracelogger)
|
||||
|
||||
explicit GlobalStats(mozilla::MallocSizeOf mallocSizeOf)
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -546,20 +546,20 @@ struct GlobalStats
|
|||
*/
|
||||
struct RuntimeSizes
|
||||
{
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(_, MallocHeap, object) \
|
||||
macro(_, MallocHeap, atomsTable) \
|
||||
macro(_, MallocHeap, atomsMarkBitmaps) \
|
||||
macro(_, MallocHeap, contexts) \
|
||||
macro(_, MallocHeap, temporary) \
|
||||
macro(_, MallocHeap, interpreterStack) \
|
||||
macro(_, MallocHeap, sharedImmutableStringsCache) \
|
||||
macro(_, MallocHeap, sharedIntlData) \
|
||||
macro(_, MallocHeap, uncompressedSourceCache) \
|
||||
macro(_, MallocHeap, scriptData) \
|
||||
macro(_, MallocHeap, tracelogger) \
|
||||
macro(_, MallocHeap, wasmRuntime) \
|
||||
macro(_, MallocHeap, jitLazyLink)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(_, MallocHeap, object) \
|
||||
MACRO(_, MallocHeap, atomsTable) \
|
||||
MACRO(_, MallocHeap, atomsMarkBitmaps) \
|
||||
MACRO(_, MallocHeap, contexts) \
|
||||
MACRO(_, MallocHeap, temporary) \
|
||||
MACRO(_, MallocHeap, interpreterStack) \
|
||||
MACRO(_, MallocHeap, sharedImmutableStringsCache) \
|
||||
MACRO(_, MallocHeap, sharedIntlData) \
|
||||
MACRO(_, MallocHeap, uncompressedSourceCache) \
|
||||
MACRO(_, MallocHeap, scriptData) \
|
||||
MACRO(_, MallocHeap, tracelogger) \
|
||||
MACRO(_, MallocHeap, wasmRuntime) \
|
||||
MACRO(_, MallocHeap, jitLazyLink)
|
||||
|
||||
RuntimeSizes()
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -613,19 +613,19 @@ struct RuntimeSizes
|
|||
|
||||
struct UnusedGCThingSizes
|
||||
{
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(Other, GCHeapUnused, object) \
|
||||
macro(Other, GCHeapUnused, script) \
|
||||
macro(Other, GCHeapUnused, lazyScript) \
|
||||
macro(Other, GCHeapUnused, shape) \
|
||||
macro(Other, GCHeapUnused, baseShape) \
|
||||
macro(Other, GCHeapUnused, objectGroup) \
|
||||
macro(Other, GCHeapUnused, string) \
|
||||
macro(Other, GCHeapUnused, symbol) \
|
||||
IF_BIGINT(macro(Other, GCHeapUnused, bigInt),) \
|
||||
macro(Other, GCHeapUnused, jitcode) \
|
||||
macro(Other, GCHeapUnused, scope) \
|
||||
macro(Other, GCHeapUnused, regExpShared)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(Other, GCHeapUnused, object) \
|
||||
MACRO(Other, GCHeapUnused, script) \
|
||||
MACRO(Other, GCHeapUnused, lazyScript) \
|
||||
MACRO(Other, GCHeapUnused, shape) \
|
||||
MACRO(Other, GCHeapUnused, baseShape) \
|
||||
MACRO(Other, GCHeapUnused, objectGroup) \
|
||||
MACRO(Other, GCHeapUnused, string) \
|
||||
MACRO(Other, GCHeapUnused, symbol) \
|
||||
IF_BIGINT(MACRO(Other, GCHeapUnused, bigInt),) \
|
||||
MACRO(Other, GCHeapUnused, jitcode) \
|
||||
MACRO(Other, GCHeapUnused, scope) \
|
||||
MACRO(Other, GCHeapUnused, regExpShared)
|
||||
|
||||
UnusedGCThingSizes()
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -684,30 +684,30 @@ struct UnusedGCThingSizes
|
|||
|
||||
struct ZoneStats
|
||||
{
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(Other, GCHeapUsed, symbolsGCHeap) \
|
||||
IF_BIGINT(macro(Other, GCHeapUsed, bigIntsGCHeap),) \
|
||||
IF_BIGINT(macro(Other, MallocHeap, bigIntsMallocHeap),) \
|
||||
macro(Other, GCHeapAdmin, gcHeapArenaAdmin) \
|
||||
macro(Other, GCHeapUsed, lazyScriptsGCHeap) \
|
||||
macro(Other, MallocHeap, lazyScriptsMallocHeap) \
|
||||
macro(Other, GCHeapUsed, jitCodesGCHeap) \
|
||||
macro(Other, GCHeapUsed, objectGroupsGCHeap) \
|
||||
macro(Other, MallocHeap, objectGroupsMallocHeap) \
|
||||
macro(Other, GCHeapUsed, scopesGCHeap) \
|
||||
macro(Other, MallocHeap, scopesMallocHeap) \
|
||||
macro(Other, GCHeapUsed, regExpSharedsGCHeap) \
|
||||
macro(Other, MallocHeap, regExpSharedsMallocHeap) \
|
||||
macro(Other, MallocHeap, typePool) \
|
||||
macro(Other, MallocHeap, regexpZone) \
|
||||
macro(Other, MallocHeap, jitZone) \
|
||||
macro(Other, MallocHeap, baselineStubsOptimized) \
|
||||
macro(Other, MallocHeap, cachedCFG) \
|
||||
macro(Other, MallocHeap, uniqueIdMap) \
|
||||
macro(Other, MallocHeap, shapeTables) \
|
||||
macro(Other, MallocHeap, compartmentObjects) \
|
||||
macro(Other, MallocHeap, crossCompartmentWrappersTables) \
|
||||
macro(Other, MallocHeap, compartmentsPrivateData)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(Other, GCHeapUsed, symbolsGCHeap) \
|
||||
IF_BIGINT(MACRO(Other, GCHeapUsed, bigIntsGCHeap),) \
|
||||
IF_BIGINT(MACRO(Other, MallocHeap, bigIntsMallocHeap),) \
|
||||
MACRO(Other, GCHeapAdmin, gcHeapArenaAdmin) \
|
||||
MACRO(Other, GCHeapUsed, lazyScriptsGCHeap) \
|
||||
MACRO(Other, MallocHeap, lazyScriptsMallocHeap) \
|
||||
MACRO(Other, GCHeapUsed, jitCodesGCHeap) \
|
||||
MACRO(Other, GCHeapUsed, objectGroupsGCHeap) \
|
||||
MACRO(Other, MallocHeap, objectGroupsMallocHeap) \
|
||||
MACRO(Other, GCHeapUsed, scopesGCHeap) \
|
||||
MACRO(Other, MallocHeap, scopesMallocHeap) \
|
||||
MACRO(Other, GCHeapUsed, regExpSharedsGCHeap) \
|
||||
MACRO(Other, MallocHeap, regExpSharedsMallocHeap) \
|
||||
MACRO(Other, MallocHeap, typePool) \
|
||||
MACRO(Other, MallocHeap, regexpZone) \
|
||||
MACRO(Other, MallocHeap, jitZone) \
|
||||
MACRO(Other, MallocHeap, baselineStubsOptimized) \
|
||||
MACRO(Other, MallocHeap, cachedCFG) \
|
||||
MACRO(Other, MallocHeap, uniqueIdMap) \
|
||||
MACRO(Other, MallocHeap, shapeTables) \
|
||||
MACRO(Other, MallocHeap, compartmentObjects) \
|
||||
MACRO(Other, MallocHeap, crossCompartmentWrappersTables) \
|
||||
MACRO(Other, MallocHeap, compartmentsPrivateData)
|
||||
|
||||
ZoneStats()
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -807,27 +807,27 @@ struct RealmStats
|
|||
// actually guaranteed. But for Servo, at least, it's a moot point because
|
||||
// it doesn't provide an ObjectPrivateVisitor so the value will always be
|
||||
// zero.
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(Private, MallocHeap, objectsPrivate) \
|
||||
macro(Other, GCHeapUsed, scriptsGCHeap) \
|
||||
macro(Other, MallocHeap, scriptsMallocHeapData) \
|
||||
macro(Other, MallocHeap, baselineData) \
|
||||
macro(Other, MallocHeap, baselineStubsFallback) \
|
||||
macro(Other, MallocHeap, ionData) \
|
||||
macro(Other, MallocHeap, typeInferenceTypeScripts) \
|
||||
macro(Other, MallocHeap, typeInferenceAllocationSiteTables) \
|
||||
macro(Other, MallocHeap, typeInferenceArrayTypeTables) \
|
||||
macro(Other, MallocHeap, typeInferenceObjectTypeTables) \
|
||||
macro(Other, MallocHeap, realmObject) \
|
||||
macro(Other, MallocHeap, realmTables) \
|
||||
macro(Other, MallocHeap, innerViewsTable) \
|
||||
macro(Other, MallocHeap, lazyArrayBuffersTable) \
|
||||
macro(Other, MallocHeap, objectMetadataTable) \
|
||||
macro(Other, MallocHeap, savedStacksSet) \
|
||||
macro(Other, MallocHeap, varNamesSet) \
|
||||
macro(Other, MallocHeap, nonSyntacticLexicalScopesTable) \
|
||||
macro(Other, MallocHeap, jitRealm) \
|
||||
macro(Other, MallocHeap, scriptCountsMap)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(Private, MallocHeap, objectsPrivate) \
|
||||
MACRO(Other, GCHeapUsed, scriptsGCHeap) \
|
||||
MACRO(Other, MallocHeap, scriptsMallocHeapData) \
|
||||
MACRO(Other, MallocHeap, baselineData) \
|
||||
MACRO(Other, MallocHeap, baselineStubsFallback) \
|
||||
MACRO(Other, MallocHeap, ionData) \
|
||||
MACRO(Other, MallocHeap, typeInferenceTypeScripts) \
|
||||
MACRO(Other, MallocHeap, typeInferenceAllocationSiteTables) \
|
||||
MACRO(Other, MallocHeap, typeInferenceArrayTypeTables) \
|
||||
MACRO(Other, MallocHeap, typeInferenceObjectTypeTables) \
|
||||
MACRO(Other, MallocHeap, realmObject) \
|
||||
MACRO(Other, MallocHeap, realmTables) \
|
||||
MACRO(Other, MallocHeap, innerViewsTable) \
|
||||
MACRO(Other, MallocHeap, lazyArrayBuffersTable) \
|
||||
MACRO(Other, MallocHeap, objectMetadataTable) \
|
||||
MACRO(Other, MallocHeap, savedStacksSet) \
|
||||
MACRO(Other, MallocHeap, varNamesSet) \
|
||||
MACRO(Other, MallocHeap, nonSyntacticLexicalScopesTable) \
|
||||
MACRO(Other, MallocHeap, jitRealm) \
|
||||
MACRO(Other, MallocHeap, scriptCountsMap)
|
||||
|
||||
RealmStats()
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -916,13 +916,13 @@ struct RuntimeStats
|
|||
// values from the zones and compartments. Both of those values are not
|
||||
// reported directly, but are just present for sanity-checking other
|
||||
// values.
|
||||
#define FOR_EACH_SIZE(macro) \
|
||||
macro(_, Ignore, gcHeapChunkTotal) \
|
||||
macro(_, GCHeapDecommitted, gcHeapDecommittedArenas) \
|
||||
macro(_, GCHeapUnused, gcHeapUnusedChunks) \
|
||||
macro(_, GCHeapUnused, gcHeapUnusedArenas) \
|
||||
macro(_, GCHeapAdmin, gcHeapChunkAdmin) \
|
||||
macro(_, Ignore, gcHeapGCThings)
|
||||
#define FOR_EACH_SIZE(MACRO) \
|
||||
MACRO(_, Ignore, gcHeapChunkTotal) \
|
||||
MACRO(_, GCHeapDecommitted, gcHeapDecommittedArenas) \
|
||||
MACRO(_, GCHeapUnused, gcHeapUnusedChunks) \
|
||||
MACRO(_, GCHeapUnused, gcHeapUnusedArenas) \
|
||||
MACRO(_, GCHeapAdmin, gcHeapChunkAdmin) \
|
||||
MACRO(_, Ignore, gcHeapGCThings)
|
||||
|
||||
explicit RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)
|
||||
: FOR_EACH_SIZE(ZERO_SIZE)
|
||||
|
@ -997,26 +997,26 @@ class ObjectPrivateVisitor
|
|||
{}
|
||||
};
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CollectGlobalStats(GlobalStats* gStats);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CollectRuntimeStats(JSContext* cx, RuntimeStats* rtStats, ObjectPrivateVisitor* opv, bool anonymize);
|
||||
|
||||
extern JS_PUBLIC_API(size_t)
|
||||
extern JS_PUBLIC_API size_t
|
||||
SystemRealmCount(JSContext* cx);
|
||||
|
||||
extern JS_PUBLIC_API(size_t)
|
||||
extern JS_PUBLIC_API size_t
|
||||
UserRealmCount(JSContext* cx);
|
||||
|
||||
extern JS_PUBLIC_API(size_t)
|
||||
extern JS_PUBLIC_API size_t
|
||||
PeakSizeOfTemporary(const JSContext* cx);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
AddSizeOfTab(JSContext* cx, JS::HandleObject obj, mozilla::MallocSizeOf mallocSizeOf,
|
||||
ObjectPrivateVisitor* opv, TabSizes* sizes);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
AddServoSizeOf(JSContext* cx, mozilla::MallocSizeOf mallocSizeOf,
|
||||
ObjectPrivateVisitor* opv, ServoSizes* sizes);
|
||||
|
||||
|
|
|
@ -37,10 +37,10 @@ class OffThreadToken;
|
|||
|
||||
using OffThreadCompileCallback = void (*)(OffThreadToken* token, void* callbackData);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CanCompileOffThread(JSContext* cx, const ReadOnlyCompileOptions& options, size_t length);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CanDecodeOffThread(JSContext* cx, const ReadOnlyCompileOptions& options, size_t length);
|
||||
|
||||
/*
|
||||
|
@ -60,59 +60,59 @@ CanDecodeOffThread(JSContext* cx, const ReadOnlyCompileOptions& options, size_t
|
|||
* to FinishOffThreadScript.
|
||||
*/
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileOffThread(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
SourceText<char16_t>& srcBuf, OffThreadCompileCallback callback,
|
||||
void* callbackData);
|
||||
|
||||
extern JS_PUBLIC_API(JSScript*)
|
||||
extern JS_PUBLIC_API JSScript*
|
||||
FinishOffThreadScript(JSContext* cx, OffThreadToken* token);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
CancelOffThreadScript(JSContext* cx, OffThreadToken* token);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CompileOffThreadModule(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
SourceText<char16_t>& srcBuf, OffThreadCompileCallback callback,
|
||||
void* callbackData);
|
||||
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
FinishOffThreadModule(JSContext* cx, OffThreadToken* token);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
CancelOffThreadModule(JSContext* cx, OffThreadToken* token);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
DecodeOffThreadScript(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
mozilla::Vector<uint8_t>& buffer /* TranscodeBuffer& */, size_t cursor,
|
||||
OffThreadCompileCallback callback, void* callbackData);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
DecodeOffThreadScript(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
const mozilla::Range<uint8_t>& range /* TranscodeRange& */,
|
||||
OffThreadCompileCallback callback, void* callbackData);
|
||||
|
||||
extern JS_PUBLIC_API(JSScript*)
|
||||
extern JS_PUBLIC_API JSScript*
|
||||
FinishOffThreadScriptDecoder(JSContext* cx, OffThreadToken* token);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
CancelOffThreadScriptDecoder(JSContext* cx, OffThreadToken* token);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
DecodeMultiOffThreadScripts(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
mozilla::Vector<TranscodeSource>& sources,
|
||||
OffThreadCompileCallback callback, void* callbackData);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
FinishMultiOffThreadScriptsDecoder(JSContext* cx, OffThreadToken* token,
|
||||
MutableHandle<GCVector<JSScript*>> scripts);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
CancelMultiOffThreadScriptsDecoder(JSContext* cx, OffThreadToken* token);
|
||||
|
||||
#if defined(JS_BUILD_BINAST)
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
CanDecodeBinASTOffThread(JSContext* cx, const ReadOnlyCompileOptions& options, size_t length);
|
||||
|
||||
#endif // defined(JS_BUILD_BINAST)
|
||||
|
|
|
@ -19,7 +19,7 @@ struct JSStructuredCloneReader;
|
|||
struct JSStructuredCloneWriter;
|
||||
|
||||
namespace js {
|
||||
struct JS_PUBLIC_API(PerformanceGroup);
|
||||
struct JS_PUBLIC_API PerformanceGroup;
|
||||
} // namespace js
|
||||
|
||||
struct JSPrincipals {
|
||||
|
@ -51,13 +51,13 @@ struct JSPrincipals {
|
|||
* This is not defined by the JS engine but should be provided by the
|
||||
* embedding.
|
||||
*/
|
||||
JS_PUBLIC_API(void) dump();
|
||||
JS_PUBLIC_API void dump();
|
||||
};
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_HoldPrincipals(JSPrincipals* principals);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_DropPrincipals(JSContext* cx, JSPrincipals* principals);
|
||||
|
||||
// Return whether the first principal subsumes the second. The exact meaning of
|
||||
|
@ -78,10 +78,10 @@ struct JSSecurityCallbacks {
|
|||
JSSubsumesOp subsumes;
|
||||
};
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_SetSecurityCallbacks(JSContext* cx, const JSSecurityCallbacks* callbacks);
|
||||
|
||||
extern JS_PUBLIC_API(const JSSecurityCallbacks*)
|
||||
extern JS_PUBLIC_API const JSSecurityCallbacks*
|
||||
JS_GetSecurityCallbacks(JSContext* cx);
|
||||
|
||||
/*
|
||||
|
@ -96,7 +96,7 @@ JS_GetSecurityCallbacks(JSContext* cx);
|
|||
* 'cx', JS_SetTrustedPrincipals must be called again, passing nullptr for
|
||||
* 'prin'.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_SetTrustedPrincipals(JSContext* cx, JSPrincipals* prin);
|
||||
|
||||
typedef void
|
||||
|
@ -107,7 +107,7 @@ typedef void
|
|||
* when its reference counter drops to zero. The initialization can be done
|
||||
* only once per JS runtime.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_InitDestroyPrincipalsCallback(JSContext* cx, JSDestroyPrincipalsOp destroyPrincipals);
|
||||
|
||||
/*
|
||||
|
@ -128,7 +128,7 @@ using JSReadPrincipalsOp = bool (*)(JSContext* cx, JSStructuredCloneReader* read
|
|||
* Initialize the callback that is called to read JSPrincipals instances from a
|
||||
* buffer. The initialization can be done only once per JS runtime.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_InitReadPrincipalsCallback(JSContext* cx, JSReadPrincipalsOp read);
|
||||
|
||||
|
||||
|
|
|
@ -17,17 +17,17 @@
|
|||
/* Wrappers for mozilla::Smprintf and friends that are used throughout
|
||||
JS. */
|
||||
|
||||
extern JS_PUBLIC_API(JS::UniqueChars) JS_smprintf(const char* fmt, ...)
|
||||
extern JS_PUBLIC_API JS::UniqueChars JS_smprintf(const char* fmt, ...)
|
||||
MOZ_FORMAT_PRINTF(1, 2);
|
||||
|
||||
extern JS_PUBLIC_API(JS::UniqueChars) JS_sprintf_append(JS::UniqueChars&& last,
|
||||
const char* fmt, ...)
|
||||
extern JS_PUBLIC_API JS::UniqueChars JS_sprintf_append(JS::UniqueChars&& last,
|
||||
const char* fmt, ...)
|
||||
MOZ_FORMAT_PRINTF(2, 3);
|
||||
|
||||
extern JS_PUBLIC_API(JS::UniqueChars) JS_vsmprintf(const char* fmt, va_list ap)
|
||||
extern JS_PUBLIC_API JS::UniqueChars JS_vsmprintf(const char* fmt, va_list ap)
|
||||
MOZ_FORMAT_PRINTF(1, 0);
|
||||
extern JS_PUBLIC_API(JS::UniqueChars) JS_vsprintf_append(JS::UniqueChars&& last,
|
||||
const char* fmt, va_list ap)
|
||||
extern JS_PUBLIC_API JS::UniqueChars JS_vsprintf_append(JS::UniqueChars&& last,
|
||||
const char* fmt, va_list ap)
|
||||
MOZ_FORMAT_PRINTF(2, 0);
|
||||
|
||||
#endif /* js_Printf_h */
|
||||
|
|
|
@ -39,7 +39,7 @@ struct ForEachTrackedOptimizationTypeInfoOp;
|
|||
// Note that the caller must not do anything that could cause GC to happen while
|
||||
// the iterator is alive, since this could invalidate Ion code and cause its
|
||||
// contents to become out of date.
|
||||
class MOZ_NON_PARAM JS_PUBLIC_API(ProfilingFrameIterator)
|
||||
class MOZ_NON_PARAM JS_PUBLIC_API ProfilingFrameIterator
|
||||
{
|
||||
public:
|
||||
enum class Kind : bool {
|
||||
|
@ -141,7 +141,7 @@ class MOZ_NON_PARAM JS_PUBLIC_API(ProfilingFrameIterator)
|
|||
bool iteratorDone();
|
||||
} JS_HAZ_GC_INVALIDATED;
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
IsProfilingEnabledForContext(JSContext* cx);
|
||||
|
||||
/**
|
||||
|
@ -152,7 +152,7 @@ IsProfilingEnabledForContext(JSContext* cx);
|
|||
* See the field |profilerSampleBufferRangeStart| on JSRuntime for documentation
|
||||
* about what this value is used for.
|
||||
*/
|
||||
JS_FRIEND_API(void)
|
||||
JS_FRIEND_API void
|
||||
SetJSContextProfilerSampleBufferRangeStart(JSContext* cx, uint64_t rangeStart);
|
||||
|
||||
class ProfiledFrameRange;
|
||||
|
@ -182,12 +182,12 @@ public:
|
|||
bool hasTrackedOptimizations() const { return optsIndex_.isSome(); }
|
||||
void* canonicalAddress() const { return canonicalAddr_; }
|
||||
|
||||
JS_PUBLIC_API(ProfilingFrameIterator::FrameKind) frameKind() const;
|
||||
JS_PUBLIC_API(void) forEachOptimizationAttempt(ForEachTrackedOptimizationAttemptOp& op,
|
||||
JSScript** scriptOut,
|
||||
jsbytecode** pcOut) const;
|
||||
JS_PUBLIC_API ProfilingFrameIterator::FrameKind frameKind() const;
|
||||
JS_PUBLIC_API void forEachOptimizationAttempt(ForEachTrackedOptimizationAttemptOp& op,
|
||||
JSScript** scriptOut,
|
||||
jsbytecode** pcOut) const;
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
forEachOptimizationTypeInfo(ForEachTrackedOptimizationTypeInfoOp& op) const;
|
||||
};
|
||||
|
||||
|
@ -202,7 +202,7 @@ public:
|
|||
, index_(index)
|
||||
{}
|
||||
|
||||
JS_PUBLIC_API(ProfiledFrameHandle) operator*() const;
|
||||
JS_PUBLIC_API ProfiledFrameHandle operator*() const;
|
||||
|
||||
// Provide the bare minimum of iterator methods that are needed for
|
||||
// C++ ranged for loops.
|
||||
|
@ -219,8 +219,8 @@ public:
|
|||
Iter end() const { return Iter(*this, depth_); }
|
||||
|
||||
private:
|
||||
friend JS_PUBLIC_API(ProfiledFrameRange) GetProfiledFrames(JSContext* cx,
|
||||
void* addr);
|
||||
friend JS_PUBLIC_API ProfiledFrameRange GetProfiledFrames(JSContext* cx,
|
||||
void* addr);
|
||||
|
||||
ProfiledFrameRange(JSRuntime* rt, void* addr, js::jit::JitcodeGlobalEntry* entry)
|
||||
: rt_(rt)
|
||||
|
@ -238,7 +238,7 @@ private:
|
|||
};
|
||||
|
||||
// Returns a range that can be iterated over using C++ ranged for loops.
|
||||
JS_PUBLIC_API(ProfiledFrameRange)
|
||||
JS_PUBLIC_API ProfiledFrameRange
|
||||
GetProfiledFrames(JSContext* cx, void* addr);
|
||||
|
||||
} // namespace JS
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#pragma GCC diagnostic ignored "-Wattributes"
|
||||
#endif // JS_BROKEN_GCC_ATTRIBUTE_WARNING
|
||||
|
||||
class JS_PUBLIC_API(JSTracer);
|
||||
class JS_PUBLIC_API JSTracer;
|
||||
|
||||
#ifdef JS_BROKEN_GCC_ATTRIBUTE_WARNING
|
||||
#pragma GCC diagnostic pop
|
||||
|
@ -320,7 +320,7 @@ class ProfilingStackFrame
|
|||
return spOrScript;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSScript*) script() const;
|
||||
JS_PUBLIC_API JSScript* script() const;
|
||||
|
||||
// Note that the pointer returned might be invalid.
|
||||
JSScript* rawScript() const {
|
||||
|
@ -330,7 +330,7 @@ class ProfilingStackFrame
|
|||
}
|
||||
|
||||
// We can't know the layout of JSScript, so look in vm/GeckoProfiler.cpp.
|
||||
JS_FRIEND_API(jsbytecode*) pc() const;
|
||||
JS_FRIEND_API jsbytecode* pc() const;
|
||||
void setPC(jsbytecode* pc);
|
||||
|
||||
void trace(JSTracer* trc);
|
||||
|
@ -341,15 +341,15 @@ class ProfilingStackFrame
|
|||
static const int32_t NullPCOffset = -1;
|
||||
};
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
JS_FRIEND_API void
|
||||
SetContextProfilingStack(JSContext* cx, ProfilingStack* profilingStack);
|
||||
|
||||
// GetContextProfilingStack also exists, but it's defined in RootingAPI.h.
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
JS_FRIEND_API void
|
||||
EnableContextProfilingStack(JSContext* cx, bool enabled);
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
JS_FRIEND_API void
|
||||
RegisterContextProfilingEventMarker(JSContext* cx, void (*fn)(const char*));
|
||||
|
||||
} // namespace js
|
||||
|
@ -362,7 +362,7 @@ typedef ProfilingStack*
|
|||
typedef void
|
||||
(* UnregisterThreadCallback)();
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
JS_FRIEND_API void
|
||||
SetProfilingThreadCallbacks(RegisterThreadCallback registerThread,
|
||||
UnregisterThreadCallback unregisterThread);
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
/* A higher-order macro for enumerating all JSProtoKey values. */
|
||||
/*
|
||||
* Consumers define macros as follows:
|
||||
* macro(name, init, clasp)
|
||||
* MACRO(name, init, clasp)
|
||||
* name: The canonical name of the class.
|
||||
* init: Initialization function. These are |extern "C";|, and clients should use
|
||||
* |extern "C" {}| as appropriate when using this macro.
|
||||
|
@ -24,102 +24,111 @@
|
|||
* in order to maintain binary XDR compatibility, but we need to provide a tool
|
||||
* to handle them differently. JS_FOR_PROTOTYPES fills this niche.
|
||||
*
|
||||
* Consumers pass two macros to JS_FOR_PROTOTYPES - |real| and |imaginary|. The
|
||||
* Consumers pass two macros to JS_FOR_PROTOTYPES - |REAL| and |IMAGINARY|. The
|
||||
* former is invoked for entries that have real client-exposed constructors, and
|
||||
* the latter is called for the rest. Consumers that don't care about this
|
||||
* distinction can simply pass the same macro to both, which is exactly what
|
||||
* JS_FOR_EACH_PROTOTYPE does.
|
||||
*/
|
||||
|
||||
#define CLASP(name) (&name##Class)
|
||||
#define OCLASP(name) (&name##Object::class_)
|
||||
#define TYPED_ARRAY_CLASP(type) (&TypedArrayObject::classes[Scalar::type])
|
||||
#define ERROR_CLASP(type) (&ErrorObject::classes[type])
|
||||
#define CLASP(NAME) (&NAME##Class)
|
||||
#define OCLASP(NAME) (&NAME##Object::class_)
|
||||
#define TYPED_ARRAY_CLASP(TYPE) (&TypedArrayObject::classes[Scalar::TYPE])
|
||||
#define ERROR_CLASP(TYPE) (&ErrorObject::classes[TYPE])
|
||||
|
||||
#ifdef EXPOSE_INTL_API
|
||||
#define IF_INTL(real,imaginary) real
|
||||
#define IF_INTL(REAL,IMAGINARY) REAL
|
||||
#else
|
||||
#define IF_INTL(real,imaginary) imaginary
|
||||
#define IF_INTL(REAL,IMAGINARY) IMAGINARY
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_BINARYDATA
|
||||
#define IF_BDATA(real,imaginary) real
|
||||
#define IF_BDATA(REAL,IMAGINARY) REAL
|
||||
#else
|
||||
#define IF_BDATA(real,imaginary) imaginary
|
||||
#define IF_BDATA(REAL,IMAGINARY) IMAGINARY
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SHARED_ARRAY_BUFFER
|
||||
#define IF_SAB(real,imaginary) real
|
||||
#define IF_SAB(REAL,IMAGINARY) REAL
|
||||
#else
|
||||
#define IF_SAB(real,imaginary) imaginary
|
||||
#define IF_SAB(REAL,IMAGINARY) IMAGINARY
|
||||
#endif
|
||||
|
||||
#define JS_FOR_PROTOTYPES(real,imaginary) \
|
||||
imaginary(Null, InitNullClass, dummy) \
|
||||
real(Object, InitViaClassSpec, OCLASP(Plain)) \
|
||||
real(Function, InitViaClassSpec, &JSFunction::class_) \
|
||||
real(Array, InitViaClassSpec, OCLASP(Array)) \
|
||||
real(Boolean, InitBooleanClass, OCLASP(Boolean)) \
|
||||
real(JSON, InitJSONClass, CLASP(JSON)) \
|
||||
real(Date, InitViaClassSpec, OCLASP(Date)) \
|
||||
real(Math, InitMathClass, CLASP(Math)) \
|
||||
real(Number, InitNumberClass, OCLASP(Number)) \
|
||||
real(String, InitStringClass, OCLASP(String)) \
|
||||
real(RegExp, InitViaClassSpec, OCLASP(RegExp)) \
|
||||
real(Error, InitViaClassSpec, ERROR_CLASP(JSEXN_ERR)) \
|
||||
real(InternalError, InitViaClassSpec, ERROR_CLASP(JSEXN_INTERNALERR)) \
|
||||
real(EvalError, InitViaClassSpec, ERROR_CLASP(JSEXN_EVALERR)) \
|
||||
real(RangeError, InitViaClassSpec, ERROR_CLASP(JSEXN_RANGEERR)) \
|
||||
real(ReferenceError, InitViaClassSpec, ERROR_CLASP(JSEXN_REFERENCEERR)) \
|
||||
real(SyntaxError, InitViaClassSpec, ERROR_CLASP(JSEXN_SYNTAXERR)) \
|
||||
real(TypeError, InitViaClassSpec, ERROR_CLASP(JSEXN_TYPEERR)) \
|
||||
real(URIError, InitViaClassSpec, ERROR_CLASP(JSEXN_URIERR)) \
|
||||
real(DebuggeeWouldRun, InitViaClassSpec, ERROR_CLASP(JSEXN_DEBUGGEEWOULDRUN)) \
|
||||
real(CompileError, InitViaClassSpec, ERROR_CLASP(JSEXN_WASMCOMPILEERROR)) \
|
||||
real(LinkError, InitViaClassSpec, ERROR_CLASP(JSEXN_WASMLINKERROR)) \
|
||||
real(RuntimeError, InitViaClassSpec, ERROR_CLASP(JSEXN_WASMRUNTIMEERROR)) \
|
||||
real(ArrayBuffer, InitViaClassSpec, OCLASP(ArrayBuffer)) \
|
||||
real(Int8Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Int8)) \
|
||||
real(Uint8Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Uint8)) \
|
||||
real(Int16Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Int16)) \
|
||||
real(Uint16Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Uint16)) \
|
||||
real(Int32Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Int32)) \
|
||||
real(Uint32Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Uint32)) \
|
||||
real(Float32Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Float32)) \
|
||||
real(Float64Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Float64)) \
|
||||
real(Uint8ClampedArray, InitViaClassSpec, TYPED_ARRAY_CLASP(Uint8Clamped)) \
|
||||
IF_BIGINT(real,imaginary)(BigInt, InitViaClassSpec, OCLASP(BigInt)) \
|
||||
real(Proxy, InitProxyClass, &js::ProxyClass) \
|
||||
real(WeakMap, InitWeakMapClass, OCLASP(WeakMap)) \
|
||||
real(Map, InitViaClassSpec, OCLASP(Map)) \
|
||||
real(Set, InitViaClassSpec, OCLASP(Set)) \
|
||||
real(DataView, InitViaClassSpec, OCLASP(DataView)) \
|
||||
real(Symbol, InitSymbolClass, OCLASP(Symbol)) \
|
||||
real(SharedArrayBuffer, InitViaClassSpec, OCLASP(SharedArrayBuffer)) \
|
||||
IF_INTL(real,imaginary) (Intl, InitIntlClass, CLASP(Intl)) \
|
||||
IF_BDATA(real,imaginary)(TypedObject, InitTypedObjectModuleObject, OCLASP(TypedObjectModule)) \
|
||||
real(Reflect, InitReflect, nullptr) \
|
||||
real(WeakSet, InitWeakSetClass, OCLASP(WeakSet)) \
|
||||
real(TypedArray, InitViaClassSpec, &js::TypedArrayObject::sharedTypedArrayPrototypeClass) \
|
||||
real(Atomics, InitAtomicsClass, OCLASP(Atomics)) \
|
||||
real(SavedFrame, InitViaClassSpec, &js::SavedFrame::class_) \
|
||||
real(Promise, InitViaClassSpec, OCLASP(Promise)) \
|
||||
real(ReadableStream, InitViaClassSpec, &js::ReadableStream::class_) \
|
||||
real(ReadableStreamDefaultReader, InitViaClassSpec, &js::ReadableStreamDefaultReader::class_) \
|
||||
real(ReadableStreamDefaultController, InitViaClassSpec, &js::ReadableStreamDefaultController::class_) \
|
||||
real(ReadableByteStreamController, InitViaClassSpec, &js::ReadableByteStreamController::class_) \
|
||||
imaginary(WritableStream, dummy, dummy) \
|
||||
imaginary(WritableStreamDefaultWriter, dummy, dummy) \
|
||||
imaginary(WritableStreamDefaultController, dummy, dummy) \
|
||||
real(ByteLengthQueuingStrategy, InitViaClassSpec, &js::ByteLengthQueuingStrategy::class_) \
|
||||
real(CountQueuingStrategy, InitViaClassSpec, &js::CountQueuingStrategy::class_) \
|
||||
real(WebAssembly, InitWebAssemblyClass, CLASP(WebAssembly)) \
|
||||
imaginary(WasmModule, dummy, dummy) \
|
||||
imaginary(WasmInstance, dummy, dummy) \
|
||||
imaginary(WasmMemory, dummy, dummy) \
|
||||
imaginary(WasmTable, dummy, dummy) \
|
||||
imaginary(WasmGlobal, dummy, dummy) \
|
||||
#define JS_FOR_PROTOTYPES_(REAL, IMAGINARY, \
|
||||
REAL_IF_INTL, REAL_IF_BDATA, REAL_IF_SAB, REAL_IF_BIGINT) \
|
||||
IMAGINARY(Null, InitNullClass, dummy) \
|
||||
REAL(Object, InitViaClassSpec, OCLASP(Plain)) \
|
||||
REAL(Function, InitViaClassSpec, &JSFunction::class_) \
|
||||
REAL(Array, InitViaClassSpec, OCLASP(Array)) \
|
||||
REAL(Boolean, InitBooleanClass, OCLASP(Boolean)) \
|
||||
REAL(JSON, InitJSONClass, CLASP(JSON)) \
|
||||
REAL(Date, InitViaClassSpec, OCLASP(Date)) \
|
||||
REAL(Math, InitMathClass, CLASP(Math)) \
|
||||
REAL(Number, InitNumberClass, OCLASP(Number)) \
|
||||
REAL(String, InitStringClass, OCLASP(String)) \
|
||||
REAL(RegExp, InitViaClassSpec, OCLASP(RegExp)) \
|
||||
REAL(Error, InitViaClassSpec, ERROR_CLASP(JSEXN_ERR)) \
|
||||
REAL(InternalError, InitViaClassSpec, ERROR_CLASP(JSEXN_INTERNALERR)) \
|
||||
REAL(EvalError, InitViaClassSpec, ERROR_CLASP(JSEXN_EVALERR)) \
|
||||
REAL(RangeError, InitViaClassSpec, ERROR_CLASP(JSEXN_RANGEERR)) \
|
||||
REAL(ReferenceError, InitViaClassSpec, ERROR_CLASP(JSEXN_REFERENCEERR)) \
|
||||
REAL(SyntaxError, InitViaClassSpec, ERROR_CLASP(JSEXN_SYNTAXERR)) \
|
||||
REAL(TypeError, InitViaClassSpec, ERROR_CLASP(JSEXN_TYPEERR)) \
|
||||
REAL(URIError, InitViaClassSpec, ERROR_CLASP(JSEXN_URIERR)) \
|
||||
REAL(DebuggeeWouldRun, InitViaClassSpec, ERROR_CLASP(JSEXN_DEBUGGEEWOULDRUN)) \
|
||||
REAL(CompileError, InitViaClassSpec, ERROR_CLASP(JSEXN_WASMCOMPILEERROR)) \
|
||||
REAL(LinkError, InitViaClassSpec, ERROR_CLASP(JSEXN_WASMLINKERROR)) \
|
||||
REAL(RuntimeError, InitViaClassSpec, ERROR_CLASP(JSEXN_WASMRUNTIMEERROR)) \
|
||||
REAL(ArrayBuffer, InitViaClassSpec, OCLASP(ArrayBuffer)) \
|
||||
REAL(Int8Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Int8)) \
|
||||
REAL(Uint8Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Uint8)) \
|
||||
REAL(Int16Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Int16)) \
|
||||
REAL(Uint16Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Uint16)) \
|
||||
REAL(Int32Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Int32)) \
|
||||
REAL(Uint32Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Uint32)) \
|
||||
REAL(Float32Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Float32)) \
|
||||
REAL(Float64Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Float64)) \
|
||||
REAL(Uint8ClampedArray, InitViaClassSpec, TYPED_ARRAY_CLASP(Uint8Clamped)) \
|
||||
REAL_IF_BIGINT(BigInt, InitViaClassSpec, OCLASP(BigInt)) \
|
||||
REAL(Proxy, InitProxyClass, &js::ProxyClass) \
|
||||
REAL(WeakMap, InitWeakMapClass, OCLASP(WeakMap)) \
|
||||
REAL(Map, InitViaClassSpec, OCLASP(Map)) \
|
||||
REAL(Set, InitViaClassSpec, OCLASP(Set)) \
|
||||
REAL(DataView, InitViaClassSpec, OCLASP(DataView)) \
|
||||
REAL(Symbol, InitSymbolClass, OCLASP(Symbol)) \
|
||||
REAL(SharedArrayBuffer, InitViaClassSpec, OCLASP(SharedArrayBuffer)) \
|
||||
REAL_IF_INTL(Intl, InitIntlClass, CLASP(Intl)) \
|
||||
REAL_IF_BDATA(TypedObject, InitTypedObjectModuleObject, OCLASP(TypedObjectModule)) \
|
||||
REAL(Reflect, InitReflect, nullptr) \
|
||||
REAL(WeakSet, InitWeakSetClass, OCLASP(WeakSet)) \
|
||||
REAL(TypedArray, InitViaClassSpec, &js::TypedArrayObject::sharedTypedArrayPrototypeClass) \
|
||||
REAL(Atomics, InitAtomicsClass, OCLASP(Atomics)) \
|
||||
REAL(SavedFrame, InitViaClassSpec, &js::SavedFrame::class_) \
|
||||
REAL(Promise, InitViaClassSpec, OCLASP(Promise)) \
|
||||
REAL(ReadableStream, InitViaClassSpec, &js::ReadableStream::class_) \
|
||||
REAL(ReadableStreamDefaultReader, InitViaClassSpec, &js::ReadableStreamDefaultReader::class_) \
|
||||
REAL(ReadableStreamDefaultController, InitViaClassSpec, &js::ReadableStreamDefaultController::class_) \
|
||||
REAL(ReadableByteStreamController, InitViaClassSpec, &js::ReadableByteStreamController::class_) \
|
||||
IMAGINARY(WritableStream, dummy, dummy) \
|
||||
IMAGINARY(WritableStreamDefaultWriter, dummy, dummy) \
|
||||
IMAGINARY(WritableStreamDefaultController, dummy, dummy) \
|
||||
REAL(ByteLengthQueuingStrategy, InitViaClassSpec, &js::ByteLengthQueuingStrategy::class_) \
|
||||
REAL(CountQueuingStrategy, InitViaClassSpec, &js::CountQueuingStrategy::class_) \
|
||||
REAL(WebAssembly, InitWebAssemblyClass, CLASP(WebAssembly)) \
|
||||
IMAGINARY(WasmModule, dummy, dummy) \
|
||||
IMAGINARY(WasmInstance, dummy, dummy) \
|
||||
IMAGINARY(WasmMemory, dummy, dummy) \
|
||||
IMAGINARY(WasmTable, dummy, dummy) \
|
||||
IMAGINARY(WasmGlobal, dummy, dummy) \
|
||||
|
||||
#define JS_FOR_EACH_PROTOTYPE(macro) JS_FOR_PROTOTYPES(macro,macro)
|
||||
#define JS_FOR_PROTOTYPES(REAL, IMAGINARY) \
|
||||
JS_FOR_PROTOTYPES_(REAL, \
|
||||
IMAGINARY, \
|
||||
IF_INTL(REAL, IMAGINARY), \
|
||||
IF_BDATA(REAL, IMAGINARY), \
|
||||
IF_SAB(REAL, IMAGINARY), \
|
||||
IF_BIGINT(REAL, IMAGINARY))
|
||||
|
||||
#define JS_FOR_EACH_PROTOTYPE(MACRO) JS_FOR_PROTOTYPES(MACRO,MACRO)
|
||||
|
||||
#endif /* js_ProtoKey_h */
|
||||
|
|
|
@ -34,7 +34,7 @@ using JS::Value;
|
|||
|
||||
class RegExpShared;
|
||||
|
||||
class JS_FRIEND_API(Wrapper);
|
||||
class JS_FRIEND_API Wrapper;
|
||||
|
||||
/*
|
||||
* [SMDOC] Proxy Objects
|
||||
|
@ -166,7 +166,7 @@ class JS_FRIEND_API(Wrapper);
|
|||
* Proxy::foo entry point with an AutoEnterPolicy. If you don't, you need an
|
||||
* explicit override for the method in SecurityWrapper. See bug 945826 comment 0.
|
||||
*/
|
||||
class JS_FRIEND_API(BaseProxyHandler)
|
||||
class JS_FRIEND_API BaseProxyHandler
|
||||
{
|
||||
/*
|
||||
* Sometimes it's desirable to designate groups of proxy handlers as "similar".
|
||||
|
@ -369,7 +369,7 @@ class JS_FRIEND_API(BaseProxyHandler)
|
|||
virtual bool isScripted() const { return false; }
|
||||
};
|
||||
|
||||
extern JS_FRIEND_DATA(const js::Class) ProxyClass;
|
||||
extern JS_FRIEND_DATA const js::Class ProxyClass;
|
||||
|
||||
inline bool IsProxy(const JSObject* obj)
|
||||
{
|
||||
|
@ -482,7 +482,7 @@ GetProxyDataLayout(const JSObject* obj)
|
|||
ProxyDataOffset);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
JS_FRIEND_API void
|
||||
SetValueInProxy(Value* slot, const Value& value);
|
||||
|
||||
inline void
|
||||
|
@ -602,14 +602,14 @@ class MOZ_STACK_CLASS ProxyOptions {
|
|||
const Class* clasp_;
|
||||
};
|
||||
|
||||
JS_FRIEND_API(JSObject*)
|
||||
JS_FRIEND_API JSObject*
|
||||
NewProxyObject(JSContext* cx, const BaseProxyHandler* handler, HandleValue priv,
|
||||
JSObject* proto, const ProxyOptions& options = ProxyOptions());
|
||||
|
||||
JSObject*
|
||||
RenewProxyObject(JSContext* cx, JSObject* obj, BaseProxyHandler* handler, const Value& priv);
|
||||
|
||||
class JS_FRIEND_API(AutoEnterPolicy)
|
||||
class JS_FRIEND_API AutoEnterPolicy
|
||||
{
|
||||
public:
|
||||
typedef BaseProxyHandler::Action Action;
|
||||
|
@ -661,7 +661,7 @@ class JS_FRIEND_API(AutoEnterPolicy)
|
|||
void recordEnter(JSContext* cx, HandleObject proxy, HandleId id, Action act);
|
||||
void recordLeave();
|
||||
|
||||
friend JS_FRIEND_API(void) assertEnteredPolicy(JSContext* cx, JSObject* proxy, jsid id, Action act);
|
||||
friend JS_FRIEND_API void assertEnteredPolicy(JSContext* cx, JSObject* proxy, jsid id, Action act);
|
||||
#else
|
||||
inline void recordEnter(JSContext* cx, JSObject* proxy, jsid id, Action act) {}
|
||||
inline void recordLeave() {}
|
||||
|
@ -679,7 +679,7 @@ class JS_FRIEND_API(AutoEnterPolicy)
|
|||
};
|
||||
|
||||
#ifdef JS_DEBUG
|
||||
class JS_FRIEND_API(AutoWaivePolicy) : public AutoEnterPolicy {
|
||||
class JS_FRIEND_API AutoWaivePolicy : public AutoEnterPolicy {
|
||||
public:
|
||||
AutoWaivePolicy(JSContext* cx, HandleObject proxy, HandleId id,
|
||||
BaseProxyHandler::Action act)
|
||||
|
@ -689,7 +689,7 @@ public:
|
|||
}
|
||||
};
|
||||
#else
|
||||
class JS_FRIEND_API(AutoWaivePolicy) {
|
||||
class JS_FRIEND_API AutoWaivePolicy {
|
||||
public:
|
||||
AutoWaivePolicy(JSContext* cx, HandleObject proxy, HandleId id,
|
||||
BaseProxyHandler::Action act)
|
||||
|
@ -698,7 +698,7 @@ class JS_FRIEND_API(AutoWaivePolicy) {
|
|||
#endif
|
||||
|
||||
#ifdef JS_DEBUG
|
||||
extern JS_FRIEND_API(void)
|
||||
extern JS_FRIEND_API void
|
||||
assertEnteredPolicy(JSContext* cx, JSObject* obj, jsid id,
|
||||
BaseProxyHandler::Action act);
|
||||
#else
|
||||
|
@ -707,9 +707,9 @@ inline void assertEnteredPolicy(JSContext* cx, JSObject* obj, jsid id,
|
|||
{}
|
||||
#endif
|
||||
|
||||
extern JS_FRIEND_DATA(const js::ClassOps) ProxyClassOps;
|
||||
extern JS_FRIEND_DATA(const js::ClassExtension) ProxyClassExtension;
|
||||
extern JS_FRIEND_DATA(const js::ObjectOps) ProxyObjectOps;
|
||||
extern JS_FRIEND_DATA const js::ClassOps ProxyClassOps;
|
||||
extern JS_FRIEND_DATA const js::ClassExtension ProxyClassExtension;
|
||||
extern JS_FRIEND_DATA const js::ObjectOps ProxyObjectOps;
|
||||
|
||||
template <unsigned Flags>
|
||||
constexpr unsigned
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
|
||||
namespace js {
|
||||
namespace gc {
|
||||
JS_PUBLIC_API(void) TraceRealm(JSTracer* trc, JS::Realm* realm, const char* name);
|
||||
JS_PUBLIC_API(bool) RealmNeedsSweep(JS::Realm* realm);
|
||||
JS_PUBLIC_API void TraceRealm(JSTracer* trc, JS::Realm* realm, const char* name);
|
||||
JS_PUBLIC_API bool RealmNeedsSweep(JS::Realm* realm);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ struct GCPolicy<Realm*> : public NonGCPointerPolicy<Realm*>
|
|||
|
||||
// Get the current realm, if any. The ECMAScript spec calls this "the current
|
||||
// Realm Record".
|
||||
extern JS_PUBLIC_API(Realm*)
|
||||
extern JS_PUBLIC_API Realm*
|
||||
GetCurrentRealmOrNull(JSContext* cx);
|
||||
|
||||
namespace shadow {
|
||||
|
@ -71,17 +71,17 @@ GetCompartmentForRealm(Realm* realm)
|
|||
// Return an object's realm. All objects except cross-compartment wrappers are
|
||||
// created in a particular realm, which never changes. Returns null if obj is
|
||||
// a cross-compartment wrapper.
|
||||
extern JS_PUBLIC_API(Realm*)
|
||||
extern JS_PUBLIC_API Realm*
|
||||
GetObjectRealmOrNull(JSObject* obj);
|
||||
|
||||
// Get the value of the "private data" internal field of the given Realm.
|
||||
// This field is initially null and is set using SetRealmPrivate.
|
||||
// It's a pointer to embeddding-specific data that SpiderMonkey never uses.
|
||||
extern JS_PUBLIC_API(void*)
|
||||
extern JS_PUBLIC_API void*
|
||||
GetRealmPrivate(Realm* realm);
|
||||
|
||||
// Set the "private data" internal field of the given Realm.
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
SetRealmPrivate(Realm* realm, void* data);
|
||||
|
||||
typedef void
|
||||
|
@ -93,7 +93,7 @@ typedef void
|
|||
//
|
||||
// By the time this is called, the global object for the realm has already been
|
||||
// collected.
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
SetDestroyRealmCallback(JSContext* cx, DestroyRealmCallback callback);
|
||||
|
||||
typedef void
|
||||
|
@ -101,18 +101,18 @@ typedef void
|
|||
|
||||
// Set the callback SpiderMonkey calls to get the name of a realm, for
|
||||
// diagnostic output.
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
SetRealmNameCallback(JSContext* cx, RealmNameCallback callback);
|
||||
|
||||
// Get the global object for the given realm. This only returns nullptr during
|
||||
// GC, between collecting the global object and destroying the Realm.
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
GetRealmGlobalOrNull(Handle<Realm*> realm);
|
||||
|
||||
// Initialize standard JS class constructors, prototypes, and any top-level
|
||||
// functions and constants associated with the standard classes (e.g. isNaN
|
||||
// for Number).
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
InitRealmStandardClasses(JSContext* cx);
|
||||
|
||||
/*
|
||||
|
@ -120,19 +120,19 @@ InitRealmStandardClasses(JSContext* cx);
|
|||
* on the JSContext's current Realm.
|
||||
*/
|
||||
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
GetRealmObjectPrototype(JSContext* cx);
|
||||
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
GetRealmFunctionPrototype(JSContext* cx);
|
||||
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
GetRealmArrayPrototype(JSContext* cx);
|
||||
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
GetRealmErrorPrototype(JSContext* cx);
|
||||
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
GetRealmIteratorPrototype(JSContext* cx);
|
||||
|
||||
} // namespace JS
|
||||
|
|
|
@ -199,8 +199,8 @@ namespace JS {
|
|||
template <typename T> class Rooted;
|
||||
template <typename T> class PersistentRooted;
|
||||
|
||||
JS_FRIEND_API(void) HeapObjectPostBarrier(JSObject** objp, JSObject* prev, JSObject* next);
|
||||
JS_FRIEND_API(void) HeapStringPostBarrier(JSString** objp, JSString* prev, JSString* next);
|
||||
JS_FRIEND_API void HeapObjectPostBarrier(JSObject** objp, JSObject* prev, JSObject* next);
|
||||
JS_FRIEND_API void HeapStringPostBarrier(JSString** objp, JSString* prev, JSString* next);
|
||||
|
||||
/**
|
||||
* Create a safely-initialized |T|, suitable for use as a default value in
|
||||
|
@ -241,9 +241,9 @@ SafelyInitialized()
|
|||
* For generational GC, assert that an object is in the tenured generation as
|
||||
* opposed to being in the nursery.
|
||||
*/
|
||||
extern JS_FRIEND_API(void)
|
||||
extern JS_FRIEND_API void
|
||||
AssertGCThingMustBeTenured(JSObject* obj);
|
||||
extern JS_FRIEND_API(void)
|
||||
extern JS_FRIEND_API void
|
||||
AssertGCThingIsNotNurseryAllocable(js::gc::Cell* cell);
|
||||
#else
|
||||
inline void
|
||||
|
@ -750,7 +750,7 @@ struct BarrierMethods<JSString*>
|
|||
// aggregate Lookup kinds embed a JSObject* that is frequently null and do not
|
||||
// null test before dispatching to the hasher.
|
||||
template <typename T>
|
||||
struct JS_PUBLIC_API(MovableCellHasher)
|
||||
struct JS_PUBLIC_API MovableCellHasher
|
||||
{
|
||||
using Key = T;
|
||||
using Lookup = T;
|
||||
|
@ -763,7 +763,7 @@ struct JS_PUBLIC_API(MovableCellHasher)
|
|||
};
|
||||
|
||||
template <typename T>
|
||||
struct JS_PUBLIC_API(MovableCellHasher<JS::Heap<T>>)
|
||||
struct JS_PUBLIC_API MovableCellHasher<JS::Heap<T>>
|
||||
{
|
||||
using Key = JS::Heap<T>;
|
||||
using Lookup = T;
|
||||
|
@ -840,7 +840,7 @@ class alignas(8) DispatchWrapper
|
|||
|
||||
namespace JS {
|
||||
|
||||
class JS_PUBLIC_API(AutoGCRooter);
|
||||
class JS_PUBLIC_API AutoGCRooter;
|
||||
|
||||
// Our instantiations of Rooted<void*> and PersistentRooted<void*> require an
|
||||
// instantiation of MapTypeToRootKind.
|
||||
|
@ -905,7 +905,7 @@ class RootingContext
|
|||
friend JS::Zone* js::GetContextZone(const JSContext* cx);
|
||||
};
|
||||
|
||||
class JS_PUBLIC_API(AutoGCRooter)
|
||||
class JS_PUBLIC_API AutoGCRooter
|
||||
{
|
||||
protected:
|
||||
enum class Tag : uint8_t {
|
||||
|
@ -1219,10 +1219,10 @@ MutableHandle<T>::MutableHandle(PersistentRooted<T>* root)
|
|||
ptr = root->address();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
AddPersistentRoot(RootingContext* cx, RootKind kind, PersistentRooted<void*>* root);
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
AddPersistentRoot(JSRuntime* rt, RootKind kind, PersistentRooted<void*>* root);
|
||||
|
||||
/**
|
||||
|
@ -1386,7 +1386,7 @@ class PersistentRooted : public js::RootedBase<T, PersistentRooted<T>>,
|
|||
detail::MaybeWrapped<T> ptr;
|
||||
} JS_HAZ_ROOTED;
|
||||
|
||||
class JS_PUBLIC_API(ObjectPtr)
|
||||
class JS_PUBLIC_API ObjectPtr
|
||||
{
|
||||
Heap<JSObject*> value;
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ enum class SavedFrameSelfHosted {
|
|||
* Given a SavedFrame JSObject, get its source property. Defaults to the empty
|
||||
* string.
|
||||
*/
|
||||
extern JS_PUBLIC_API(SavedFrameResult)
|
||||
extern JS_PUBLIC_API SavedFrameResult
|
||||
GetSavedFrameSource(JSContext* cx, JSPrincipals* principals, Handle<JSObject*> savedFrame,
|
||||
MutableHandle<JSString*> sourcep,
|
||||
SavedFrameSelfHosted selfHosted = SavedFrameSelfHosted::Include);
|
||||
|
@ -74,7 +74,7 @@ GetSavedFrameSource(JSContext* cx, JSPrincipals* principals, Handle<JSObject*> s
|
|||
/**
|
||||
* Given a SavedFrame JSObject, get its line property. Defaults to 0.
|
||||
*/
|
||||
extern JS_PUBLIC_API(SavedFrameResult)
|
||||
extern JS_PUBLIC_API SavedFrameResult
|
||||
GetSavedFrameLine(JSContext* cx, JSPrincipals* principals, Handle<JSObject*> savedFrame,
|
||||
uint32_t* linep,
|
||||
SavedFrameSelfHosted selfHosted = SavedFrameSelfHosted::Include);
|
||||
|
@ -82,7 +82,7 @@ GetSavedFrameLine(JSContext* cx, JSPrincipals* principals, Handle<JSObject*> sav
|
|||
/**
|
||||
* Given a SavedFrame JSObject, get its column property. Defaults to 0.
|
||||
*/
|
||||
extern JS_PUBLIC_API(SavedFrameResult)
|
||||
extern JS_PUBLIC_API SavedFrameResult
|
||||
GetSavedFrameColumn(JSContext* cx, JSPrincipals* principals, Handle<JSObject*> savedFrame,
|
||||
uint32_t* columnp,
|
||||
SavedFrameSelfHosted selfHosted = SavedFrameSelfHosted::Include);
|
||||
|
@ -92,7 +92,7 @@ GetSavedFrameColumn(JSContext* cx, JSPrincipals* principals, Handle<JSObject*> s
|
|||
* if SpiderMonkey was unable to infer a name for the captured frame's
|
||||
* function. Defaults to nullptr.
|
||||
*/
|
||||
extern JS_PUBLIC_API(SavedFrameResult)
|
||||
extern JS_PUBLIC_API SavedFrameResult
|
||||
GetSavedFrameFunctionDisplayName(JSContext* cx, JSPrincipals* principals,
|
||||
Handle<JSObject*> savedFrame,
|
||||
MutableHandle<JSString*> namep,
|
||||
|
@ -101,7 +101,7 @@ GetSavedFrameFunctionDisplayName(JSContext* cx, JSPrincipals* principals,
|
|||
/**
|
||||
* Given a SavedFrame JSObject, get its asyncCause string. Defaults to nullptr.
|
||||
*/
|
||||
extern JS_PUBLIC_API(SavedFrameResult)
|
||||
extern JS_PUBLIC_API SavedFrameResult
|
||||
GetSavedFrameAsyncCause(JSContext* cx, JSPrincipals* principals, Handle<JSObject*> savedFrame,
|
||||
MutableHandle<JSString*> asyncCausep,
|
||||
SavedFrameSelfHosted selfHosted = SavedFrameSelfHosted::Include);
|
||||
|
@ -111,7 +111,7 @@ GetSavedFrameAsyncCause(JSContext* cx, JSPrincipals* principals, Handle<JSObject
|
|||
* if there is no asyncParent. The `asyncParentp` out parameter is _NOT_
|
||||
* guaranteed to be in the cx's compartment. Defaults to nullptr.
|
||||
*/
|
||||
extern JS_PUBLIC_API(SavedFrameResult)
|
||||
extern JS_PUBLIC_API SavedFrameResult
|
||||
GetSavedFrameAsyncParent(JSContext* cx, JSPrincipals* principals, Handle<JSObject*> savedFrame,
|
||||
MutableHandle<JSObject*> asyncParentp,
|
||||
SavedFrameSelfHosted selfHosted = SavedFrameSelfHosted::Include);
|
||||
|
@ -121,7 +121,7 @@ GetSavedFrameAsyncParent(JSContext* cx, JSPrincipals* principals, Handle<JSObjec
|
|||
* it is the oldest frame in the stack. The `parentp` out parameter is _NOT_
|
||||
* guaranteed to be in the cx's compartment. Defaults to nullptr.
|
||||
*/
|
||||
extern JS_PUBLIC_API(SavedFrameResult)
|
||||
extern JS_PUBLIC_API SavedFrameResult
|
||||
GetSavedFrameParent(JSContext* cx, JSPrincipals* principals, Handle<JSObject*> savedFrame,
|
||||
MutableHandle<JSObject*> parentp,
|
||||
SavedFrameSelfHosted selfHosted = SavedFrameSelfHosted::Include);
|
||||
|
@ -136,7 +136,7 @@ namespace js {
|
|||
*
|
||||
* Do NOT pass a non-SavedFrame object here.
|
||||
*/
|
||||
extern JS_FRIEND_API(JSObject*)
|
||||
extern JS_FRIEND_API JSObject*
|
||||
GetFirstSubsumedSavedFrame(JSContext* cx, JSPrincipals* principals,
|
||||
JS::Handle<JSObject*> savedFrame, JS::SavedFrameSelfHosted selfHosted);
|
||||
|
||||
|
|
|
@ -15,14 +15,14 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
struct JS_PUBLIC_API(TimeBudget)
|
||||
struct JS_PUBLIC_API TimeBudget
|
||||
{
|
||||
int64_t budget;
|
||||
|
||||
explicit TimeBudget(int64_t milliseconds) { budget = milliseconds; }
|
||||
};
|
||||
|
||||
struct JS_PUBLIC_API(WorkBudget)
|
||||
struct JS_PUBLIC_API WorkBudget
|
||||
{
|
||||
int64_t budget;
|
||||
|
||||
|
@ -35,7 +35,7 @@ struct JS_PUBLIC_API(WorkBudget)
|
|||
* to run for unlimited time, and others are bounded. To reduce the number of
|
||||
* gettimeofday calls, we only check the time every 1000 operations.
|
||||
*/
|
||||
class JS_PUBLIC_API(SliceBudget)
|
||||
class JS_PUBLIC_API SliceBudget
|
||||
{
|
||||
static mozilla::TimeStamp unlimitedDeadline;
|
||||
static const intptr_t unlimitedStartCounter = INTPTR_MAX;
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace JS {
|
|||
|
||||
namespace detail {
|
||||
|
||||
MOZ_COLD extern JS_PUBLIC_API(void)
|
||||
MOZ_COLD extern JS_PUBLIC_API void
|
||||
ReportSourceTooLong(JSContext* cx);
|
||||
|
||||
} // namespace detail
|
||||
|
|
|
@ -45,7 +45,7 @@ GetStringLength(JSString* s)
|
|||
* JSString methods and often the code can be rewritten so that only indexes
|
||||
* instead of char pointers are used in parts of the code that can GC.
|
||||
*/
|
||||
class MOZ_STACK_CLASS JS_FRIEND_API(AutoStableStringChars) final
|
||||
class MOZ_STACK_CLASS JS_FRIEND_API AutoStableStringChars final
|
||||
{
|
||||
/*
|
||||
* When copying string char, use this many bytes of inline storage. This is
|
||||
|
|
|
@ -152,7 +152,7 @@ typedef void
|
|||
*
|
||||
* See the documentation for the individual callback types for details.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
SetReadableStreamCallbacks(JSContext* cx,
|
||||
RequestReadableStreamDataCallback dataRequestCallback,
|
||||
WriteIntoReadRequestBufferCallback writeIntoReadRequestCallback,
|
||||
|
@ -161,7 +161,7 @@ SetReadableStreamCallbacks(JSContext* cx,
|
|||
ReadableStreamErroredCallback erroredCallback,
|
||||
ReadableStreamFinalizeCallback finalizeCallback);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
HasReadableStreamCallbacks(JSContext* cx);
|
||||
|
||||
/**
|
||||
|
@ -170,7 +170,7 @@ HasReadableStreamCallbacks(JSContext* cx);
|
|||
* If a |proto| is passed, that gets set as the instance's [[Prototype]]
|
||||
* instead of the original value of |ReadableStream.prototype|.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
NewReadableDefaultStreamObject(JSContext* cx, HandleObject underlyingSource = nullptr,
|
||||
HandleFunction size = nullptr, double highWaterMark = 1,
|
||||
HandleObject proto = nullptr);
|
||||
|
@ -197,7 +197,7 @@ NewReadableDefaultStreamObject(JSContext* cx, HandleObject underlyingSource = nu
|
|||
*
|
||||
* Note: |underlyingSource| must have an even address.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
NewReadableExternalSourceStreamObject(JSContext* cx, void* underlyingSource,
|
||||
uint8_t flags = 0, HandleObject proto = nullptr);
|
||||
|
||||
|
@ -210,7 +210,7 @@ NewReadableExternalSourceStreamObject(JSContext* cx, void* underlyingSource,
|
|||
*
|
||||
* Asserts that the given stream has an embedding-provided underlying source.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamGetEmbeddingFlags(JSContext* cx, HandleObject stream, uint8_t* flags);
|
||||
|
||||
/**
|
||||
|
@ -237,7 +237,7 @@ ReadableStreamGetEmbeddingFlags(JSContext* cx, HandleObject stream, uint8_t* fla
|
|||
*
|
||||
* Asserts that the stream has an embedding-provided underlying source.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamGetExternalUnderlyingSource(JSContext* cx, HandleObject stream, void** source);
|
||||
|
||||
/**
|
||||
|
@ -252,7 +252,7 @@ ReadableStreamGetExternalUnderlyingSource(JSContext* cx, HandleObject stream, vo
|
|||
*
|
||||
* Asserts that the stream has an embedding-provided underlying source.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamReleaseExternalUnderlyingSource(JSContext* cx, HandleObject stream);
|
||||
|
||||
/**
|
||||
|
@ -266,7 +266,7 @@ ReadableStreamReleaseExternalUnderlyingSource(JSContext* cx, HandleObject stream
|
|||
* Asserts that |stream| is a ReadableStream object or an unwrappable wrapper
|
||||
* for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamUpdateDataAvailableFromSource(JSContext* cx, HandleObject stream,
|
||||
uint32_t availableData);
|
||||
|
||||
|
@ -274,7 +274,7 @@ ReadableStreamUpdateDataAvailableFromSource(JSContext* cx, HandleObject stream,
|
|||
* Returns true if the given object is a ReadableStream object or an
|
||||
* unwrappable wrapper for one, false otherwise.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsReadableStream(JSObject* obj);
|
||||
|
||||
/**
|
||||
|
@ -282,14 +282,14 @@ IsReadableStream(JSObject* obj);
|
|||
* ReadableStreamBYOBReader object or an unwrappable wrapper for one, false
|
||||
* otherwise.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsReadableStreamReader(JSObject* obj);
|
||||
|
||||
/**
|
||||
* Returns true if the given object is a ReadableStreamDefaultReader object
|
||||
* or an unwrappable wrapper for one, false otherwise.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
IsReadableStreamDefaultReader(JSObject* obj);
|
||||
|
||||
enum class ReadableStreamMode {
|
||||
|
@ -306,7 +306,7 @@ enum class ReadableStreamMode {
|
|||
* Asserts that |stream| is a ReadableStream object or an unwrappable wrapper
|
||||
* for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamGetMode(JSContext* cx, HandleObject stream, ReadableStreamMode* mode);
|
||||
|
||||
enum class ReadableStreamReaderMode {
|
||||
|
@ -319,7 +319,7 @@ enum class ReadableStreamReaderMode {
|
|||
* Asserts that |stream| is a ReadableStream object or an unwrappable wrapper
|
||||
* for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamIsReadable(JSContext* cx, HandleObject stream, bool* result);
|
||||
|
||||
/**
|
||||
|
@ -328,7 +328,7 @@ ReadableStreamIsReadable(JSContext* cx, HandleObject stream, bool* result);
|
|||
* Asserts that |stream| is a ReadableStream object or an unwrappable wrapper
|
||||
* for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamIsLocked(JSContext* cx, HandleObject stream, bool* result);
|
||||
|
||||
/**
|
||||
|
@ -337,7 +337,7 @@ ReadableStreamIsLocked(JSContext* cx, HandleObject stream, bool* result);
|
|||
* Asserts that |stream| is a ReadableStream object or an unwrappable wrapper
|
||||
* for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamIsDisturbed(JSContext* cx, HandleObject stream, bool* result);
|
||||
|
||||
/**
|
||||
|
@ -347,7 +347,7 @@ ReadableStreamIsDisturbed(JSContext* cx, HandleObject stream, bool* result);
|
|||
* Asserts that |stream| is a ReadableStream object or an unwrappable wrapper
|
||||
* for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
ReadableStreamCancel(JSContext* cx, HandleObject stream, HandleValue reason);
|
||||
|
||||
/**
|
||||
|
@ -358,7 +358,7 @@ ReadableStreamCancel(JSContext* cx, HandleObject stream, HandleValue reason);
|
|||
* for one. The returned object will always be created in the
|
||||
* current cx compartment.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
ReadableStreamGetReader(JSContext* cx, HandleObject stream, ReadableStreamReaderMode mode);
|
||||
|
||||
/**
|
||||
|
@ -369,7 +369,7 @@ ReadableStreamGetReader(JSContext* cx, HandleObject stream, ReadableStreamReader
|
|||
* Asserts that |stream| is a ReadableStream object or an unwrappable wrapper
|
||||
* for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamTee(JSContext* cx, HandleObject stream,
|
||||
MutableHandleObject branch1Stream, MutableHandleObject branch2Stream);
|
||||
|
||||
|
@ -388,7 +388,7 @@ ReadableStreamTee(JSContext* cx, HandleObject stream,
|
|||
* Asserts that |stream| is a ReadableStream object or an unwrappable wrapper
|
||||
* for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamGetDesiredSize(JSContext* cx, JSObject* stream, bool* hasValue, double* value);
|
||||
|
||||
/**
|
||||
|
@ -403,7 +403,7 @@ ReadableStreamGetDesiredSize(JSContext* cx, JSObject* stream, bool* hasValue, do
|
|||
* Asserts that |stream| is a ReadableStream object or an unwrappable wrapper
|
||||
* for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamClose(JSContext* cx, HandleObject stream);
|
||||
|
||||
/**
|
||||
|
@ -412,7 +412,7 @@ ReadableStreamClose(JSContext* cx, HandleObject stream);
|
|||
* Asserts that |reader| is a ReadableStreamDefaultReader or
|
||||
* ReadableStreamBYOBReader object or an unwrappable wrapper for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamReaderIsClosed(JSContext* cx, HandleObject reader, bool* result);
|
||||
|
||||
/**
|
||||
|
@ -431,7 +431,7 @@ ReadableStreamReaderIsClosed(JSContext* cx, HandleObject reader, bool* result);
|
|||
* Asserts that |stream| is a ReadableStream object or an unwrappable wrapper
|
||||
* for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamEnqueue(JSContext* cx, HandleObject stream, HandleValue chunk);
|
||||
|
||||
/**
|
||||
|
@ -447,7 +447,7 @@ ReadableStreamEnqueue(JSContext* cx, HandleObject stream, HandleValue chunk);
|
|||
* Asserts that |stream| is a ReadableStream object or an unwrappable wrapper
|
||||
* for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamError(JSContext* cx, HandleObject stream, HandleValue error);
|
||||
|
||||
/**
|
||||
|
@ -458,7 +458,7 @@ ReadableStreamError(JSContext* cx, HandleObject stream, HandleValue error);
|
|||
* Asserts that |reader| is a ReadableStreamDefaultReader or
|
||||
* ReadableStreamBYOBReader object or an unwrappable wrapper for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamReaderCancel(JSContext* cx, HandleObject reader, HandleValue reason);
|
||||
|
||||
/**
|
||||
|
@ -470,7 +470,7 @@ ReadableStreamReaderCancel(JSContext* cx, HandleObject reader, HandleValue reaso
|
|||
* Asserts that |reader| is a ReadableStreamDefaultReader or
|
||||
* ReadableStreamBYOBReader object or an unwrappable wrapper for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
ReadableStreamReaderReleaseLock(JSContext* cx, HandleObject reader);
|
||||
|
||||
/**
|
||||
|
@ -483,7 +483,7 @@ ReadableStreamReaderReleaseLock(JSContext* cx, HandleObject reader);
|
|||
* Asserts that |reader| is a ReadableStreamDefaultReader object or an
|
||||
* unwrappable wrapper for one.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JSObject*)
|
||||
extern JS_PUBLIC_API JSObject*
|
||||
ReadableStreamDefaultReaderRead(JSContext* cx, HandleObject reader);
|
||||
|
||||
} // namespace JS
|
||||
|
|
|
@ -384,7 +384,7 @@ namespace js
|
|||
* information needed to read/write/transfer/free the records within it, in the
|
||||
* form of a set of callbacks.
|
||||
*/
|
||||
class MOZ_NON_MEMMOVABLE JS_PUBLIC_API(JSStructuredCloneData) {
|
||||
class MOZ_NON_MEMMOVABLE JS_PUBLIC_API JSStructuredCloneData {
|
||||
public:
|
||||
using BufferList = mozilla::BufferList<js::SystemAllocPolicy>;
|
||||
using Iterator = BufferList::IterImpl;
|
||||
|
@ -405,7 +405,7 @@ class MOZ_NON_MEMMOVABLE JS_PUBLIC_API(JSStructuredCloneData) {
|
|||
js::SharedArrayRawBufferRefs refsHeld_;
|
||||
|
||||
friend struct JSStructuredCloneWriter;
|
||||
friend class JS_PUBLIC_API(JSAutoStructuredCloneBuffer);
|
||||
friend class JS_PUBLIC_API JSAutoStructuredCloneBuffer;
|
||||
template <typename T, typename AllocPolicy> friend struct js::BufferIterator;
|
||||
|
||||
public:
|
||||
|
@ -545,7 +545,7 @@ class MOZ_NON_MEMMOVABLE JS_PUBLIC_API(JSStructuredCloneData) {
|
|||
*
|
||||
* Note: If `data` contains transferable objects, it can be read only once.
|
||||
*/
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_ReadStructuredClone(JSContext* cx, JSStructuredCloneData& data, uint32_t version,
|
||||
JS::StructuredCloneScope scope,
|
||||
JS::MutableHandleValue vp,
|
||||
|
@ -559,17 +559,17 @@ JS_ReadStructuredClone(JSContext* cx, JSStructuredCloneData& data, uint32_t vers
|
|||
* shared-memory objects, or an error will be signaled if a shared memory object
|
||||
* is seen.
|
||||
*/
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_WriteStructuredClone(JSContext* cx, JS::HandleValue v, JSStructuredCloneData* data,
|
||||
JS::StructuredCloneScope scope,
|
||||
JS::CloneDataPolicy cloneDataPolicy,
|
||||
const JSStructuredCloneCallbacks* optionalCallbacks,
|
||||
void* closure, JS::HandleValue transferable);
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_StructuredCloneHasTransferables(JSStructuredCloneData& data, bool* hasTransferable);
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_StructuredClone(JSContext* cx, JS::HandleValue v, JS::MutableHandleValue vp,
|
||||
const JSStructuredCloneCallbacks* optionalCallbacks, void* closure);
|
||||
|
||||
|
@ -585,7 +585,7 @@ JS_StructuredClone(JSContext* cx, JS::HandleValue v, JS::MutableHandleValue vp,
|
|||
* management, and uses the same callbacks for both writing and reading
|
||||
* (serializing and deserializing).
|
||||
*/
|
||||
class JS_PUBLIC_API(JSAutoStructuredCloneBuffer) {
|
||||
class JS_PUBLIC_API JSAutoStructuredCloneBuffer {
|
||||
const JS::StructuredCloneScope scope_;
|
||||
JSStructuredCloneData data_;
|
||||
uint32_t version_;
|
||||
|
@ -668,31 +668,31 @@ class JS_PUBLIC_API(JSAutoStructuredCloneBuffer) {
|
|||
#define JS_SCERR_UNSUPPORTED_TYPE 3
|
||||
#define JS_SCERR_SHMEM_TRANSFERABLE 4
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_ReadUint32Pair(JSStructuredCloneReader* r, uint32_t* p1, uint32_t* p2);
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_ReadBytes(JSStructuredCloneReader* r, void* p, size_t len);
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_ReadTypedArray(JSStructuredCloneReader* r, JS::MutableHandleValue vp);
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_WriteUint32Pair(JSStructuredCloneWriter* w, uint32_t tag, uint32_t data);
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_WriteBytes(JSStructuredCloneWriter* w, const void* p, size_t len);
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_WriteString(JSStructuredCloneWriter* w, JS::HandleString str);
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_WriteTypedArray(JSStructuredCloneWriter* w, JS::HandleValue v);
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_ObjectNotWritten(JSStructuredCloneWriter* w, JS::HandleObject obj);
|
||||
|
||||
JS_PUBLIC_API(JS::StructuredCloneScope)
|
||||
JS_PUBLIC_API JS::StructuredCloneScope
|
||||
JS_GetStructuredCloneScope(JSStructuredCloneWriter* w);
|
||||
|
||||
#endif /* js_StructuredClone_h */
|
||||
|
|
|
@ -15,9 +15,9 @@ class WeakCacheBase;
|
|||
} // namespace detail
|
||||
|
||||
namespace shadow {
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
RegisterWeakCache(JS::Zone* zone, JS::detail::WeakCacheBase* cachep);
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
RegisterWeakCache(JSRuntime* rt, JS::detail::WeakCacheBase* cachep);
|
||||
} // namespace shadow
|
||||
|
||||
|
|
|
@ -17,17 +17,17 @@ namespace JS {
|
|||
// textId's for various events and set the global option
|
||||
// JSJITCOMPILER_ENABLE_TRACELOGGER to true.
|
||||
// This does nothing except return if the trace logger is already active.
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
StartTraceLogger(JSContext *cx, mozilla::TimeStamp profilerStart);
|
||||
|
||||
// Stop trace logging events. All textId's will be set to false, and the
|
||||
// global JSJITCOMPILER_ENABLE_TRACELOGGER will be set to false.
|
||||
// This does nothing except return if the trace logger is not active.
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
StopTraceLogger(JSContext *cx);
|
||||
|
||||
// Clear and free any event data that was recorded by the trace logger.
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
ResetTraceLogger(void);
|
||||
|
||||
#else
|
||||
|
|
|
@ -12,15 +12,15 @@
|
|||
#include "js/HeapAPI.h"
|
||||
#include "js/TraceKind.h"
|
||||
|
||||
class JS_PUBLIC_API(JSTracer);
|
||||
class JS_PUBLIC_API JSTracer;
|
||||
|
||||
namespace JS {
|
||||
class JS_PUBLIC_API(CallbackTracer);
|
||||
class JS_PUBLIC_API CallbackTracer;
|
||||
template <typename T> class Heap;
|
||||
template <typename T> class TenuredHeap;
|
||||
|
||||
/** Returns a static string equivalent of |kind|. */
|
||||
JS_FRIEND_API(const char*)
|
||||
JS_FRIEND_API const char*
|
||||
GCTraceKindToAscii(JS::TraceKind kind);
|
||||
|
||||
} // namespace JS
|
||||
|
@ -51,7 +51,7 @@ enum WeakMapTraceKind {
|
|||
TraceWeakMapKeysValues
|
||||
};
|
||||
|
||||
class JS_PUBLIC_API(JSTracer)
|
||||
class JS_PUBLIC_API JSTracer
|
||||
{
|
||||
public:
|
||||
// Return the runtime set on the tracer.
|
||||
|
@ -134,7 +134,7 @@ class AutoTracingName;
|
|||
class AutoTracingIndex;
|
||||
class AutoTracingCallback;
|
||||
|
||||
class JS_PUBLIC_API(CallbackTracer) : public JSTracer
|
||||
class JS_PUBLIC_API CallbackTracer : public JSTracer
|
||||
{
|
||||
public:
|
||||
CallbackTracer(JSRuntime* rt, WeakMapTraceKind weakTraceKind = TraceWeakMapValues)
|
||||
|
@ -359,7 +359,7 @@ JSTracer::asCallbackTracer()
|
|||
namespace js {
|
||||
namespace gc {
|
||||
template <typename T>
|
||||
JS_PUBLIC_API(void) TraceExternalEdge(JSTracer* trc, T* thingp, const char* name);
|
||||
JS_PUBLIC_API void TraceExternalEdge(JSTracer* trc, T* thingp, const char* name);
|
||||
} // namespace gc
|
||||
} // namespace js
|
||||
|
||||
|
@ -408,10 +408,10 @@ TraceEdge(JSTracer* trc, JS::TenuredHeap<T>* thingp, const char* name)
|
|||
// Note that while |edgep| must never be null, it is fine for |*edgep| to be
|
||||
// nullptr.
|
||||
template <typename T>
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
UnsafeTraceRoot(JSTracer* trc, T* edgep, const char* name);
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
TraceChildren(JSTracer* trc, GCCellPtr thing);
|
||||
|
||||
using ZoneSet = js::HashSet<Zone*, js::DefaultHasher<Zone*>, js::SystemAllocPolicy>;
|
||||
|
@ -423,12 +423,12 @@ using CompartmentSet = js::HashSet<JS::Compartment*, js::DefaultHasher<JS::Compa
|
|||
* cross-compartment wrapper from a compartment that is not an element of
|
||||
* |compartments|.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
TraceIncomingCCWs(JSTracer* trc, const JS::CompartmentSet& compartments);
|
||||
|
||||
} // namespace JS
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS_GetTraceThingInfo(char* buf, size_t bufsize, JSTracer* trc,
|
||||
void* thing, JS::TraceKind kind, bool includeDetails);
|
||||
|
||||
|
@ -440,14 +440,14 @@ namespace js {
|
|||
// This method does not check if |*edgep| is non-null before tracing through
|
||||
// it, so callers must check any nullable pointer before calling this method.
|
||||
template <typename T>
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
UnsafeTraceManuallyBarrieredEdge(JSTracer* trc, T* edgep, const char* name);
|
||||
|
||||
namespace gc {
|
||||
|
||||
// Return true if the given edge is not live and is about to be swept.
|
||||
template <typename T>
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
EdgeNeedsSweep(JS::Heap<T>* edgep);
|
||||
|
||||
// Not part of the public API, but declared here so we can use it in GCPolicy
|
||||
|
|
|
@ -251,13 +251,13 @@ enum class TrackedTypeSite : uint32_t {
|
|||
Count
|
||||
};
|
||||
|
||||
JS_PUBLIC_API(const char*)
|
||||
JS_PUBLIC_API const char*
|
||||
TrackedStrategyString(TrackedStrategy strategy);
|
||||
|
||||
JS_PUBLIC_API(const char*)
|
||||
JS_PUBLIC_API const char*
|
||||
TrackedOutcomeString(TrackedOutcome outcome);
|
||||
|
||||
JS_PUBLIC_API(const char*)
|
||||
JS_PUBLIC_API const char*
|
||||
TrackedTypeSiteString(TrackedTypeSite site);
|
||||
|
||||
struct ForEachTrackedOptimizationAttemptOp
|
||||
|
|
|
@ -60,20 +60,20 @@ enum TranscodeResult : uint8_t
|
|||
TranscodeResult_Throw = 0x20
|
||||
};
|
||||
|
||||
extern JS_PUBLIC_API(TranscodeResult)
|
||||
extern JS_PUBLIC_API TranscodeResult
|
||||
EncodeScript(JSContext* cx, TranscodeBuffer& buffer, Handle<JSScript*> script);
|
||||
|
||||
extern JS_PUBLIC_API(TranscodeResult)
|
||||
extern JS_PUBLIC_API TranscodeResult
|
||||
EncodeInterpretedFunction(JSContext* cx, TranscodeBuffer& buffer, Handle<JSObject*> funobj);
|
||||
|
||||
extern JS_PUBLIC_API(TranscodeResult)
|
||||
extern JS_PUBLIC_API TranscodeResult
|
||||
DecodeScript(JSContext* cx, TranscodeBuffer& buffer, MutableHandle<JSScript*> scriptp,
|
||||
size_t cursorIndex = 0);
|
||||
|
||||
extern JS_PUBLIC_API(TranscodeResult)
|
||||
extern JS_PUBLIC_API TranscodeResult
|
||||
DecodeScript(JSContext* cx, const TranscodeRange& range, MutableHandle<JSScript*> scriptp);
|
||||
|
||||
extern JS_PUBLIC_API(TranscodeResult)
|
||||
extern JS_PUBLIC_API TranscodeResult
|
||||
DecodeInterpretedFunction(JSContext* cx, TranscodeBuffer& buffer, MutableHandle<JSFunction*> funp,
|
||||
size_t cursorIndex = 0);
|
||||
|
||||
|
@ -89,10 +89,10 @@ DecodeInterpretedFunction(JSContext* cx, TranscodeBuffer& buffer, MutableHandle<
|
|||
// The |buffer| argument of |FinishIncrementalEncoding| is used for appending
|
||||
// the encoded bytecode into the buffer. If any of these functions failed, the
|
||||
// content of |buffer| would be undefined.
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
StartIncrementalEncoding(JSContext* cx, Handle<JSScript*> script);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
extern JS_PUBLIC_API bool
|
||||
FinishIncrementalEncoding(JSContext* cx, Handle<JSScript*> script, TranscodeBuffer& buffer);
|
||||
|
||||
} // namespace JS
|
||||
|
|
|
@ -190,7 +190,7 @@ using Vector = mozilla::Vector<T, 0, js::SystemAllocPolicy>;
|
|||
// heap snapshots store their strings as const char16_t*. In order to provide
|
||||
// zero-cost accessors to these strings in a single interface that works with
|
||||
// both cases, we use this variant type.
|
||||
class JS_PUBLIC_API(AtomOrTwoByteChars) : public Variant<JSAtom*, const char16_t*> {
|
||||
class JS_PUBLIC_API AtomOrTwoByteChars : public Variant<JSAtom*, const char16_t*> {
|
||||
using Base = Variant<JSAtom*, const char16_t*>;
|
||||
|
||||
public:
|
||||
|
@ -463,7 +463,7 @@ class ConcreteStackFrame<void> : public BaseStackFrame {
|
|||
bool isSelfHosted(JSContext* cx) const override { MOZ_CRASH("null JS::ubi::StackFrame"); }
|
||||
};
|
||||
|
||||
MOZ_MUST_USE JS_PUBLIC_API(bool)
|
||||
MOZ_MUST_USE JS_PUBLIC_API bool
|
||||
ConstructSavedFrameStackSlow(JSContext* cx,
|
||||
JS::ubi::StackFrame& frame,
|
||||
MutableHandleObject outSavedFrameStack);
|
||||
|
@ -518,7 +518,7 @@ Uint32ToCoarseType(uint32_t n)
|
|||
|
||||
// The base class implemented by each ubi::Node referent type. Subclasses must
|
||||
// not add data members to this class.
|
||||
class JS_PUBLIC_API(Base) {
|
||||
class JS_PUBLIC_API Base {
|
||||
friend class Node;
|
||||
|
||||
// For performance's sake, we'd prefer to avoid a virtual destructor; and
|
||||
|
@ -986,7 +986,7 @@ class PreComputedEdgeRange : public EdgeRange {
|
|||
//
|
||||
// ...
|
||||
// }
|
||||
class MOZ_STACK_CLASS JS_PUBLIC_API(RootList) {
|
||||
class MOZ_STACK_CLASS JS_PUBLIC_API RootList {
|
||||
Maybe<AutoCheckCannotGC>& noGC;
|
||||
|
||||
public:
|
||||
|
@ -1021,7 +1021,7 @@ class MOZ_STACK_CLASS JS_PUBLIC_API(RootList) {
|
|||
/*** Concrete classes for ubi::Node referent types ************************************************/
|
||||
|
||||
template<>
|
||||
class JS_PUBLIC_API(Concrete<RootList>) : public Base {
|
||||
class JS_PUBLIC_API Concrete<RootList> : public Base {
|
||||
protected:
|
||||
explicit Concrete(RootList* ptr) : Base(ptr) { }
|
||||
RootList& get() const { return *static_cast<RootList*>(ptr); }
|
||||
|
@ -1038,7 +1038,7 @@ class JS_PUBLIC_API(Concrete<RootList>) : public Base {
|
|||
// A reusable ubi::Concrete specialization base class for types supported by
|
||||
// JS::TraceChildren.
|
||||
template<typename Referent>
|
||||
class JS_PUBLIC_API(TracerConcrete) : public Base {
|
||||
class JS_PUBLIC_API TracerConcrete : public Base {
|
||||
JS::Zone* zone() const override;
|
||||
|
||||
public:
|
||||
|
@ -1052,7 +1052,7 @@ class JS_PUBLIC_API(TracerConcrete) : public Base {
|
|||
// For JS::TraceChildren-based types that have 'realm' and 'compartment'
|
||||
// methods.
|
||||
template<typename Referent>
|
||||
class JS_PUBLIC_API(TracerConcreteWithRealm) : public TracerConcrete<Referent> {
|
||||
class JS_PUBLIC_API TracerConcreteWithRealm : public TracerConcrete<Referent> {
|
||||
typedef TracerConcrete<Referent> TracerBase;
|
||||
JS::Compartment* compartment() const override;
|
||||
JS::Realm* realm() const override;
|
||||
|
@ -1064,7 +1064,7 @@ class JS_PUBLIC_API(TracerConcreteWithRealm) : public TracerConcrete<Referent> {
|
|||
// Define specializations for some commonly-used public JSAPI types.
|
||||
// These can use the generic templates above.
|
||||
template<>
|
||||
class JS_PUBLIC_API(Concrete<JS::Symbol>) : TracerConcrete<JS::Symbol> {
|
||||
class JS_PUBLIC_API Concrete<JS::Symbol> : TracerConcrete<JS::Symbol> {
|
||||
protected:
|
||||
explicit Concrete(JS::Symbol* ptr) : TracerConcrete(ptr) { }
|
||||
|
||||
|
@ -1081,7 +1081,7 @@ class JS_PUBLIC_API(Concrete<JS::Symbol>) : TracerConcrete<JS::Symbol> {
|
|||
|
||||
#ifdef ENABLE_BIGINT
|
||||
template<>
|
||||
class JS_PUBLIC_API(Concrete<JS::BigInt>) : TracerConcrete<JS::BigInt> {
|
||||
class JS_PUBLIC_API Concrete<JS::BigInt> : TracerConcrete<JS::BigInt> {
|
||||
protected:
|
||||
explicit Concrete(JS::BigInt* ptr) : TracerConcrete(ptr) {}
|
||||
|
||||
|
@ -1098,7 +1098,7 @@ class JS_PUBLIC_API(Concrete<JS::BigInt>) : TracerConcrete<JS::BigInt> {
|
|||
#endif
|
||||
|
||||
template<>
|
||||
class JS_PUBLIC_API(Concrete<JSScript>) : TracerConcreteWithRealm<JSScript> {
|
||||
class JS_PUBLIC_API Concrete<JSScript> : TracerConcreteWithRealm<JSScript> {
|
||||
protected:
|
||||
explicit Concrete(JSScript *ptr) : TracerConcreteWithRealm<JSScript>(ptr) { }
|
||||
|
||||
|
@ -1115,7 +1115,7 @@ class JS_PUBLIC_API(Concrete<JSScript>) : TracerConcreteWithRealm<JSScript> {
|
|||
|
||||
// The JSObject specialization.
|
||||
template<>
|
||||
class JS_PUBLIC_API(Concrete<JSObject>) : public TracerConcrete<JSObject> {
|
||||
class JS_PUBLIC_API Concrete<JSObject> : public TracerConcrete<JSObject> {
|
||||
protected:
|
||||
explicit Concrete(JSObject* ptr) : TracerConcrete<JSObject>(ptr) { }
|
||||
|
||||
|
@ -1141,7 +1141,7 @@ class JS_PUBLIC_API(Concrete<JSObject>) : public TracerConcrete<JSObject> {
|
|||
|
||||
// For JSString, we extend the generic template with a 'size' implementation.
|
||||
template<>
|
||||
class JS_PUBLIC_API(Concrete<JSString>) : TracerConcrete<JSString> {
|
||||
class JS_PUBLIC_API Concrete<JSString> : TracerConcrete<JSString> {
|
||||
protected:
|
||||
explicit Concrete(JSString *ptr) : TracerConcrete<JSString>(ptr) { }
|
||||
|
||||
|
@ -1158,7 +1158,7 @@ class JS_PUBLIC_API(Concrete<JSString>) : TracerConcrete<JSString> {
|
|||
|
||||
// The ubi::Node null pointer. Any attempt to operate on a null ubi::Node asserts.
|
||||
template<>
|
||||
class JS_PUBLIC_API(Concrete<void>) : public Base {
|
||||
class JS_PUBLIC_API Concrete<void> : public Base {
|
||||
const char16_t* typeName() const override;
|
||||
Size size(mozilla::MallocSizeOf mallocSizeOf) const override;
|
||||
js::UniquePtr<EdgeRange> edges(JSContext* cx, bool wantNames) const override;
|
||||
|
|
|
@ -88,7 +88,7 @@ struct Census;
|
|||
class CountBase;
|
||||
|
||||
struct CountDeleter {
|
||||
JS_PUBLIC_API(void) operator()(CountBase*);
|
||||
JS_PUBLIC_API void operator()(CountBase*);
|
||||
};
|
||||
|
||||
using CountBasePtr = js::UniquePtr<CountBase, CountDeleter>;
|
||||
|
@ -229,23 +229,23 @@ class CensusHandler {
|
|||
// This class needs to retain no per-node data.
|
||||
class NodeData { };
|
||||
|
||||
MOZ_MUST_USE JS_PUBLIC_API(bool) operator() (BreadthFirst<CensusHandler>& traversal,
|
||||
Node origin, const Edge& edge,
|
||||
NodeData* referentData, bool first);
|
||||
MOZ_MUST_USE JS_PUBLIC_API bool operator() (BreadthFirst<CensusHandler>& traversal,
|
||||
Node origin, const Edge& edge,
|
||||
NodeData* referentData, bool first);
|
||||
};
|
||||
|
||||
using CensusTraversal = BreadthFirst<CensusHandler>;
|
||||
|
||||
// Examine the census options supplied by the API consumer, and (among other
|
||||
// things) use that to build a CountType tree.
|
||||
MOZ_MUST_USE JS_PUBLIC_API(bool) ParseCensusOptions(JSContext* cx,
|
||||
Census& census, HandleObject options,
|
||||
CountTypePtr& outResult);
|
||||
MOZ_MUST_USE JS_PUBLIC_API bool ParseCensusOptions(JSContext* cx,
|
||||
Census& census, HandleObject options,
|
||||
CountTypePtr& outResult);
|
||||
|
||||
// Parse the breakdown language (as described in
|
||||
// js/src/doc/Debugger/Debugger.Memory.md) into a CountTypePtr. A null pointer
|
||||
// is returned on error and is reported to the cx.
|
||||
JS_PUBLIC_API(CountTypePtr) ParseBreakdown(JSContext* cx, HandleValue breakdownValue);
|
||||
JS_PUBLIC_API CountTypePtr ParseBreakdown(JSContext* cx, HandleValue breakdownValue);
|
||||
|
||||
|
||||
} // namespace ubi
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace ubi {
|
|||
*
|
||||
* [0]: http://www.cs.rice.edu/~keith/EMBED/dom.pdf
|
||||
*/
|
||||
class JS_PUBLIC_API(DominatorTree)
|
||||
class JS_PUBLIC_API DominatorTree
|
||||
{
|
||||
private:
|
||||
// Types.
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace ubi {
|
|||
/**
|
||||
* A back edge along a path in the heap graph.
|
||||
*/
|
||||
struct JS_PUBLIC_API(BackEdge)
|
||||
struct JS_PUBLIC_API BackEdge
|
||||
{
|
||||
private:
|
||||
Node predecessor_;
|
||||
|
@ -76,7 +76,7 @@ using Path = JS::ubi::Vector<BackEdge*>;
|
|||
* retaining paths for each of a target set of nodes, starting from the same
|
||||
* root node.
|
||||
*/
|
||||
struct JS_PUBLIC_API(ShortestPaths)
|
||||
struct JS_PUBLIC_API ShortestPaths
|
||||
{
|
||||
private:
|
||||
// Types, type aliases, and data members.
|
||||
|
@ -339,7 +339,7 @@ struct JS_PUBLIC_API(ShortestPaths)
|
|||
//
|
||||
// JSObject* foo = ...;
|
||||
// JS::ubi::dumpPaths(rt, JS::ubi::Node(foo));
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
dumpPaths(JSRuntime* rt, Node node, uint32_t maxNumPaths = 10);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace js {}
|
|||
#define JS_STATIC_ASSERT(cond) static_assert(cond, "JS_STATIC_ASSERT")
|
||||
#define JS_STATIC_ASSERT_IF(cond, expr) MOZ_STATIC_ASSERT_IF(cond, expr, "JS_STATIC_ASSERT_IF")
|
||||
|
||||
extern MOZ_NORETURN MOZ_COLD JS_PUBLIC_API(void)
|
||||
extern MOZ_NORETURN MOZ_COLD JS_PUBLIC_API void
|
||||
JS_Assert(const char* s, const char* file, int ln);
|
||||
|
||||
/*
|
||||
|
@ -95,7 +95,7 @@ const ThreadType LastThreadTypeToTest = THREAD_TYPE_WASM_TIER2;
|
|||
|
||||
extern bool InitThreadType(void);
|
||||
extern void SetThreadType(ThreadType);
|
||||
extern JS_FRIEND_API(uint32_t) GetThreadType(void);
|
||||
extern JS_FRIEND_API uint32_t GetThreadType(void);
|
||||
|
||||
# else
|
||||
|
||||
|
@ -188,7 +188,7 @@ class FailureSimulator
|
|||
void simulateFailureAfter(Kind kind, uint64_t checks, uint32_t thread, bool always);
|
||||
void reset();
|
||||
};
|
||||
extern JS_PUBLIC_DATA(FailureSimulator) simulator;
|
||||
extern JS_PUBLIC_DATA FailureSimulator simulator;
|
||||
|
||||
inline bool
|
||||
IsSimulatedOOMAllocation()
|
||||
|
@ -308,7 +308,7 @@ static inline bool ShouldFailWithOOM() { return false; }
|
|||
namespace js {
|
||||
|
||||
/* Disable OOM testing in sections which are not OOM safe. */
|
||||
struct MOZ_RAII JS_PUBLIC_DATA(AutoEnterOOMUnsafeRegion)
|
||||
struct MOZ_RAII JS_PUBLIC_DATA AutoEnterOOMUnsafeRegion
|
||||
{
|
||||
MOZ_NORETURN MOZ_COLD void crash(const char* reason);
|
||||
MOZ_NORETURN MOZ_COLD void crash(size_t size, const char* reason);
|
||||
|
@ -350,8 +350,8 @@ struct MOZ_RAII JS_PUBLIC_DATA(AutoEnterOOMUnsafeRegion)
|
|||
|
||||
namespace js {
|
||||
|
||||
extern JS_PUBLIC_DATA(arena_id_t) MallocArena;
|
||||
extern JS_PUBLIC_DATA(arena_id_t) ArrayBufferContentsArena;
|
||||
extern JS_PUBLIC_DATA arena_id_t MallocArena;
|
||||
extern JS_PUBLIC_DATA arena_id_t ArrayBufferContentsArena;
|
||||
|
||||
extern void InitMallocAllocator();
|
||||
extern void ShutDownMallocAllocator();
|
||||
|
|
|
@ -1246,7 +1246,7 @@ SameType(const Value& lhs, const Value& rhs)
|
|||
/************************************************************************/
|
||||
|
||||
namespace JS {
|
||||
JS_PUBLIC_API(void) HeapValuePostBarrier(Value* valuep, const Value& prev, const Value& next);
|
||||
JS_PUBLIC_API void HeapValuePostBarrier(Value* valuep, const Value& prev, const Value& next);
|
||||
|
||||
template <>
|
||||
struct GCPolicy<JS::Value>
|
||||
|
@ -1509,10 +1509,10 @@ ValueIsNotGray(const Heap<Value>& value)
|
|||
|
||||
namespace JS {
|
||||
|
||||
extern JS_PUBLIC_DATA(const HandleValue) NullHandleValue;
|
||||
extern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;
|
||||
extern JS_PUBLIC_DATA(const HandleValue) TrueHandleValue;
|
||||
extern JS_PUBLIC_DATA(const HandleValue) FalseHandleValue;
|
||||
extern JS_PUBLIC_DATA const HandleValue NullHandleValue;
|
||||
extern JS_PUBLIC_DATA const HandleValue UndefinedHandleValue;
|
||||
extern JS_PUBLIC_DATA const HandleValue TrueHandleValue;
|
||||
extern JS_PUBLIC_DATA const HandleValue FalseHandleValue;
|
||||
|
||||
} // namespace JS
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace JS {
|
|||
// If you want to use this class for a different key/value combination, add it
|
||||
// to the list and the compiler will generate the relevant machinery.
|
||||
template <typename K, typename V>
|
||||
class JS_PUBLIC_API(WeakMapPtr)
|
||||
class JS_PUBLIC_API WeakMapPtr
|
||||
{
|
||||
public:
|
||||
WeakMapPtr() : ptr(nullptr) {}
|
||||
|
|
|
@ -44,7 +44,7 @@ class MOZ_STACK_CLASS WrapperOptions : public ProxyOptions {
|
|||
|
||||
// Base class for proxy handlers that want to forward all operations to an
|
||||
// object stored in the proxy's private slot.
|
||||
class JS_FRIEND_API(ForwardingProxyHandler) : public BaseProxyHandler
|
||||
class JS_FRIEND_API ForwardingProxyHandler : public BaseProxyHandler
|
||||
{
|
||||
public:
|
||||
using BaseProxyHandler::BaseProxyHandler;
|
||||
|
@ -117,7 +117,7 @@ class JS_FRIEND_API(ForwardingProxyHandler) : public BaseProxyHandler
|
|||
* to add an override in CrossCompartmentWrapper. If you don't, you risk
|
||||
* compartment mismatches. See bug 945826 comment 0.
|
||||
*/
|
||||
class JS_FRIEND_API(Wrapper) : public ForwardingProxyHandler
|
||||
class JS_FRIEND_API Wrapper : public ForwardingProxyHandler
|
||||
{
|
||||
unsigned mFlags;
|
||||
|
||||
|
@ -165,7 +165,7 @@ WrapperOptions::proto() const
|
|||
}
|
||||
|
||||
/* Base class for all cross compartment wrapper handlers. */
|
||||
class JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper
|
||||
class JS_FRIEND_API CrossCompartmentWrapper : public Wrapper
|
||||
{
|
||||
public:
|
||||
explicit constexpr CrossCompartmentWrapper(unsigned aFlags, bool aHasPrototype = false,
|
||||
|
@ -227,7 +227,7 @@ class JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper
|
|||
static const CrossCompartmentWrapper singletonWithPrototype;
|
||||
};
|
||||
|
||||
class JS_FRIEND_API(OpaqueCrossCompartmentWrapper) : public CrossCompartmentWrapper
|
||||
class JS_FRIEND_API OpaqueCrossCompartmentWrapper : public CrossCompartmentWrapper
|
||||
{
|
||||
public:
|
||||
explicit constexpr OpaqueCrossCompartmentWrapper() : CrossCompartmentWrapper(0)
|
||||
|
@ -291,7 +291,7 @@ class JS_FRIEND_API(OpaqueCrossCompartmentWrapper) : public CrossCompartmentWrap
|
|||
* access, relying on derived SecurityWrapper to block access when necessary.
|
||||
*/
|
||||
template <class Base>
|
||||
class JS_FRIEND_API(SecurityWrapper) : public Base
|
||||
class JS_FRIEND_API SecurityWrapper : public Base
|
||||
{
|
||||
public:
|
||||
explicit constexpr SecurityWrapper(unsigned flags, bool hasPrototype = false)
|
||||
|
@ -362,7 +362,7 @@ Wrapper::wrapperHandler(const JSObject* wrapper)
|
|||
// ExposeToActiveJS is called on wrapper targets to allow gray marking
|
||||
// assertions to work while an incremental GC is in progress, but this means
|
||||
// that this cannot be called from the GC or off the main thread.
|
||||
JS_FRIEND_API(JSObject*)
|
||||
JS_FRIEND_API JSObject*
|
||||
UncheckedUnwrap(JSObject* obj, bool stopAtWindowProxy = true, unsigned* flagsp = nullptr);
|
||||
|
||||
// Given a JSObject, returns that object stripped of wrappers. At each stage,
|
||||
|
@ -373,12 +373,12 @@ UncheckedUnwrap(JSObject* obj, bool stopAtWindowProxy = true, unsigned* flagsp =
|
|||
// ExposeToActiveJS is called on wrapper targets to allow gray marking
|
||||
// assertions to work while an incremental GC is in progress, but this means
|
||||
// that this cannot be called from the GC or off the main thread.
|
||||
JS_FRIEND_API(JSObject*)
|
||||
JS_FRIEND_API JSObject*
|
||||
CheckedUnwrap(JSObject* obj, bool stopAtWindowProxy = true);
|
||||
|
||||
// Unwrap only the outermost security wrapper, with the same semantics as
|
||||
// above. This is the checked version of Wrapper::wrappedObject.
|
||||
JS_FRIEND_API(JSObject*)
|
||||
JS_FRIEND_API JSObject*
|
||||
UnwrapOneChecked(JSObject* obj, bool stopAtWindowProxy = true);
|
||||
|
||||
// Given a JSObject, returns that object stripped of wrappers. This returns the
|
||||
|
@ -386,25 +386,25 @@ UnwrapOneChecked(JSObject* obj, bool stopAtWindowProxy = true);
|
|||
//
|
||||
// ExposeToActiveJS is not called on wrapper targets so this can be called from
|
||||
// the GC or off the main thread.
|
||||
JS_FRIEND_API(JSObject*)
|
||||
JS_FRIEND_API JSObject*
|
||||
UncheckedUnwrapWithoutExpose(JSObject* obj);
|
||||
|
||||
void
|
||||
ReportAccessDenied(JSContext* cx);
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
JS_FRIEND_API void
|
||||
NukeCrossCompartmentWrapper(JSContext* cx, JSObject* wrapper);
|
||||
|
||||
void
|
||||
RemapWrapper(JSContext* cx, JSObject* wobj, JSObject* newTarget);
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
RemapAllWrappersForObject(JSContext* cx, JSObject* oldTarget,
|
||||
JSObject* newTarget);
|
||||
|
||||
// API to recompute all cross-compartment wrappers whose source and target
|
||||
// match the given filters.
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
RecomputeWrappers(JSContext* cx, const CompartmentFilter& sourceFilter,
|
||||
const CompartmentFilter& targetFilter);
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
# Clang-format style for SpiderMonkey code which is different than the standard Mozilla style.
|
||||
BasedOnStyle: Mozilla
|
||||
ColumnLimit: 99
|
||||
IndentWidth: 4
|
||||
BasedOnStyle: Google
|
||||
|
||||
# Prevent the loss of indentation with these macros
|
||||
MacroBlockBegin: "^JS_BEGIN_MACRO$"
|
||||
|
|
|
@ -260,7 +260,7 @@ StringIsArrayIndexHelper(const CharT* s, uint32_t length, uint32_t* indexp)
|
|||
return false;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
js::StringIsArrayIndex(JSLinearString* str, uint32_t* indexp)
|
||||
{
|
||||
AutoCheckCannotGC nogc;
|
||||
|
@ -269,13 +269,13 @@ js::StringIsArrayIndex(JSLinearString* str, uint32_t* indexp)
|
|||
: StringIsArrayIndexHelper(str->twoByteChars(nogc), str->length(), indexp);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
js::StringIsArrayIndex(const char16_t* str, uint32_t length, uint32_t* indexp)
|
||||
{
|
||||
return StringIsArrayIndexHelper(str, length, indexp);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
js::StringIsArrayIndex(const char* str, uint32_t length, uint32_t* indexp)
|
||||
{
|
||||
return StringIsArrayIndexHelper(str, length, indexp);
|
||||
|
|
|
@ -171,7 +171,7 @@ js::BooleanToString(JSContext* cx, bool b)
|
|||
return b ? cx->names().true_ : cx->names().false_;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
js::ToBooleanSlow(HandleValue v)
|
||||
{
|
||||
if (v.isString()) {
|
||||
|
|
|
@ -957,7 +957,7 @@ const JSPropertySpec DataViewObject::properties[] = {
|
|||
JS_PS_END
|
||||
};
|
||||
|
||||
JS_FRIEND_API(uint32_t)
|
||||
JS_FRIEND_API uint32_t
|
||||
JS_GetDataViewByteOffset(JSObject* obj)
|
||||
{
|
||||
obj = CheckedUnwrap(obj);
|
||||
|
@ -967,7 +967,7 @@ JS_GetDataViewByteOffset(JSObject* obj)
|
|||
return obj->as<DataViewObject>().byteOffset();
|
||||
}
|
||||
|
||||
JS_FRIEND_API(void*)
|
||||
JS_FRIEND_API void*
|
||||
JS_GetDataViewData(JSObject* obj, bool* isSharedMemory, const JS::AutoRequireNoGC&)
|
||||
{
|
||||
obj = CheckedUnwrap(obj);
|
||||
|
@ -979,7 +979,7 @@ JS_GetDataViewData(JSObject* obj, bool* isSharedMemory, const JS::AutoRequireNoG
|
|||
return dv.dataPointerEither().unwrap(/*safe - caller sees isSharedMemory*/);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(uint32_t)
|
||||
JS_FRIEND_API uint32_t
|
||||
JS_GetDataViewByteLength(JSObject* obj)
|
||||
{
|
||||
obj = CheckedUnwrap(obj);
|
||||
|
@ -989,7 +989,7 @@ JS_GetDataViewByteLength(JSObject* obj)
|
|||
return obj->as<DataViewObject>().byteLength();
|
||||
}
|
||||
|
||||
JS_FRIEND_API(JSObject*)
|
||||
JS_FRIEND_API JSObject*
|
||||
JS_NewDataView(JSContext* cx, HandleObject buffer, uint32_t byteOffset, int32_t byteLength)
|
||||
{
|
||||
JSProtoKey key = JSCLASS_CACHED_PROTO_KEY(&DataViewObject::class_);
|
||||
|
|
|
@ -490,7 +490,7 @@ ExecuteInExtensibleLexicalEnvironment(JSContext* cx, HandleScript scriptArg, Han
|
|||
NullFramePtr() /* evalInFrame */, rval.address());
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
js::ExecuteInFrameScriptEnvironment(JSContext* cx, HandleObject objArg, HandleScript scriptArg,
|
||||
MutableHandleObject envArg)
|
||||
{
|
||||
|
@ -528,7 +528,7 @@ js::ExecuteInFrameScriptEnvironment(JSContext* cx, HandleObject objArg, HandleSc
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(JSObject*)
|
||||
JS_FRIEND_API JSObject*
|
||||
js::NewJSMEnvironment(JSContext* cx)
|
||||
{
|
||||
RootedObject varEnv(cx, NonSyntacticVariablesObject::create(cx));
|
||||
|
@ -546,14 +546,14 @@ js::NewJSMEnvironment(JSContext* cx)
|
|||
return varEnv;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
js::ExecuteInJSMEnvironment(JSContext* cx, HandleScript scriptArg, HandleObject varEnv)
|
||||
{
|
||||
AutoObjectVector emptyChain(cx);
|
||||
return ExecuteInJSMEnvironment(cx, scriptArg, varEnv, emptyChain);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
js::ExecuteInJSMEnvironment(JSContext* cx, HandleScript scriptArg, HandleObject varEnv,
|
||||
AutoObjectVector& targetObj)
|
||||
{
|
||||
|
@ -598,7 +598,7 @@ js::ExecuteInJSMEnvironment(JSContext* cx, HandleScript scriptArg, HandleObject
|
|||
return ExecuteInExtensibleLexicalEnvironment(cx, scriptArg, env);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(JSObject*)
|
||||
JS_FRIEND_API JSObject*
|
||||
js::GetJSMEnvironmentOfScriptedCaller(JSContext* cx)
|
||||
{
|
||||
FrameIter iter(cx);
|
||||
|
@ -618,7 +618,7 @@ js::GetJSMEnvironmentOfScriptedCaller(JSContext* cx)
|
|||
return env;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
js::IsJSMEnvironment(JSObject* obj)
|
||||
{
|
||||
// NOTE: This also returns true if the NonSyntacticVariablesObject was
|
||||
|
|
|
@ -1842,19 +1842,19 @@ CallObjFunc(bool(*ObjFunc)(JSContext* cx, Iter kind,
|
|||
|
||||
/*** JS public APIs **********************************************************/
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS_PUBLIC_API JSObject*
|
||||
JS::NewMapObject(JSContext* cx)
|
||||
{
|
||||
return MapObject::create(cx);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(uint32_t)
|
||||
JS_PUBLIC_API uint32_t
|
||||
JS::MapSize(JSContext* cx, HandleObject obj)
|
||||
{
|
||||
return CallObjFunc<uint32_t>(&MapObject::size, cx, obj);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::MapGet(JSContext* cx, HandleObject obj, HandleValue key, MutableHandleValue rval)
|
||||
{
|
||||
CHECK_THREAD(cx);
|
||||
|
@ -1888,7 +1888,7 @@ JS::MapGet(JSContext* cx, HandleObject obj, HandleValue key, MutableHandleValue
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::MapSet(JSContext *cx, HandleObject obj, HandleValue key, HandleValue val)
|
||||
{
|
||||
CHECK_THREAD(cx);
|
||||
|
@ -1915,61 +1915,61 @@ JS::MapSet(JSContext *cx, HandleObject obj, HandleValue key, HandleValue val)
|
|||
}
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::MapHas(JSContext* cx, HandleObject obj, HandleValue key, bool* rval)
|
||||
{
|
||||
return CallObjFunc(MapObject::has, cx, obj, key, rval);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::MapDelete(JSContext *cx, HandleObject obj, HandleValue key, bool* rval)
|
||||
{
|
||||
return CallObjFunc(MapObject::delete_, cx, obj, key, rval);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::MapClear(JSContext* cx, HandleObject obj)
|
||||
{
|
||||
return CallObjFunc(&MapObject::clear, cx, obj);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::MapKeys(JSContext* cx, HandleObject obj, MutableHandleValue rval)
|
||||
{
|
||||
return CallObjFunc(&MapObject::iterator, cx, MapObject::Keys, obj, rval);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::MapValues(JSContext* cx, HandleObject obj, MutableHandleValue rval)
|
||||
{
|
||||
return CallObjFunc(&MapObject::iterator, cx, MapObject::Values, obj, rval);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::MapEntries(JSContext* cx, HandleObject obj, MutableHandleValue rval)
|
||||
{
|
||||
return CallObjFunc(&MapObject::iterator, cx, MapObject::Entries, obj, rval);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::MapForEach(JSContext *cx, HandleObject obj, HandleValue callbackFn, HandleValue thisVal)
|
||||
{
|
||||
return forEach("MapForEach", cx, obj, callbackFn, thisVal);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject *)
|
||||
JS_PUBLIC_API JSObject *
|
||||
JS::NewSetObject(JSContext *cx)
|
||||
{
|
||||
return SetObject::create(cx);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(uint32_t)
|
||||
JS_PUBLIC_API uint32_t
|
||||
JS::SetSize(JSContext *cx, HandleObject obj)
|
||||
{
|
||||
return CallObjFunc<uint32_t>(&SetObject::size, cx, obj);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::SetAdd(JSContext *cx, HandleObject obj, HandleValue key)
|
||||
{
|
||||
CHECK_THREAD(cx);
|
||||
|
@ -1993,43 +1993,43 @@ JS::SetAdd(JSContext *cx, HandleObject obj, HandleValue key)
|
|||
}
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::SetHas(JSContext* cx, HandleObject obj, HandleValue key, bool* rval)
|
||||
{
|
||||
return CallObjFunc(SetObject::has, cx, obj, key, rval);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::SetDelete(JSContext *cx, HandleObject obj, HandleValue key, bool *rval)
|
||||
{
|
||||
return CallObjFunc(SetObject::delete_, cx, obj, key, rval);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::SetClear(JSContext* cx, HandleObject obj)
|
||||
{
|
||||
return CallObjFunc(&SetObject::clear, cx, obj);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::SetKeys(JSContext* cx, HandleObject obj, MutableHandleValue rval)
|
||||
{
|
||||
return SetValues(cx, obj, rval);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::SetValues(JSContext* cx, HandleObject obj, MutableHandleValue rval)
|
||||
{
|
||||
return CallObjFunc(&SetObject::iterator, cx, SetObject::Values, obj, rval);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::SetEntries(JSContext* cx, HandleObject obj, MutableHandleValue rval)
|
||||
{
|
||||
return CallObjFunc(&SetObject::iterator, cx, SetObject::Entries, obj, rval);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::SetForEach(JSContext *cx, HandleObject obj, HandleValue callbackFn, HandleValue thisVal)
|
||||
{
|
||||
return forEach("SetForEach", cx, obj, callbackFn, thisVal);
|
||||
|
|
|
@ -55,7 +55,7 @@ UnsafeError(const char* format, ...)
|
|||
}
|
||||
#endif
|
||||
|
||||
JS_PUBLIC_API(const char*)
|
||||
JS_PUBLIC_API const char*
|
||||
JS_UnsafeGetLastProfilingError()
|
||||
{
|
||||
return gLastError;
|
||||
|
@ -83,7 +83,7 @@ StartOSXProfiling(const char* profileName, pid_t pid)
|
|||
}
|
||||
#endif
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_StartProfiling(const char* profileName, pid_t pid)
|
||||
{
|
||||
bool ok = true;
|
||||
|
@ -98,7 +98,7 @@ JS_StartProfiling(const char* profileName, pid_t pid)
|
|||
return ok;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_StopProfiling(const char* profileName)
|
||||
{
|
||||
bool ok = true;
|
||||
|
@ -170,19 +170,19 @@ ControlProfilers(bool toState)
|
|||
* profilers' pause/resume functions, because only overall state is
|
||||
* tracked, not the state of each profiler.
|
||||
*/
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_PauseProfilers(const char* profileName)
|
||||
{
|
||||
return ControlProfilers(false);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_ResumeProfilers(const char* profileName)
|
||||
{
|
||||
return ControlProfilers(true);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_DumpProfile(const char* outfile, const char* profileName)
|
||||
{
|
||||
bool ok = true;
|
||||
|
@ -408,7 +408,7 @@ static const JSFunctionSpec profiling_functions[] = {
|
|||
|
||||
#endif
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_DefineProfilingFunctions(JSContext* cx, HandleObject obj)
|
||||
{
|
||||
cx->check(obj);
|
||||
|
@ -449,7 +449,7 @@ JS_DefineProfilingFunctions(JSContext* cx, HandleObject obj)
|
|||
JS_END_MACRO
|
||||
#endif
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
js_StartCallgrind()
|
||||
{
|
||||
JS_SILENCE_UNUSED_VALUE_IN_EXPR(CALLGRIND_START_INSTRUMENTATION);
|
||||
|
@ -457,14 +457,14 @@ js_StartCallgrind()
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
js_StopCallgrind()
|
||||
{
|
||||
JS_SILENCE_UNUSED_VALUE_IN_EXPR(CALLGRIND_STOP_INSTRUMENTATION);
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
js_DumpCallgrind(const char* outfile)
|
||||
{
|
||||
if (outfile) {
|
||||
|
|
|
@ -30,21 +30,21 @@ typedef int pid_t;
|
|||
*
|
||||
* Returns true if no profilers fail to start.
|
||||
*/
|
||||
extern MOZ_MUST_USE JS_PUBLIC_API(bool)
|
||||
extern MOZ_MUST_USE JS_PUBLIC_API bool
|
||||
JS_StartProfiling(const char* profileName, pid_t pid);
|
||||
|
||||
/**
|
||||
* Stop any profilers that were previously started with JS_StartProfiling.
|
||||
* Returns true if no profilers fail to stop.
|
||||
*/
|
||||
extern MOZ_MUST_USE JS_PUBLIC_API(bool)
|
||||
extern MOZ_MUST_USE JS_PUBLIC_API bool
|
||||
JS_StopProfiling(const char* profileName);
|
||||
|
||||
/**
|
||||
* Write the current profile data to the given file, if applicable to whatever
|
||||
* profiler is being used.
|
||||
*/
|
||||
extern MOZ_MUST_USE JS_PUBLIC_API(bool)
|
||||
extern MOZ_MUST_USE JS_PUBLIC_API bool
|
||||
JS_DumpProfile(const char* outfile, const char* profileName);
|
||||
|
||||
/**
|
||||
|
@ -52,13 +52,13 @@ JS_DumpProfile(const char* outfile, const char* profileName);
|
|||
* whether any profilers failed to pause. (Profilers that do not support
|
||||
* pause/resume do not count.)
|
||||
*/
|
||||
extern MOZ_MUST_USE JS_PUBLIC_API(bool)
|
||||
extern MOZ_MUST_USE JS_PUBLIC_API bool
|
||||
JS_PauseProfilers(const char* profileName);
|
||||
|
||||
/**
|
||||
* Resume suspended profilers
|
||||
*/
|
||||
extern MOZ_MUST_USE JS_PUBLIC_API(bool)
|
||||
extern MOZ_MUST_USE JS_PUBLIC_API bool
|
||||
JS_ResumeProfilers(const char* profileName);
|
||||
|
||||
/**
|
||||
|
@ -66,28 +66,28 @@ JS_ResumeProfilers(const char* profileName);
|
|||
* thread-unsafe global memory buffer to hold the last error encountered. This
|
||||
* should only be called after something returns false.
|
||||
*/
|
||||
JS_PUBLIC_API(const char*)
|
||||
JS_PUBLIC_API const char*
|
||||
JS_UnsafeGetLastProfilingError();
|
||||
|
||||
#ifdef MOZ_CALLGRIND
|
||||
|
||||
extern MOZ_MUST_USE JS_FRIEND_API(bool)
|
||||
extern MOZ_MUST_USE JS_FRIEND_API bool
|
||||
js_StopCallgrind();
|
||||
|
||||
extern MOZ_MUST_USE JS_FRIEND_API(bool)
|
||||
extern MOZ_MUST_USE JS_FRIEND_API bool
|
||||
js_StartCallgrind();
|
||||
|
||||
extern MOZ_MUST_USE JS_FRIEND_API(bool)
|
||||
extern MOZ_MUST_USE JS_FRIEND_API bool
|
||||
js_DumpCallgrind(const char* outfile);
|
||||
|
||||
#endif /* MOZ_CALLGRIND */
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
extern MOZ_MUST_USE JS_FRIEND_API(bool)
|
||||
extern MOZ_MUST_USE JS_FRIEND_API bool
|
||||
js_StartPerf();
|
||||
|
||||
extern MOZ_MUST_USE JS_FRIEND_API(bool)
|
||||
extern MOZ_MUST_USE JS_FRIEND_API bool
|
||||
js_StopPerf();
|
||||
|
||||
#endif /* __linux__ */
|
||||
|
|
|
@ -3866,7 +3866,7 @@ reflect_parse(JSContext* cx, uint32_t argc, Value* vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_InitReflectParse(JSContext* cx, HandleObject global)
|
||||
{
|
||||
RootedValue reflectVal(cx);
|
||||
|
|
|
@ -978,8 +978,10 @@ TeeReaderReadHandler(JSContext* cx, unsigned argc, Value* vp)
|
|||
// true, set value2 to
|
||||
// ? StructuredDeserialize(StructuredSerialize(value2),
|
||||
// the current Realm Record).
|
||||
// TODO: add StructuredClone() intrinsic.
|
||||
MOZ_ASSERT(!unwrappedTeeState->cloneForBranch2(), "tee(cloneForBranch2=true) should not be exposed");
|
||||
// We don't yet support any specifications that use cloneForBranch2, and
|
||||
// the Streams spec doesn't offer any way for author code to enable it,
|
||||
// so it's always false here.
|
||||
MOZ_ASSERT(!unwrappedTeeState->cloneForBranch2());
|
||||
|
||||
// Step i: If teeState.[[canceled1]] is false, perform
|
||||
// ? ReadableStreamDefaultControllerEnqueue(branch1, value1).
|
||||
|
@ -3989,7 +3991,7 @@ ValidateAndNormalizeQueuingStrategy(JSContext* cx, HandleValue size,
|
|||
|
||||
/*** API entry points ****************************************************************************/
|
||||
|
||||
JS_FRIEND_API(JSObject*)
|
||||
JS_FRIEND_API JSObject*
|
||||
js::UnwrapReadableStream(JSObject* obj)
|
||||
{
|
||||
if (JSObject* unwrapped = CheckedUnwrap(obj)) {
|
||||
|
@ -3998,7 +4000,7 @@ js::UnwrapReadableStream(JSObject* obj)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
extern JS_PUBLIC_API void
|
||||
JS::SetReadableStreamCallbacks(JSContext* cx,
|
||||
JS::RequestReadableStreamDataCallback dataRequestCallback,
|
||||
JS::WriteIntoReadRequestBufferCallback writeIntoReadRequestCallback,
|
||||
|
@ -4031,13 +4033,13 @@ JS::SetReadableStreamCallbacks(JSContext* cx,
|
|||
rt->readableStreamFinalizeCallback = finalizeCallback;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::HasReadableStreamCallbacks(JSContext* cx)
|
||||
{
|
||||
return cx->runtime()->readableStreamDataRequestCallback;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS_PUBLIC_API JSObject*
|
||||
JS::NewReadableDefaultStreamObject(JSContext* cx,
|
||||
JS::HandleObject underlyingSource /* = nullptr */,
|
||||
JS::HandleFunction size /* = nullptr */,
|
||||
|
@ -4062,7 +4064,7 @@ JS::NewReadableDefaultStreamObject(JSContext* cx,
|
|||
return ReadableStream::createDefaultStream(cx, sourceVal, sizeVal, highWaterMarkVal, proto);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS_PUBLIC_API JSObject*
|
||||
JS::NewReadableExternalSourceStreamObject(JSContext* cx,
|
||||
void* underlyingSource,
|
||||
uint8_t flags /* = 0 */,
|
||||
|
@ -4087,19 +4089,19 @@ JS::NewReadableExternalSourceStreamObject(JSContext* cx,
|
|||
return ReadableStream::createExternalSourceStream(cx, underlyingSource, flags, proto);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::IsReadableStream(JSObject* obj)
|
||||
{
|
||||
return obj->canUnwrapAs<ReadableStream>();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::IsReadableStreamReader(JSObject* obj)
|
||||
{
|
||||
return obj->canUnwrapAs<ReadableStreamDefaultReader>();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::IsReadableStreamDefaultReader(JSObject* obj)
|
||||
{
|
||||
return obj->canUnwrapAs<ReadableStreamDefaultReader>();
|
||||
|
@ -4113,7 +4115,7 @@ APIToUnwrapped(JSContext* cx, JSObject* obj)
|
|||
return ToUnwrapped<T>(cx, obj);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamIsReadable(JSContext* cx, HandleObject streamObj, bool* result)
|
||||
{
|
||||
ReadableStream* unwrappedStream = APIToUnwrapped<ReadableStream>(cx, streamObj);
|
||||
|
@ -4125,7 +4127,7 @@ JS::ReadableStreamIsReadable(JSContext* cx, HandleObject streamObj, bool* result
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamIsLocked(JSContext* cx, HandleObject streamObj, bool* result)
|
||||
{
|
||||
ReadableStream* unwrappedStream = APIToUnwrapped<ReadableStream>(cx, streamObj);
|
||||
|
@ -4137,7 +4139,7 @@ JS::ReadableStreamIsLocked(JSContext* cx, HandleObject streamObj, bool* result)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamIsDisturbed(JSContext* cx, HandleObject streamObj, bool* result)
|
||||
{
|
||||
ReadableStream* unwrappedStream = APIToUnwrapped<ReadableStream>(cx, streamObj);
|
||||
|
@ -4149,7 +4151,7 @@ JS::ReadableStreamIsDisturbed(JSContext* cx, HandleObject streamObj, bool* resul
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamGetEmbeddingFlags(JSContext* cx, HandleObject streamObj, uint8_t* flags)
|
||||
{
|
||||
ReadableStream* unwrappedStream = APIToUnwrapped<ReadableStream>(cx, streamObj);
|
||||
|
@ -4161,7 +4163,7 @@ JS::ReadableStreamGetEmbeddingFlags(JSContext* cx, HandleObject streamObj, uint8
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS_PUBLIC_API JSObject*
|
||||
JS::ReadableStreamCancel(JSContext* cx, HandleObject streamObj, HandleValue reason)
|
||||
{
|
||||
AssertHeapIsIdle();
|
||||
|
@ -4176,7 +4178,7 @@ JS::ReadableStreamCancel(JSContext* cx, HandleObject streamObj, HandleValue reas
|
|||
return ::ReadableStreamCancel(cx, unwrappedStream, reason);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamGetMode(JSContext* cx, HandleObject streamObj, JS::ReadableStreamMode* mode)
|
||||
{
|
||||
ReadableStream* unwrappedStream = APIToUnwrapped<ReadableStream>(cx, streamObj);
|
||||
|
@ -4188,7 +4190,7 @@ JS::ReadableStreamGetMode(JSContext* cx, HandleObject streamObj, JS::ReadableStr
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS_PUBLIC_API JSObject*
|
||||
JS::ReadableStreamGetReader(JSContext* cx, HandleObject streamObj, ReadableStreamReaderMode mode)
|
||||
{
|
||||
AssertHeapIsIdle();
|
||||
|
@ -4204,7 +4206,7 @@ JS::ReadableStreamGetReader(JSContext* cx, HandleObject streamObj, ReadableStrea
|
|||
return result;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamGetExternalUnderlyingSource(JSContext* cx, HandleObject streamObj, void** source)
|
||||
{
|
||||
AssertHeapIsIdle();
|
||||
|
@ -4233,7 +4235,7 @@ JS::ReadableStreamGetExternalUnderlyingSource(JSContext* cx, HandleObject stream
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamReleaseExternalUnderlyingSource(JSContext* cx, HandleObject streamObj)
|
||||
{
|
||||
ReadableStream* unwrappedStream = APIToUnwrapped<ReadableStream>(cx, streamObj);
|
||||
|
@ -4248,7 +4250,7 @@ JS::ReadableStreamReleaseExternalUnderlyingSource(JSContext* cx, HandleObject st
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamUpdateDataAvailableFromSource(JSContext* cx, JS::HandleObject streamObj,
|
||||
uint32_t availableData)
|
||||
{
|
||||
|
@ -4363,7 +4365,7 @@ JS::ReadableStreamUpdateDataAvailableFromSource(JSContext* cx, JS::HandleObject
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamTee(JSContext* cx, HandleObject streamObj,
|
||||
MutableHandleObject branch1Obj, MutableHandleObject branch2Obj)
|
||||
{
|
||||
|
@ -4387,7 +4389,7 @@ JS::ReadableStreamTee(JSContext* cx, HandleObject streamObj,
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamGetDesiredSize(JSContext* cx, JSObject* streamObj, bool* hasValue, double* value)
|
||||
{
|
||||
ReadableStream* unwrappedStream = APIToUnwrapped<ReadableStream>(cx, streamObj);
|
||||
|
@ -4411,7 +4413,7 @@ JS::ReadableStreamGetDesiredSize(JSContext* cx, JSObject* streamObj, bool* hasVa
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamClose(JSContext* cx, HandleObject streamObj)
|
||||
{
|
||||
AssertHeapIsIdle();
|
||||
|
@ -4438,7 +4440,7 @@ JS::ReadableStreamClose(JSContext* cx, HandleObject streamObj)
|
|||
return ReadableByteStreamControllerClose(cx, unwrappedController);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamEnqueue(JSContext* cx, HandleObject streamObj, HandleValue chunk)
|
||||
{
|
||||
AssertHeapIsIdle();
|
||||
|
@ -4466,7 +4468,7 @@ JS::ReadableStreamEnqueue(JSContext* cx, HandleObject streamObj, HandleValue chu
|
|||
return ReadableStreamDefaultControllerEnqueue(cx, unwrappedController, chunk);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamError(JSContext* cx, HandleObject streamObj, HandleValue error)
|
||||
{
|
||||
AssertHeapIsIdle();
|
||||
|
@ -4490,7 +4492,7 @@ JS::ReadableStreamError(JSContext* cx, HandleObject streamObj, HandleValue error
|
|||
return ReadableStreamControllerError(cx, unwrappedController, error);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamReaderIsClosed(JSContext* cx, HandleObject readerObj, bool* result)
|
||||
{
|
||||
Rooted<ReadableStreamReader*> unwrappedReader(cx,
|
||||
|
@ -4503,7 +4505,7 @@ JS::ReadableStreamReaderIsClosed(JSContext* cx, HandleObject readerObj, bool* re
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamReaderCancel(JSContext* cx, HandleObject readerObj, HandleValue reason)
|
||||
{
|
||||
AssertHeapIsIdle();
|
||||
|
@ -4519,7 +4521,7 @@ JS::ReadableStreamReaderCancel(JSContext* cx, HandleObject readerObj, HandleValu
|
|||
return ReadableStreamReaderGenericCancel(cx, unwrappedReader, reason);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::ReadableStreamReaderReleaseLock(JSContext* cx, HandleObject readerObj)
|
||||
{
|
||||
AssertHeapIsIdle();
|
||||
|
@ -4541,7 +4543,7 @@ JS::ReadableStreamReaderReleaseLock(JSContext* cx, HandleObject readerObj)
|
|||
return ReadableStreamReaderGenericRelease(cx, unwrappedReader);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS_PUBLIC_API JSObject*
|
||||
JS::ReadableStreamDefaultReaderRead(JSContext* cx, HandleObject readerObj)
|
||||
{
|
||||
AssertHeapIsIdle();
|
||||
|
|
|
@ -115,6 +115,7 @@ static bool
|
|||
Escape(JSContext* cx, const CharT* chars, uint32_t length, InlineCharBuffer<Latin1Char>& newChars,
|
||||
uint32_t* newLengthOut)
|
||||
{
|
||||
// clang-format off
|
||||
static const uint8_t shouldPassThrough[128] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
|
@ -125,6 +126,7 @@ Escape(JSContext* cx, const CharT* chars, uint32_t length, InlineCharBuffer<Lati
|
|||
0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* `abcdefghijklmno */
|
||||
1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* pqrstuvwxyz{\}~ DEL */
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
/* Take a first pass and see how big the result string will need to be. */
|
||||
uint32_t newLength = length;
|
||||
|
|
|
@ -264,20 +264,20 @@ class ScalarTypeDescr : public SimpleTypeDescr
|
|||
// Enumerates the cases of ScalarTypeDescr::Type which have
|
||||
// unique C representation. In particular, omits Uint8Clamped since it
|
||||
// is just a Uint8.
|
||||
#define JS_FOR_EACH_UNIQUE_SCALAR_TYPE_REPR_CTYPE(macro_) \
|
||||
macro_(Scalar::Int8, int8_t, int8) \
|
||||
macro_(Scalar::Uint8, uint8_t, uint8) \
|
||||
macro_(Scalar::Int16, int16_t, int16) \
|
||||
macro_(Scalar::Uint16, uint16_t, uint16) \
|
||||
macro_(Scalar::Int32, int32_t, int32) \
|
||||
macro_(Scalar::Uint32, uint32_t, uint32) \
|
||||
macro_(Scalar::Float32, float, float32) \
|
||||
macro_(Scalar::Float64, double, float64)
|
||||
#define JS_FOR_EACH_UNIQUE_SCALAR_TYPE_REPR_CTYPE(MACRO_) \
|
||||
MACRO_(Scalar::Int8, int8_t, int8) \
|
||||
MACRO_(Scalar::Uint8, uint8_t, uint8) \
|
||||
MACRO_(Scalar::Int16, int16_t, int16) \
|
||||
MACRO_(Scalar::Uint16, uint16_t, uint16) \
|
||||
MACRO_(Scalar::Int32, int32_t, int32) \
|
||||
MACRO_(Scalar::Uint32, uint32_t, uint32) \
|
||||
MACRO_(Scalar::Float32, float, float32) \
|
||||
MACRO_(Scalar::Float64, double, float64)
|
||||
|
||||
// Must be in same order as the enum ScalarTypeDescr::Type:
|
||||
#define JS_FOR_EACH_SCALAR_TYPE_REPR(macro_) \
|
||||
JS_FOR_EACH_UNIQUE_SCALAR_TYPE_REPR_CTYPE(macro_) \
|
||||
macro_(Scalar::Uint8Clamped, uint8_t, uint8Clamped)
|
||||
#define JS_FOR_EACH_SCALAR_TYPE_REPR(MACRO_) \
|
||||
JS_FOR_EACH_UNIQUE_SCALAR_TYPE_REPR_CTYPE(MACRO_) \
|
||||
MACRO_(Scalar::Uint8Clamped, uint8_t, uint8Clamped)
|
||||
|
||||
enum class ReferenceType {
|
||||
TYPE_ANY = JS_REFERENCETYPEREPR_ANY,
|
||||
|
@ -314,10 +314,10 @@ class ReferenceTypeDescr : public SimpleTypeDescr
|
|||
static MOZ_MUST_USE bool call(JSContext* cx, unsigned argc, Value* vp);
|
||||
};
|
||||
|
||||
#define JS_FOR_EACH_REFERENCE_TYPE_REPR(macro_) \
|
||||
macro_(ReferenceType::TYPE_ANY, GCPtrValue, Any) \
|
||||
macro_(ReferenceType::TYPE_OBJECT, GCPtrObject, Object) \
|
||||
macro_(ReferenceType::TYPE_STRING, GCPtrString, string)
|
||||
#define JS_FOR_EACH_REFERENCE_TYPE_REPR(MACRO_) \
|
||||
MACRO_(ReferenceType::TYPE_ANY, GCPtrValue, Any) \
|
||||
MACRO_(ReferenceType::TYPE_OBJECT, GCPtrObject, Object) \
|
||||
MACRO_(ReferenceType::TYPE_STRING, GCPtrString, string)
|
||||
|
||||
// Type descriptors whose instances are objects and hence which have
|
||||
// an associated `prototype` property.
|
||||
|
|
|
@ -164,7 +164,7 @@ WeakCollectionObject::nondeterministicGetKeys(JSContext* cx, Handle<WeakCollecti
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
JS_NondeterministicGetWeakMapKeys(JSContext* cx, HandleObject objArg, MutableHandleObject ret)
|
||||
{
|
||||
RootedObject obj(cx, UncheckedUnwrap(objArg));
|
||||
|
@ -192,19 +192,19 @@ WeakCollection_finalize(FreeOp* fop, JSObject* obj)
|
|||
}
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS_PUBLIC_API JSObject*
|
||||
JS::NewWeakMapObject(JSContext* cx)
|
||||
{
|
||||
return NewBuiltinClassInstance<WeakMapObject>(cx);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::IsWeakMapObject(JSObject* obj)
|
||||
{
|
||||
return obj->is<WeakMapObject>();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::GetWeakMapEntry(JSContext* cx, HandleObject mapObj, HandleObject key,
|
||||
MutableHandleValue rval)
|
||||
{
|
||||
|
@ -224,7 +224,7 @@ JS::GetWeakMapEntry(JSContext* cx, HandleObject mapObj, HandleObject key,
|
|||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS::SetWeakMapEntry(JSContext* cx, HandleObject mapObj, HandleObject key,
|
||||
HandleValue val)
|
||||
{
|
||||
|
|
|
@ -250,7 +250,7 @@ js::InitWeakSetClass(JSContext* cx, Handle<GlobalObject*> global)
|
|||
return WeakSetObject::initClass(cx, global);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_FRIEND_API bool
|
||||
JS_NondeterministicGetWeakSetKeys(JSContext* cx, HandleObject objArg, MutableHandleObject ret)
|
||||
{
|
||||
RootedObject obj(cx, UncheckedUnwrap(objArg));
|
||||
|
|
|
@ -2449,7 +2449,7 @@ static bool GetObjectProperty(JSContext* cx, HandleObject obj,
|
|||
using namespace js;
|
||||
using namespace js::ctypes;
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_PUBLIC_API bool
|
||||
JS_InitCTypesClass(JSContext* cx, HandleObject global)
|
||||
{
|
||||
// attach ctypes property to global object
|
||||
|
@ -2500,7 +2500,7 @@ JS_InitCTypesClass(JSContext* cx, HandleObject global)
|
|||
return JS_FreezeObject(cx, ctypes);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS_PUBLIC_API void
|
||||
JS_SetCTypesCallbacks(JSObject* ctypesObj, const JSCTypesCallbacks* callbacks)
|
||||
{
|
||||
MOZ_ASSERT(callbacks);
|
||||
|
@ -2513,7 +2513,7 @@ JS_SetCTypesCallbacks(JSObject* ctypesObj, const JSCTypesCallbacks* callbacks)
|
|||
|
||||
namespace js {
|
||||
|
||||
JS_FRIEND_API(size_t)
|
||||
JS_FRIEND_API size_t
|
||||
SizeOfDataIfCDataObject(mozilla::MallocSizeOf mallocSizeOf, JSObject* obj)
|
||||
{
|
||||
if (!CData::IsCData(obj)) {
|
||||
|
|
|
@ -9,18 +9,18 @@
|
|||
* macros that the user must call, providing a macro that will consume the
|
||||
* arguments provided to it by the higher-order macro. The macros exposed are:
|
||||
*
|
||||
* CTYPES_FOR_EACH_BOOL_TYPE(macro)
|
||||
* CTYPES_FOR_EACH_CHAR_TYPE(macro)
|
||||
* CTYPES_FOR_EACH_CHAR16_TYPE(macro)
|
||||
* CTYPES_FOR_EACH_INT_TYPE(macro)
|
||||
* CTYPES_FOR_EACH_WRAPPED_INT_TYPE(macro)
|
||||
* CTYPES_FOR_EACH_FLOAT_TYPE(macro)
|
||||
* CTYPES_FOR_EACH_TYPE(macro)
|
||||
* CTYPES_FOR_EACH_BOOL_TYPE(MACRO)
|
||||
* CTYPES_FOR_EACH_CHAR_TYPE(MACRO)
|
||||
* CTYPES_FOR_EACH_CHAR16_TYPE(MACRO)
|
||||
* CTYPES_FOR_EACH_INT_TYPE(MACRO)
|
||||
* CTYPES_FOR_EACH_WRAPPED_INT_TYPE(MACRO)
|
||||
* CTYPES_FOR_EACH_FLOAT_TYPE(MACRO)
|
||||
* CTYPES_FOR_EACH_TYPE(MACRO)
|
||||
*
|
||||
* The macro name provided to any of these macros will then be repeatedly
|
||||
* The MACRO name provided to any of these macros will then be repeatedly
|
||||
* invoked as
|
||||
*
|
||||
* macro(typename, ctype, ffitype)
|
||||
* MACRO(typename, ctype, ffitype)
|
||||
*
|
||||
* where 'typename' is the name of the type constructor (accessible as
|
||||
* ctypes.typename), 'ctype' is the corresponding C type declaration (from
|
||||
|
@ -53,54 +53,54 @@
|
|||
#define CTYPES_FFI_INTPTR_T (sizeof(uintptr_t) == 4 ? ffi_type_sint32 : ffi_type_sint64)
|
||||
#define CTYPES_FFI_UINTPTR_T (sizeof(uintptr_t) == 4 ? ffi_type_uint32 : ffi_type_uint64)
|
||||
|
||||
#define CTYPES_FOR_EACH_BOOL_TYPE(macro) \
|
||||
macro(bool, bool, CTYPES_FFI_BOOL)
|
||||
#define CTYPES_FOR_EACH_BOOL_TYPE(MACRO) \
|
||||
MACRO(bool, bool, CTYPES_FFI_BOOL)
|
||||
|
||||
#define CTYPES_FOR_EACH_INT_TYPE(macro) \
|
||||
macro(int8_t, int8_t, ffi_type_sint8) \
|
||||
macro(int16_t, int16_t, ffi_type_sint16) \
|
||||
macro(int32_t, int32_t, ffi_type_sint32) \
|
||||
macro(uint8_t, uint8_t, ffi_type_uint8) \
|
||||
macro(uint16_t, uint16_t, ffi_type_uint16) \
|
||||
macro(uint32_t, uint32_t, ffi_type_uint32) \
|
||||
macro(short, short, ffi_type_sint16) \
|
||||
macro(unsigned_short, unsigned short, ffi_type_uint16) \
|
||||
macro(int, int, ffi_type_sint32) \
|
||||
macro(unsigned_int, unsigned int, ffi_type_uint32)
|
||||
#define CTYPES_FOR_EACH_INT_TYPE(MACRO) \
|
||||
MACRO(int8_t, int8_t, ffi_type_sint8) \
|
||||
MACRO(int16_t, int16_t, ffi_type_sint16) \
|
||||
MACRO(int32_t, int32_t, ffi_type_sint32) \
|
||||
MACRO(uint8_t, uint8_t, ffi_type_uint8) \
|
||||
MACRO(uint16_t, uint16_t, ffi_type_uint16) \
|
||||
MACRO(uint32_t, uint32_t, ffi_type_uint32) \
|
||||
MACRO(short, short, ffi_type_sint16) \
|
||||
MACRO(unsigned_short, unsigned short, ffi_type_uint16) \
|
||||
MACRO(int, int, ffi_type_sint32) \
|
||||
MACRO(unsigned_int, unsigned int, ffi_type_uint32)
|
||||
|
||||
#define CTYPES_FOR_EACH_WRAPPED_INT_TYPE(macro) \
|
||||
macro(int64_t, int64_t, ffi_type_sint64) \
|
||||
macro(uint64_t, uint64_t, ffi_type_uint64) \
|
||||
macro(long, long, CTYPES_FFI_LONG) \
|
||||
macro(unsigned_long, unsigned long, CTYPES_FFI_ULONG) \
|
||||
macro(long_long, long long, ffi_type_sint64) \
|
||||
macro(unsigned_long_long, unsigned long long, ffi_type_uint64) \
|
||||
macro(size_t, size_t, CTYPES_FFI_SIZE_T) \
|
||||
macro(ssize_t, CTYPES_SSIZE_T, CTYPES_FFI_SSIZE_T) \
|
||||
macro(off_t, off_t, CTYPES_FFI_OFF_T) \
|
||||
macro(intptr_t, intptr_t, CTYPES_FFI_INTPTR_T) \
|
||||
macro(uintptr_t, uintptr_t, CTYPES_FFI_UINTPTR_T)
|
||||
#define CTYPES_FOR_EACH_WRAPPED_INT_TYPE(MACRO) \
|
||||
MACRO(int64_t, int64_t, ffi_type_sint64) \
|
||||
MACRO(uint64_t, uint64_t, ffi_type_uint64) \
|
||||
MACRO(long, long, CTYPES_FFI_LONG) \
|
||||
MACRO(unsigned_long, unsigned long, CTYPES_FFI_ULONG) \
|
||||
MACRO(long_long, long long, ffi_type_sint64) \
|
||||
MACRO(unsigned_long_long, unsigned long long, ffi_type_uint64) \
|
||||
MACRO(size_t, size_t, CTYPES_FFI_SIZE_T) \
|
||||
MACRO(ssize_t, CTYPES_SSIZE_T, CTYPES_FFI_SSIZE_T) \
|
||||
MACRO(off_t, off_t, CTYPES_FFI_OFF_T) \
|
||||
MACRO(intptr_t, intptr_t, CTYPES_FFI_INTPTR_T) \
|
||||
MACRO(uintptr_t, uintptr_t, CTYPES_FFI_UINTPTR_T)
|
||||
|
||||
#define CTYPES_FOR_EACH_FLOAT_TYPE(macro) \
|
||||
macro(float32_t, float, ffi_type_float) \
|
||||
macro(float64_t, double, ffi_type_double) \
|
||||
macro(float, float, ffi_type_float) \
|
||||
macro(double, double, ffi_type_double)
|
||||
#define CTYPES_FOR_EACH_FLOAT_TYPE(MACRO) \
|
||||
MACRO(float32_t, float, ffi_type_float) \
|
||||
MACRO(float64_t, double, ffi_type_double) \
|
||||
MACRO(float, float, ffi_type_float) \
|
||||
MACRO(double, double, ffi_type_double)
|
||||
|
||||
#define CTYPES_FOR_EACH_CHAR_TYPE(macro) \
|
||||
macro(char, char, ffi_type_uint8) \
|
||||
macro(signed_char, signed char, ffi_type_sint8) \
|
||||
macro(unsigned_char, unsigned char, ffi_type_uint8)
|
||||
#define CTYPES_FOR_EACH_CHAR_TYPE(MACRO) \
|
||||
MACRO(char, char, ffi_type_uint8) \
|
||||
MACRO(signed_char, signed char, ffi_type_sint8) \
|
||||
MACRO(unsigned_char, unsigned char, ffi_type_uint8)
|
||||
|
||||
#define CTYPES_FOR_EACH_CHAR16_TYPE(macro) \
|
||||
macro(char16_t, char16_t, ffi_type_uint16)
|
||||
#define CTYPES_FOR_EACH_CHAR16_TYPE(MACRO) \
|
||||
MACRO(char16_t, char16_t, ffi_type_uint16)
|
||||
|
||||
#define CTYPES_FOR_EACH_TYPE(macro) \
|
||||
CTYPES_FOR_EACH_BOOL_TYPE(macro) \
|
||||
CTYPES_FOR_EACH_INT_TYPE(macro) \
|
||||
CTYPES_FOR_EACH_WRAPPED_INT_TYPE(macro) \
|
||||
CTYPES_FOR_EACH_FLOAT_TYPE(macro) \
|
||||
CTYPES_FOR_EACH_CHAR_TYPE(macro) \
|
||||
CTYPES_FOR_EACH_CHAR16_TYPE(macro)
|
||||
#define CTYPES_FOR_EACH_TYPE(MACRO) \
|
||||
CTYPES_FOR_EACH_BOOL_TYPE(MACRO) \
|
||||
CTYPES_FOR_EACH_INT_TYPE(MACRO) \
|
||||
CTYPES_FOR_EACH_WRAPPED_INT_TYPE(MACRO) \
|
||||
CTYPES_FOR_EACH_FLOAT_TYPE(MACRO) \
|
||||
CTYPES_FOR_EACH_CHAR_TYPE(MACRO) \
|
||||
CTYPES_FOR_EACH_CHAR16_TYPE(MACRO)
|
||||
|
||||
#endif /* ctypes_typedefs_h */
|
||||
|
|
|
@ -9404,7 +9404,7 @@ SrcNoteArity(jssrcnote* sn)
|
|||
return js_SrcNoteSpec[SN_TYPE(sn)].arity;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(unsigned)
|
||||
JS_FRIEND_API unsigned
|
||||
js::SrcNoteLength(jssrcnote* sn)
|
||||
{
|
||||
unsigned arity;
|
||||
|
@ -9419,7 +9419,7 @@ js::SrcNoteLength(jssrcnote* sn)
|
|||
return sn - base;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(ptrdiff_t)
|
||||
JS_FRIEND_API ptrdiff_t
|
||||
js::GetSrcNoteOffset(jssrcnote* sn, unsigned which)
|
||||
{
|
||||
/* Find the offset numbered which (i.e., skip exactly which offsets). */
|
||||
|
|
|
@ -7,7 +7,7 @@ import sys
|
|||
|
||||
|
||||
def read_reserved_word_list(filename):
|
||||
macro_pat = re.compile(r"^\s*macro\(([^,]+), *[^,]+, *[^\)]+\)\s*\\?$")
|
||||
macro_pat = re.compile(r"^\s*MACRO\(([^,]+), *[^,]+, *[^\)]+\)\s*\\?$")
|
||||
|
||||
reserved_word_list = []
|
||||
index = 0
|
||||
|
|
|
@ -542,50 +542,50 @@ enum ParseNodeArity
|
|||
};
|
||||
|
||||
// FIXME: Remove `*Type` (bug 1489008)
|
||||
#define FOR_EACH_PARSENODE_SUBCLASS(macro) \
|
||||
macro(BinaryNode, BinaryNodeType, asBinary) \
|
||||
macro(AssignmentNode, AssignmentNodeType, asAssignment) \
|
||||
macro(CaseClause, CaseClauseType, asCaseClause) \
|
||||
macro(ClassMethod, ClassMethodType, asClassMethod) \
|
||||
macro(ClassField, ClassFieldType, asClassField) \
|
||||
macro(ClassNames, ClassNamesType, asClassNames) \
|
||||
macro(ForNode, ForNodeType, asFor) \
|
||||
macro(PropertyAccess, PropertyAccessType, asPropertyAccess) \
|
||||
macro(PropertyByValue, PropertyByValueType, asPropertyByValue) \
|
||||
macro(SwitchStatement, SwitchStatementType, asSwitchStatement) \
|
||||
#define FOR_EACH_PARSENODE_SUBCLASS(MACRO) \
|
||||
MACRO(BinaryNode, BinaryNodeType, asBinary) \
|
||||
MACRO(AssignmentNode, AssignmentNodeType, asAssignment) \
|
||||
MACRO(CaseClause, CaseClauseType, asCaseClause) \
|
||||
MACRO(ClassMethod, ClassMethodType, asClassMethod) \
|
||||
MACRO(ClassField, ClassFieldType, asClassField) \
|
||||
MACRO(ClassNames, ClassNamesType, asClassNames) \
|
||||
MACRO(ForNode, ForNodeType, asFor) \
|
||||
MACRO(PropertyAccess, PropertyAccessType, asPropertyAccess) \
|
||||
MACRO(PropertyByValue, PropertyByValueType, asPropertyByValue) \
|
||||
MACRO(SwitchStatement, SwitchStatementType, asSwitchStatement) \
|
||||
\
|
||||
macro(CodeNode, CodeNodeType, asCode) \
|
||||
MACRO(CodeNode, CodeNodeType, asCode) \
|
||||
\
|
||||
macro(LexicalScopeNode, LexicalScopeNodeType, asLexicalScope) \
|
||||
MACRO(LexicalScopeNode, LexicalScopeNodeType, asLexicalScope) \
|
||||
\
|
||||
macro(ListNode, ListNodeType, asList) \
|
||||
macro(CallSiteNode, CallSiteNodeType, asCallSite) \
|
||||
MACRO(ListNode, ListNodeType, asList) \
|
||||
MACRO(CallSiteNode, CallSiteNodeType, asCallSite) \
|
||||
\
|
||||
macro(LoopControlStatement, LoopControlStatementType, asLoopControlStatement) \
|
||||
macro(BreakStatement, BreakStatementType, asBreakStatement) \
|
||||
macro(ContinueStatement, ContinueStatementType, asContinueStatement) \
|
||||
MACRO(LoopControlStatement, LoopControlStatementType, asLoopControlStatement) \
|
||||
MACRO(BreakStatement, BreakStatementType, asBreakStatement) \
|
||||
MACRO(ContinueStatement, ContinueStatementType, asContinueStatement) \
|
||||
\
|
||||
macro(NameNode, NameNodeType, asName) \
|
||||
macro(LabeledStatement, LabeledStatementType, asLabeledStatement) \
|
||||
MACRO(NameNode, NameNodeType, asName) \
|
||||
MACRO(LabeledStatement, LabeledStatementType, asLabeledStatement) \
|
||||
\
|
||||
macro(NullaryNode, NullaryNodeType, asNullary) \
|
||||
macro(BooleanLiteral, BooleanLiteralType, asBooleanLiteral) \
|
||||
macro(DebuggerStatement, DebuggerStatementType, asDebuggerStatement) \
|
||||
macro(NullLiteral, NullLiteralType, asNullLiteral) \
|
||||
macro(RawUndefinedLiteral, RawUndefinedLiteralType, asRawUndefinedLiteral) \
|
||||
MACRO(NullaryNode, NullaryNodeType, asNullary) \
|
||||
MACRO(BooleanLiteral, BooleanLiteralType, asBooleanLiteral) \
|
||||
MACRO(DebuggerStatement, DebuggerStatementType, asDebuggerStatement) \
|
||||
MACRO(NullLiteral, NullLiteralType, asNullLiteral) \
|
||||
MACRO(RawUndefinedLiteral, RawUndefinedLiteralType, asRawUndefinedLiteral) \
|
||||
\
|
||||
macro(NumericLiteral, NumericLiteralType, asNumericLiteral) \
|
||||
IF_BIGINT(macro(BigIntLiteral, BigIntLiteralType, asBigIntLiteral),) \
|
||||
MACRO(NumericLiteral, NumericLiteralType, asNumericLiteral) \
|
||||
IF_BIGINT(MACRO(BigIntLiteral, BigIntLiteralType, asBigIntLiteral),) \
|
||||
\
|
||||
macro(RegExpLiteral, RegExpLiteralType, asRegExpLiteral) \
|
||||
MACRO(RegExpLiteral, RegExpLiteralType, asRegExpLiteral) \
|
||||
\
|
||||
macro(TernaryNode, TernaryNodeType, asTernary) \
|
||||
macro(ClassNode, ClassNodeType, asClass) \
|
||||
macro(ConditionalExpression, ConditionalExpressionType, asConditionalExpression) \
|
||||
macro(TryNode, TryNodeType, asTry) \
|
||||
MACRO(TernaryNode, TernaryNodeType, asTernary) \
|
||||
MACRO(ClassNode, ClassNodeType, asClass) \
|
||||
MACRO(ConditionalExpression, ConditionalExpressionType, asConditionalExpression) \
|
||||
MACRO(TryNode, TryNodeType, asTry) \
|
||||
\
|
||||
macro(UnaryNode, UnaryNodeType, asUnary) \
|
||||
macro(ThisLiteral, ThisLiteralType, asThisLiteral)
|
||||
MACRO(UnaryNode, UnaryNodeType, asUnary) \
|
||||
MACRO(ThisLiteral, ThisLiteralType, asThisLiteral)
|
||||
|
||||
#define DECLARE_CLASS(typeName, longTypeName, asMethodName) \
|
||||
class typeName;
|
||||
|
|
|
@ -9,73 +9,73 @@
|
|||
#ifndef vm_ReservedWords_h
|
||||
#define vm_ReservedWords_h
|
||||
|
||||
#define FOR_EACH_JAVASCRIPT_RESERVED_WORD(macro) \
|
||||
macro(false, false_, TokenKind::False) \
|
||||
macro(true, true_, TokenKind::True) \
|
||||
macro(null, null, TokenKind::Null) \
|
||||
#define FOR_EACH_JAVASCRIPT_RESERVED_WORD(MACRO) \
|
||||
MACRO(false, false_, TokenKind::False) \
|
||||
MACRO(true, true_, TokenKind::True) \
|
||||
MACRO(null, null, TokenKind::Null) \
|
||||
\
|
||||
/* Keywords. */ \
|
||||
macro(break, break_, TokenKind::Break) \
|
||||
macro(case, case_, TokenKind::Case) \
|
||||
macro(catch, catch_, TokenKind::Catch) \
|
||||
macro(const, const_, TokenKind::Const) \
|
||||
macro(continue, continue_, TokenKind::Continue) \
|
||||
macro(debugger, debugger, TokenKind::Debugger) \
|
||||
macro(default, default_, TokenKind::Default) \
|
||||
macro(delete, delete_, TokenKind::Delete) \
|
||||
macro(do, do_, TokenKind::Do) \
|
||||
macro(else, else_, TokenKind::Else) \
|
||||
macro(finally, finally_, TokenKind::Finally) \
|
||||
macro(for, for_, TokenKind::For) \
|
||||
macro(function, function, TokenKind::Function) \
|
||||
macro(if, if_, TokenKind::If) \
|
||||
macro(in, in, TokenKind::In) \
|
||||
macro(instanceof, instanceof, TokenKind::InstanceOf) \
|
||||
macro(new, new_, TokenKind::New) \
|
||||
macro(return, return_, TokenKind::Return) \
|
||||
macro(switch, switch_, TokenKind::Switch) \
|
||||
macro(this, this_, TokenKind::This) \
|
||||
macro(throw, throw_, TokenKind::Throw) \
|
||||
macro(try, try_, TokenKind::Try) \
|
||||
macro(typeof, typeof_, TokenKind::TypeOf) \
|
||||
macro(var, var, TokenKind::Var) \
|
||||
macro(void, void_, TokenKind::Void) \
|
||||
macro(while, while_, TokenKind::While) \
|
||||
macro(with, with, TokenKind::With) \
|
||||
macro(import, import, TokenKind::Import) \
|
||||
macro(export, export_, TokenKind::Export) \
|
||||
macro(class, class_, TokenKind::Class) \
|
||||
macro(extends, extends, TokenKind::Extends) \
|
||||
macro(super, super, TokenKind::Super) \
|
||||
MACRO(break, break_, TokenKind::Break) \
|
||||
MACRO(case, case_, TokenKind::Case) \
|
||||
MACRO(catch, catch_, TokenKind::Catch) \
|
||||
MACRO(const, const_, TokenKind::Const) \
|
||||
MACRO(continue, continue_, TokenKind::Continue) \
|
||||
MACRO(debugger, debugger, TokenKind::Debugger) \
|
||||
MACRO(default, default_, TokenKind::Default) \
|
||||
MACRO(delete, delete_, TokenKind::Delete) \
|
||||
MACRO(do, do_, TokenKind::Do) \
|
||||
MACRO(else, else_, TokenKind::Else) \
|
||||
MACRO(finally, finally_, TokenKind::Finally) \
|
||||
MACRO(for, for_, TokenKind::For) \
|
||||
MACRO(function, function, TokenKind::Function) \
|
||||
MACRO(if, if_, TokenKind::If) \
|
||||
MACRO(in, in, TokenKind::In) \
|
||||
MACRO(instanceof, instanceof, TokenKind::InstanceOf) \
|
||||
MACRO(new, new_, TokenKind::New) \
|
||||
MACRO(return, return_, TokenKind::Return) \
|
||||
MACRO(switch, switch_, TokenKind::Switch) \
|
||||
MACRO(this, this_, TokenKind::This) \
|
||||
MACRO(throw, throw_, TokenKind::Throw) \
|
||||
MACRO(try, try_, TokenKind::Try) \
|
||||
MACRO(typeof, typeof_, TokenKind::TypeOf) \
|
||||
MACRO(var, var, TokenKind::Var) \
|
||||
MACRO(void, void_, TokenKind::Void) \
|
||||
MACRO(while, while_, TokenKind::While) \
|
||||
MACRO(with, with, TokenKind::With) \
|
||||
MACRO(import, import, TokenKind::Import) \
|
||||
MACRO(export, export_, TokenKind::Export) \
|
||||
MACRO(class, class_, TokenKind::Class) \
|
||||
MACRO(extends, extends, TokenKind::Extends) \
|
||||
MACRO(super, super, TokenKind::Super) \
|
||||
\
|
||||
/* Future reserved words. */ \
|
||||
macro(enum, enum_, TokenKind::Enum) \
|
||||
MACRO(enum, enum_, TokenKind::Enum) \
|
||||
\
|
||||
/* Future reserved words, but only in strict mode. */ \
|
||||
macro(implements, implements, TokenKind::Implements) \
|
||||
macro(interface, interface, TokenKind::Interface) \
|
||||
macro(package, package, TokenKind::Package) \
|
||||
macro(private, private_, TokenKind::Private) \
|
||||
macro(protected, protected_, TokenKind::Protected) \
|
||||
macro(public, public_, TokenKind::Public) \
|
||||
MACRO(implements, implements, TokenKind::Implements) \
|
||||
MACRO(interface, interface, TokenKind::Interface) \
|
||||
MACRO(package, package, TokenKind::Package) \
|
||||
MACRO(private, private_, TokenKind::Private) \
|
||||
MACRO(protected, protected_, TokenKind::Protected) \
|
||||
MACRO(public, public_, TokenKind::Public) \
|
||||
\
|
||||
/* Contextual keywords. */ \
|
||||
macro(as, as, TokenKind::As) \
|
||||
macro(async, async, TokenKind::Async) \
|
||||
macro(await, await, TokenKind::Await) \
|
||||
macro(from, from, TokenKind::From) \
|
||||
macro(get, get, TokenKind::Get) \
|
||||
macro(let, let, TokenKind::Let) \
|
||||
macro(meta, meta, TokenKind::Meta) \
|
||||
macro(of, of, TokenKind::Of) \
|
||||
macro(set, set, TokenKind::Set) \
|
||||
macro(static, static_, TokenKind::Static) \
|
||||
macro(target, target, TokenKind::Target) \
|
||||
MACRO(as, as, TokenKind::As) \
|
||||
MACRO(async, async, TokenKind::Async) \
|
||||
MACRO(await, await, TokenKind::Await) \
|
||||
MACRO(from, from, TokenKind::From) \
|
||||
MACRO(get, get, TokenKind::Get) \
|
||||
MACRO(let, let, TokenKind::Let) \
|
||||
MACRO(meta, meta, TokenKind::Meta) \
|
||||
MACRO(of, of, TokenKind::Of) \
|
||||
MACRO(set, set, TokenKind::Set) \
|
||||
MACRO(static, static_, TokenKind::Static) \
|
||||
MACRO(target, target, TokenKind::Target) \
|
||||
/* \
|
||||
* Yield is a token inside function*. Outside of a function*, it is a \
|
||||
* future reserved word in strict mode, but a keyword in JS1.7 even \
|
||||
* when strict. Punt logic to parser. \
|
||||
*/ \
|
||||
macro(yield, yield, TokenKind::Yield)
|
||||
MACRO(yield, yield, TokenKind::Yield)
|
||||
|
||||
#endif /* vm_ReservedWords_h */
|
||||
|
|
|
@ -161,6 +161,7 @@ class SrcNote {
|
|||
};
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
#define FOR_EACH_SRC_NOTE_TYPE(M) \
|
||||
M(SRC_NULL, "null", 0) /* Terminates a note vector. */ \
|
||||
M(SRC_IF, "if", 0) /* JSOP_IFEQ bytecode is from an if-then. */ \
|
||||
|
@ -189,6 +190,7 @@ class SrcNote {
|
|||
M(SRC_UNUSED22, "unused22", 0) /* Unused. */ \
|
||||
M(SRC_UNUSED23, "unused23", 0) /* Unused. */ \
|
||||
M(SRC_XDELTA, "xdelta", 0) /* 24-31 are for extended delta notes. */
|
||||
// clang-format on
|
||||
|
||||
enum SrcNoteType {
|
||||
#define DEFINE_SRC_NOTE_TYPE(sym, name, arity) sym,
|
||||
|
@ -311,17 +313,17 @@ struct JSSrcNoteSpec {
|
|||
int8_t arity; /* number of offset operands */
|
||||
};
|
||||
|
||||
extern JS_FRIEND_DATA(const JSSrcNoteSpec) js_SrcNoteSpec[];
|
||||
extern JS_FRIEND_DATA const JSSrcNoteSpec js_SrcNoteSpec[];
|
||||
|
||||
namespace js {
|
||||
|
||||
extern JS_FRIEND_API(unsigned)
|
||||
extern JS_FRIEND_API unsigned
|
||||
SrcNoteLength(jssrcnote* sn);
|
||||
|
||||
/*
|
||||
* Get and set the offset operand identified by which (0 for the first, etc.).
|
||||
*/
|
||||
extern JS_FRIEND_API(ptrdiff_t)
|
||||
extern JS_FRIEND_API ptrdiff_t
|
||||
GetSrcNoteOffset(jssrcnote* sn, unsigned which);
|
||||
|
||||
} // namespace js
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
*
|
||||
* The format for each line is:
|
||||
*
|
||||
* macro(<TOKEN_KIND_NAME>, <DESCRIPTION>)
|
||||
* MACRO(<TOKEN_KIND_NAME>, <DESCRIPTION>)
|
||||
*
|
||||
* or
|
||||
*
|
||||
* range(<TOKEN_RANGE_NAME>, <TOKEN_KIND_NAME>)
|
||||
* RANGE(<TOKEN_RANGE_NAME>, <TOKEN_KIND_NAME>)
|
||||
*
|
||||
* where ;
|
||||
* <TOKEN_KIND_NAME> is a legal C identifier of the token, that will be used in
|
||||
|
@ -32,10 +32,10 @@
|
|||
* TokenKind by range-testing:
|
||||
* BinOpFirst <= tt && tt <= BinOpLast
|
||||
*
|
||||
* Second argument of `range` is the actual value of the <TOKEN_RANGE_NAME>,
|
||||
* should be same as one of <TOKEN_KIND_NAME> in other `macro`s.
|
||||
* Second argument of `RANGE` is the actual value of the <TOKEN_RANGE_NAME>,
|
||||
* should be same as one of <TOKEN_KIND_NAME> in other `MACRO`s.
|
||||
*
|
||||
* To use this macro, define two macros for `macro` and `range`, and pass them
|
||||
* To use this macro, define two macros for `MACRO` and `RANGE`, and pass them
|
||||
* as arguments.
|
||||
*
|
||||
* #define EMIT_TOKEN(name, desc) ...
|
||||
|
@ -52,105 +52,105 @@
|
|||
*
|
||||
* Note that this list does not contain ERROR and LIMIT.
|
||||
*/
|
||||
#define FOR_EACH_TOKEN_KIND_WITH_RANGE(macro, range) \
|
||||
macro(Eof, "end of script") \
|
||||
#define FOR_EACH_TOKEN_KIND_WITH_RANGE(MACRO, RANGE) \
|
||||
MACRO(Eof, "end of script") \
|
||||
\
|
||||
/* only returned by peekTokenSameLine() */ \
|
||||
macro(Eol, "line terminator") \
|
||||
MACRO(Eol, "line terminator") \
|
||||
\
|
||||
macro(Semi, "';'") \
|
||||
macro(Comma, "','") \
|
||||
macro(Hook, "'?'") /* conditional */ \
|
||||
macro(Colon, "':'") /* conditional */ \
|
||||
macro(Inc, "'++'") /* increment */ \
|
||||
macro(Dec, "'--'") /* decrement */ \
|
||||
macro(Dot, "'.'") /* member operator */ \
|
||||
macro(TripleDot, "'...'") /* rest arguments and spread operator */ \
|
||||
macro(LeftBracket, "'['") \
|
||||
macro(RightBracket, "']'") \
|
||||
macro(LeftCurly, "'{'") \
|
||||
macro(RightCurly, "'}'") \
|
||||
macro(LeftParen, "'('") \
|
||||
macro(RightParen, "')'") \
|
||||
macro(Name, "identifier") \
|
||||
macro(PrivateName, "private identifier") \
|
||||
macro(Number, "numeric literal") \
|
||||
macro(String, "string literal") \
|
||||
IF_BIGINT(macro(BigInt, "bigint literal"),) \
|
||||
MACRO(Semi, "';'") \
|
||||
MACRO(Comma, "','") \
|
||||
MACRO(Hook, "'?'") /* conditional */ \
|
||||
MACRO(Colon, "':'") /* conditional */ \
|
||||
MACRO(Inc, "'++'") /* increment */ \
|
||||
MACRO(Dec, "'--'") /* decrement */ \
|
||||
MACRO(Dot, "'.'") /* member operator */ \
|
||||
MACRO(TripleDot, "'...'") /* rest arguments and spread operator */ \
|
||||
MACRO(LeftBracket, "'['") \
|
||||
MACRO(RightBracket, "']'") \
|
||||
MACRO(LeftCurly, "'{'") \
|
||||
MACRO(RightCurly, "'}'") \
|
||||
MACRO(LeftParen, "'('") \
|
||||
MACRO(RightParen, "')'") \
|
||||
MACRO(Name, "identifier") \
|
||||
MACRO(PrivateName, "private identifier") \
|
||||
MACRO(Number, "numeric literal") \
|
||||
MACRO(String, "string literal") \
|
||||
IF_BIGINT(MACRO(BigInt, "bigint literal"),) \
|
||||
\
|
||||
/* start of template literal with substitutions */ \
|
||||
macro(TemplateHead, "'${'") \
|
||||
MACRO(TemplateHead, "'${'") \
|
||||
/* template literal without substitutions */ \
|
||||
macro(NoSubsTemplate, "template literal") \
|
||||
MACRO(NoSubsTemplate, "template literal") \
|
||||
\
|
||||
macro(RegExp, "regular expression literal") \
|
||||
macro(True, "boolean literal 'true'") \
|
||||
range(ReservedWordLiteralFirst, True) \
|
||||
macro(False, "boolean literal 'false'") \
|
||||
macro(Null, "null literal") \
|
||||
range(ReservedWordLiteralLast, Null) \
|
||||
macro(This, "keyword 'this'") \
|
||||
range(KeywordFirst, This) \
|
||||
macro(Function, "keyword 'function'") \
|
||||
macro(If, "keyword 'if'") \
|
||||
macro(Else, "keyword 'else'") \
|
||||
macro(Switch, "keyword 'switch'") \
|
||||
macro(Case, "keyword 'case'") \
|
||||
macro(Default, "keyword 'default'") \
|
||||
macro(While, "keyword 'while'") \
|
||||
macro(Do, "keyword 'do'") \
|
||||
macro(For, "keyword 'for'") \
|
||||
macro(Break, "keyword 'break'") \
|
||||
macro(Continue, "keyword 'continue'") \
|
||||
macro(Var, "keyword 'var'") \
|
||||
macro(Const, "keyword 'const'") \
|
||||
macro(With, "keyword 'with'") \
|
||||
macro(Return, "keyword 'return'") \
|
||||
macro(New, "keyword 'new'") \
|
||||
macro(Delete, "keyword 'delete'") \
|
||||
macro(Try, "keyword 'try'") \
|
||||
macro(Catch, "keyword 'catch'") \
|
||||
macro(Finally, "keyword 'finally'") \
|
||||
macro(Throw, "keyword 'throw'") \
|
||||
macro(Debugger, "keyword 'debugger'") \
|
||||
macro(Export, "keyword 'export'") \
|
||||
macro(Import, "keyword 'import'") \
|
||||
macro(Class, "keyword 'class'") \
|
||||
macro(Extends, "keyword 'extends'") \
|
||||
macro(Super, "keyword 'super'") \
|
||||
range(KeywordLast, Super) \
|
||||
MACRO(RegExp, "regular expression literal") \
|
||||
MACRO(True, "boolean literal 'true'") \
|
||||
RANGE(ReservedWordLiteralFirst, True) \
|
||||
MACRO(False, "boolean literal 'false'") \
|
||||
MACRO(Null, "null literal") \
|
||||
RANGE(ReservedWordLiteralLast, Null) \
|
||||
MACRO(This, "keyword 'this'") \
|
||||
RANGE(KeywordFirst, This) \
|
||||
MACRO(Function, "keyword 'function'") \
|
||||
MACRO(If, "keyword 'if'") \
|
||||
MACRO(Else, "keyword 'else'") \
|
||||
MACRO(Switch, "keyword 'switch'") \
|
||||
MACRO(Case, "keyword 'case'") \
|
||||
MACRO(Default, "keyword 'default'") \
|
||||
MACRO(While, "keyword 'while'") \
|
||||
MACRO(Do, "keyword 'do'") \
|
||||
MACRO(For, "keyword 'for'") \
|
||||
MACRO(Break, "keyword 'break'") \
|
||||
MACRO(Continue, "keyword 'continue'") \
|
||||
MACRO(Var, "keyword 'var'") \
|
||||
MACRO(Const, "keyword 'const'") \
|
||||
MACRO(With, "keyword 'with'") \
|
||||
MACRO(Return, "keyword 'return'") \
|
||||
MACRO(New, "keyword 'new'") \
|
||||
MACRO(Delete, "keyword 'delete'") \
|
||||
MACRO(Try, "keyword 'try'") \
|
||||
MACRO(Catch, "keyword 'catch'") \
|
||||
MACRO(Finally, "keyword 'finally'") \
|
||||
MACRO(Throw, "keyword 'throw'") \
|
||||
MACRO(Debugger, "keyword 'debugger'") \
|
||||
MACRO(Export, "keyword 'export'") \
|
||||
MACRO(Import, "keyword 'import'") \
|
||||
MACRO(Class, "keyword 'class'") \
|
||||
MACRO(Extends, "keyword 'extends'") \
|
||||
MACRO(Super, "keyword 'super'") \
|
||||
RANGE(KeywordLast, Super) \
|
||||
\
|
||||
/* contextual keywords */ \
|
||||
macro(As, "'as'") \
|
||||
range(ContextualKeywordFirst, As) \
|
||||
macro(Async, "'async'") \
|
||||
macro(Await, "'await'") \
|
||||
macro(Each, "'each'") \
|
||||
macro(From, "'from'") \
|
||||
macro(Get, "'get'") \
|
||||
macro(Let, "'let'") \
|
||||
macro(Meta, "'meta'") \
|
||||
macro(Of, "'of'") \
|
||||
macro(Set, "'set'") \
|
||||
macro(Static, "'static'") \
|
||||
macro(Target, "'target'") \
|
||||
macro(Yield, "'yield'") \
|
||||
range(ContextualKeywordLast, Yield) \
|
||||
MACRO(As, "'as'") \
|
||||
RANGE(ContextualKeywordFirst, As) \
|
||||
MACRO(Async, "'async'") \
|
||||
MACRO(Await, "'await'") \
|
||||
MACRO(Each, "'each'") \
|
||||
MACRO(From, "'from'") \
|
||||
MACRO(Get, "'get'") \
|
||||
MACRO(Let, "'let'") \
|
||||
MACRO(Meta, "'meta'") \
|
||||
MACRO(Of, "'of'") \
|
||||
MACRO(Set, "'set'") \
|
||||
MACRO(Static, "'static'") \
|
||||
MACRO(Target, "'target'") \
|
||||
MACRO(Yield, "'yield'") \
|
||||
RANGE(ContextualKeywordLast, Yield) \
|
||||
\
|
||||
/* future reserved words */ \
|
||||
macro(Enum, "reserved word 'enum'") \
|
||||
range(FutureReservedKeywordFirst, Enum) \
|
||||
range(FutureReservedKeywordLast, Enum) \
|
||||
MACRO(Enum, "reserved word 'enum'") \
|
||||
RANGE(FutureReservedKeywordFirst, Enum) \
|
||||
RANGE(FutureReservedKeywordLast, Enum) \
|
||||
\
|
||||
/* reserved words in strict mode */ \
|
||||
macro(Implements, "reserved word 'implements'") \
|
||||
range(StrictReservedKeywordFirst, Implements) \
|
||||
macro(Interface, "reserved word 'interface'") \
|
||||
macro(Package, "reserved word 'package'") \
|
||||
macro(Private, "reserved word 'private'") \
|
||||
macro(Protected, "reserved word 'protected'") \
|
||||
macro(Public, "reserved word 'public'") \
|
||||
range(StrictReservedKeywordLast, Public) \
|
||||
MACRO(Implements, "reserved word 'implements'") \
|
||||
RANGE(StrictReservedKeywordFirst, Implements) \
|
||||
MACRO(Interface, "reserved word 'interface'") \
|
||||
MACRO(Package, "reserved word 'package'") \
|
||||
MACRO(Private, "reserved word 'private'") \
|
||||
MACRO(Protected, "reserved word 'protected'") \
|
||||
MACRO(Public, "reserved word 'public'") \
|
||||
RANGE(StrictReservedKeywordLast, Public) \
|
||||
\
|
||||
/* \
|
||||
* The following token types occupy contiguous ranges to enable easy \
|
||||
|
@ -160,80 +160,80 @@
|
|||
* Binary operators tokens, Or thru Pow. These must be in the same \
|
||||
* order as F(Or) and friends in FOR_EACH_PARSE_NODE_KIND in ParseNode.h. \
|
||||
*/ \
|
||||
macro(Pipeline, "'|>'") \
|
||||
range(BinOpFirst, Pipeline) \
|
||||
macro(Or, "'||'") /* logical or */ \
|
||||
macro(And, "'&&'") /* logical and */ \
|
||||
macro(BitOr, "'|'") /* bitwise-or */ \
|
||||
macro(BitXor, "'^'") /* bitwise-xor */ \
|
||||
macro(BitAnd, "'&'") /* bitwise-and */ \
|
||||
MACRO(Pipeline, "'|>'") \
|
||||
RANGE(BinOpFirst, Pipeline) \
|
||||
MACRO(Or, "'||'") /* logical or */ \
|
||||
MACRO(And, "'&&'") /* logical and */ \
|
||||
MACRO(BitOr, "'|'") /* bitwise-or */ \
|
||||
MACRO(BitXor, "'^'") /* bitwise-xor */ \
|
||||
MACRO(BitAnd, "'&'") /* bitwise-and */ \
|
||||
\
|
||||
/* Equality operation tokens, per TokenKindIsEquality. */ \
|
||||
macro(StrictEq, "'==='") \
|
||||
range(EqualityStart, StrictEq) \
|
||||
macro(Eq, "'=='") \
|
||||
macro(StrictNe, "'!=='") \
|
||||
macro(Ne, "'!='") \
|
||||
range(EqualityLast, Ne) \
|
||||
MACRO(StrictEq, "'==='") \
|
||||
RANGE(EqualityStart, StrictEq) \
|
||||
MACRO(Eq, "'=='") \
|
||||
MACRO(StrictNe, "'!=='") \
|
||||
MACRO(Ne, "'!='") \
|
||||
RANGE(EqualityLast, Ne) \
|
||||
\
|
||||
/* Relational ops, per TokenKindIsRelational. */ \
|
||||
macro(Lt, "'<'") \
|
||||
range(RelOpStart, Lt) \
|
||||
macro(Le, "'<='") \
|
||||
macro(Gt, "'>'") \
|
||||
macro(Ge, "'>='") \
|
||||
range(RelOpLast, Ge) \
|
||||
MACRO(Lt, "'<'") \
|
||||
RANGE(RelOpStart, Lt) \
|
||||
MACRO(Le, "'<='") \
|
||||
MACRO(Gt, "'>'") \
|
||||
MACRO(Ge, "'>='") \
|
||||
RANGE(RelOpLast, Ge) \
|
||||
\
|
||||
macro(InstanceOf, "keyword 'instanceof'") \
|
||||
range(KeywordBinOpFirst, InstanceOf) \
|
||||
macro(In, "keyword 'in'") \
|
||||
range(KeywordBinOpLast, In) \
|
||||
MACRO(InstanceOf, "keyword 'instanceof'") \
|
||||
RANGE(KeywordBinOpFirst, InstanceOf) \
|
||||
MACRO(In, "keyword 'in'") \
|
||||
RANGE(KeywordBinOpLast, In) \
|
||||
\
|
||||
/* Shift ops, per TokenKindIsShift. */ \
|
||||
macro(Lsh, "'<<'") \
|
||||
range(ShiftOpStart, Lsh) \
|
||||
macro(Rsh, "'>>'") \
|
||||
macro(Ursh, "'>>>'") \
|
||||
range(ShiftOpLast, Ursh) \
|
||||
MACRO(Lsh, "'<<'") \
|
||||
RANGE(ShiftOpStart, Lsh) \
|
||||
MACRO(Rsh, "'>>'") \
|
||||
MACRO(Ursh, "'>>>'") \
|
||||
RANGE(ShiftOpLast, Ursh) \
|
||||
\
|
||||
macro(Add, "'+'") \
|
||||
macro(Sub, "'-'") \
|
||||
macro(Mul, "'*'") \
|
||||
macro(Div, "'/'") \
|
||||
macro(Mod, "'%'") \
|
||||
macro(Pow, "'**'") \
|
||||
range(BinOpLast, Pow) \
|
||||
MACRO(Add, "'+'") \
|
||||
MACRO(Sub, "'-'") \
|
||||
MACRO(Mul, "'*'") \
|
||||
MACRO(Div, "'/'") \
|
||||
MACRO(Mod, "'%'") \
|
||||
MACRO(Pow, "'**'") \
|
||||
RANGE(BinOpLast, Pow) \
|
||||
\
|
||||
/* Unary operation tokens. */ \
|
||||
macro(TypeOf, "keyword 'typeof'") \
|
||||
range(KeywordUnOpFirst, TypeOf) \
|
||||
macro(Void, "keyword 'void'") \
|
||||
range(KeywordUnOpLast, Void) \
|
||||
macro(Not, "'!'") \
|
||||
macro(BitNot, "'~'") \
|
||||
MACRO(TypeOf, "keyword 'typeof'") \
|
||||
RANGE(KeywordUnOpFirst, TypeOf) \
|
||||
MACRO(Void, "keyword 'void'") \
|
||||
RANGE(KeywordUnOpLast, Void) \
|
||||
MACRO(Not, "'!'") \
|
||||
MACRO(BitNot, "'~'") \
|
||||
\
|
||||
macro(Arrow, "'=>'") /* function arrow */ \
|
||||
MACRO(Arrow, "'=>'") /* function arrow */ \
|
||||
\
|
||||
/* Assignment ops, per TokenKindIsAssignment */ \
|
||||
macro(Assign, "'='") \
|
||||
range(AssignmentStart, Assign) \
|
||||
macro(AddAssign, "'+='") \
|
||||
macro(SubAssign, "'-='") \
|
||||
macro(BitOrAssign, "'|='") \
|
||||
macro(BitXorAssign, "'^='") \
|
||||
macro(BitAndAssign, "'&='") \
|
||||
macro(LshAssign, "'<<='") \
|
||||
macro(RshAssign, "'>>='") \
|
||||
macro(UrshAssign, "'>>>='") \
|
||||
macro(MulAssign, "'*='") \
|
||||
macro(DivAssign, "'/='") \
|
||||
macro(ModAssign, "'%='") \
|
||||
macro(PowAssign, "'**='") \
|
||||
range(AssignmentLast, PowAssign)
|
||||
MACRO(Assign, "'='") \
|
||||
RANGE(AssignmentStart, Assign) \
|
||||
MACRO(AddAssign, "'+='") \
|
||||
MACRO(SubAssign, "'-='") \
|
||||
MACRO(BitOrAssign, "'|='") \
|
||||
MACRO(BitXorAssign, "'^='") \
|
||||
MACRO(BitAndAssign, "'&='") \
|
||||
MACRO(LshAssign, "'<<='") \
|
||||
MACRO(RshAssign, "'>>='") \
|
||||
MACRO(UrshAssign, "'>>>='") \
|
||||
MACRO(MulAssign, "'*='") \
|
||||
MACRO(DivAssign, "'/='") \
|
||||
MACRO(ModAssign, "'%='") \
|
||||
MACRO(PowAssign, "'**='") \
|
||||
RANGE(AssignmentLast, PowAssign)
|
||||
|
||||
#define TOKEN_KIND_RANGE_EMIT_NONE(name, value)
|
||||
#define FOR_EACH_TOKEN_KIND(macro) \
|
||||
FOR_EACH_TOKEN_KIND_WITH_RANGE(macro, TOKEN_KIND_RANGE_EMIT_NONE)
|
||||
#define FOR_EACH_TOKEN_KIND(MACRO) \
|
||||
FOR_EACH_TOKEN_KIND_WITH_RANGE(MACRO, TOKEN_KIND_RANGE_EMIT_NONE)
|
||||
|
||||
namespace js {
|
||||
namespace frontend {
|
||||
|
|
|
@ -3515,7 +3515,7 @@ TokenStreamSpecific<char16_t, ParserAnyCharsAccess<GeneralParser<SyntaxParseHand
|
|||
} // namespace js
|
||||
|
||||
|
||||
JS_FRIEND_API(int)
|
||||
JS_FRIEND_API int
|
||||
js_fgets(char* buf, int size, FILE* file)
|
||||
{
|
||||
int n, i, c;
|
||||
|
|
|
@ -2788,7 +2788,7 @@ TokenKindToDesc(TokenKind tt);
|
|||
} // namespace frontend
|
||||
} // namespace js
|
||||
|
||||
extern JS_FRIEND_API(int)
|
||||
extern JS_FRIEND_API int
|
||||
js_fgets(char* buf, int size, FILE* file);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
name = "binast"
|
||||
version = "0.1.1"
|
||||
authors = ["David Teller <D.O.Teller@gmail.com>"]
|
||||
autobins = false
|
||||
|
||||
[dependencies]
|
||||
binjs_meta = "^0.4.3"
|
||||
|
@ -11,3 +12,7 @@ itertools = "^0.7.6"
|
|||
log = "0.4"
|
||||
yaml-rust = "^0.4"
|
||||
webidl = "^0.8"
|
||||
|
||||
[[bin]]
|
||||
name = "binsource"
|
||||
path = "src/main.rs"
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
HOST_RUST_PROGRAMS += ['binsource']
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче