diff --git a/.github/workflows/build-android.yaml b/.github/workflows/build-android.yaml deleted file mode 100644 index 9d2ad65c..00000000 --- a/.github/workflows/build-android.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: Build Android Project -on: - push: - branches: [ unstable ] - pull_request: - branches: [ unstable ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Clone repo - uses: actions/checkout@v2 - - name: Installing JDK 8 - uses: actions/setup-java@v2 - with: - distribution: 'zulu' - java-version: '8' - - name: Installing Cordova! - run: | - sudo npm i cordova@10.0.0 -g - - name: Installing the npm dependencies! - run: | - cd testapp - npm i - - name: Copying nodejs-mobile-cordova plugin - run: | - cd testapp - npm run copy-module - - name: Preparing the Android project! - run: | - cd testapp - cordova prepare android - - name: Building the Android project! - run: | - cd testapp - cordova build android diff --git a/.github/workflows/build-ios.yaml b/.github/workflows/build-ios.yaml deleted file mode 100644 index 8d91f3f6..00000000 --- a/.github/workflows/build-ios.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build IOS Project -on: - push: - branches: [ unstable ] - pull_request: - branches: [ unstable ] - -jobs: - build: - runs-on: macOS-latest - steps: - - name: Clone repo - uses: actions/checkout@v2 - - name: Installing Cordova! - run: | - sudo npm i cordova@10.0.0 -g - - name: Installing the npm dependencies! - run: | - cd testapp - npm i - - name: Copying nodejs-mobile-cordova plugin - run: | - cd testapp - npm run copy-module - - name: Preparing the IOS project! - run: | - cd testapp - cordova prepare ios - - name: Building the ISO project! - run: | - cd testapp - cordova build ios diff --git a/.gitignore b/.gitignore index 49260768..8fcb5408 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode/ -node_modules/ \ No newline at end of file +node_modules/ +package-lock.json diff --git a/.node-version b/.node-version new file mode 100644 index 00000000..72e4a483 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +18.14.2 diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..a79584db --- /dev/null +++ b/.npmignore @@ -0,0 +1,15 @@ +# Testing, code coverage, and linting +.eslintignore +.eslintrc.yml +.jshinrc + +# Git +.git +.gitattributes +.gitignore + +# Github +.github + +# test +tests/ diff --git a/README.md b/README.md index feb1eec1..7171cb1a 100644 --- a/README.md +++ b/README.md @@ -3,24 +3,23 @@ ## Installation ```bash -$ cordova plugin add nodejs-mobile-cordova +% cordova plugin add nodejs-mobile-cordova ``` ## Requirements - - Cordova 9.x or higher - - iOS 11 or higher - - Android API 22 or higher +- Cordova 12.x or higher +- Android API 24 or higher When building an application for the Android platform, make sure you have the [Android NDK](https://developer.android.com/ndk/index.html) installed and the environment variable `ANDROID_NDK_HOME` set, for example: + ```bash -$ export ANDROID_NDK_HOME=/Users/username/Library/Android/sdk/ndk-bundle +% export ANDROID_NDK_HOME=/Users/username/Library/Android/sdk/ndk-bundle ``` ## Supported Platforms -- Android (ARMv7a, x86) -- iOS (ARM64) +- Android (ARMv7a, ARM64) ## Reporting Issues @@ -30,6 +29,7 @@ So please, open the issue [there](https://github.com/janeasystems/nodejs-mobile/ ## Methods available in the Cordova layer These methods can be called from the Cordova javascript code directly: + - `nodejs.start` - `nodejs.startWithScript` - `nodejs.channel.on` @@ -43,9 +43,9 @@ These methods can be called from the Cordova javascript code directly: | Param | Type | | --- | --- | -| scriptFileName | string | -| callback | function | -| options | [StartupOptions](#cordova.StartupOptions) | +| scriptFileName | `string` | +| callback | `function` | +| options | `[StartupOptions](#cordova.StartupOptions)` | Starts the nodejs-mobile runtime thread with a file inside the `nodejs-project` directory. @@ -53,9 +53,9 @@ Starts the nodejs-mobile runtime thread with a file inside the `nodejs-project` | Param | Type | | --- | --- | -| scriptBody | string | -| callback | function | -| options | [StartupOptions](#cordova.StartupOptions) | +| scriptBody | `string` | +| callback | `function` | +| options | `[StartupOptions](#cordova.StartupOptions)` | Starts the nodejs-mobile runtime thread with a script body. @@ -63,8 +63,8 @@ Starts the nodejs-mobile runtime thread with a script body. | Param | Type | | --- | --- | -| event | string | -| callback | [function](#cordova.channelCallback) | +| event | `string` | +| callback | `[function](#cordova.channelCallback)` | Registers a callback for user-defined events raised from the nodejs-mobile side. @@ -72,7 +72,7 @@ Registers a callback for user-defined events raised from the nodejs-mobile side. | Param | Type | | --- | --- | -| event | string | +| event | `string` | | message | any JS type that can be serialized with `JSON.stringify` and deserialized with `JSON.parse` | Raises a user-defined event on the nodejs-mobile side. @@ -81,7 +81,7 @@ Raises a user-defined event on the nodejs-mobile side. | Param | Type | | --- | --- | -| listenerCallback | [function](#cordova.channelCallback) | +| listenerCallback | `[function](#cordova.channelCallback)` | Registers a callback for 'message' events raised from the nodejs-mobile side. It is an alias for `nodejs.channel.on('message', listenerCallback);`. @@ -95,11 +95,11 @@ It is an alias for `nodejs.channel.on('message', listenerCallback);`. Raises a 'message' event on the nodejs-mobile side. It is an alias for `nodejs.channel.post('message', message);`. - -### StartupOptions: object +### StartupOptions: `object` + | Name | Type | Default | Description | | --- | --- | --- | --- | -| redirectOutputToLogcat | boolean | true | Allows to disable the redirection of the Node stdout/stderr to the Android logcat | +| redirectOutputToLogcat | `boolean` | `true` | Allows to disable the redirection of the Node stdout/stderr to the Android logcat | Note: the stdout/stderr redirection is applied to the whole application, the side effect is that some undesired/duplicated output may appear in the logcat. For example, the Chromium console output `I/chromium: [INFO:CONSOLE(xx)]` is also sent to stderr and will show up in logcat has well, with the `NODEJS-MOBILE` log tag. @@ -107,6 +107,7 @@ For example, the Chromium console output `I/chromium: [INFO:CONSOLE(xx)]` is als ## Methods available in the Node layer The following methods can be called from the Node javascript code through the `cordova-bridge` module: + ```js var cordova = require('cordova-bridge'); ``` @@ -123,12 +124,13 @@ The following methods can be called from the Node javascript code through the `c | Param | Type | | --- | --- | -| event | string | -| callback | [function](#cordova.channelCallback) | +| event | `string` | +| callback | `[function](#cordova.channelCallback)` | Registers a callback for user-defined events raised from the cordova side. -> To receive messages from `nodejs.channel.send`, use: +> To receive messages from `nodejs.channel.send`, use +> > ```js > cordova.channel.on('message', listenerCallback); > ``` @@ -137,7 +139,7 @@ Registers a callback for user-defined events raised from the cordova side. | Param | Type | | --- | --- | -| event | string | +| event | `string` | | message | any JS type that can be serialized with `JSON.stringify` and deserialized with `JSON.parse` | Raises a user-defined event on the cordova side. @@ -155,8 +157,8 @@ It is an alias for `cordova.channel.post('message', message);`. | Param | Type | | --- | --- | -| event | string | -| callback | function | +| event | `string` | +| callback | `function` | Registers callbacks for App events. Currently supports the 'pause' and 'resume' events, which are raised automatically when the app switches to the background/foreground. @@ -188,8 +190,8 @@ cordova.app.on('pause', (pauseLock) => { Returns a writable path used for persistent data storage in the application. Its value corresponds to `NSDocumentDirectory` on iOS and `FilesDir` on Android. - -### Channel callback: function(arg) +### Channel callback: `function(arg)` + | Name | Type | | --- | --- | | arg | any JS type that can be serialized with `JSON.stringify` and deserialized with `JSON.parse` | @@ -208,39 +210,53 @@ The Android OS doesn't define a temporary directory for the system or applicatio This shows how to build an iOS app that exchanges text messages between the Cordova layer and the Node.js layer. In macOS, using `Terminal`: + ```bash -$ cordova create HelloCordova -$ cd HelloCordova -$ cordova platform add ios -$ cordova plugin add nodejs-mobile-cordova -$ cordova plugin add cordova-plugin-console +% cordova create HelloCordova +% cd HelloCordova +% cordova platform add ios +% cordova plugin add nodejs-mobile-cordova +% cordova plugin add cordova-plugin-console ``` + You can either manually create the `./www/nodejs-project/` folder, the `./www/nodejs-project/main.js` file and edit `./www/js/index.js` or use the provided helper script to do it automatically. The helper script copies a more extended sample compared to the one provided with the manual steps. --- -#### Set up project files using the helper script + +### Set up project files using the helper script + If you choose to use the helper script, you will be asked to overwrite the existing `./www/js/index.js` file: + ```bash -$ ./plugins/nodejs-mobile-cordova/install/sample-project/copy-sample-project.sh -$ overwrite www/js/index.js? (y/n [n]) y +./plugins/@red-mobile/nodejs-mobile-cordova/install/sample-project/copy-sample-project.sh +overwrite www/js/index.js? (y/n [n]) y ``` + The script creates the `./www/nodejs-project/` folder and adds two files: - - `./www/nodejs-project/main.js` - - `./www/nodejs-project/package.json` + +- `./www/nodejs-project/main.js` +- `./www/nodejs-project/package.json` The changes in `./www/js/index.js` are needed to invoke Node.js for Mobile Apps from Cordova. --- -#### Set up project files using the manual steps + +### Set up project files using the manual steps + If you want to set up the project manually, first create the project folder for the Node.js files: + ```bash -$ mkdir www/nodejs-project +% mkdir www/nodejs-project ``` + Then, with your editor of choice (we use VS Code in this example) create the `main.js` script file: + ```bash -$ code www/nodejs-project/main.js +% code www/nodejs-project/main.js ``` + Add the following code to `main.js` and save the file: + ```js const cordova = require('cordova-bridge'); @@ -249,11 +265,15 @@ cordova.channel.on('message', function (msg) { cordova.channel.send('Replying to this message: ' + msg); }); ``` + Edit the cordova script file `www/js/index.js`: + +```bash +% code `./www/js/index.js` ``` -$ code `./www/js/index.js` -``` + Append the following code at the end of the file: + ```js function channelListener(msg) { console.log('[cordova] received:' + msg); @@ -278,36 +298,45 @@ function startNodeProject() { ``` Search for the `onDeviceReady` event and in the event handler add a call to `startNodeProject()`: + ```js onDeviceReady: function() { this.receivedEvent('deviceready'); startNodeProject(); }, ``` + Save the changes to the `www/js/index.js` file to complete the manual steps of setting up the project files. --- After the project files have been created, either manually or using the helper script, open the Cordova app project in Xcode: + ```bash -$ open platforms/ios/HelloCordova.xcodeproj +% open platforms/ios/HelloCordova.xcodeproj ``` + Switch to Xcode: - * select HelloCordova to view the project settings - * in the `General` settings: - * in the `Signing` section select a team to sign the app - * in `Deployment Info` section select `Deployment Target` `11.0` or higher + +- select HelloCordova to view the project settings +- in the `General` settings: + - in the `Signing` section select a team to sign the app + - in `Deployment Info` section select `Deployment Target` `11.0` or higher Go back to `Terminal` to build the Cordova app + ```bash -$ cordova build ios --device +% cordova build ios --device ``` + Switch to Xcode: - * select a target device for the project - * run the project - * enlarge the `Console` area and scroll to the bottom - If you created the project following the manual steps, the output will look like this: +- select a target device for the project +- run the project +- enlarge the `Console` area and scroll to the bottom + +If you created the project following the manual steps, the output will look like this: + ```bash 2017-10-02 18:49:18.606100+0200 HelloCordova[2182:1463518] Node.js Mobile Engine Started [node] received: Hello from Cordova! @@ -315,7 +344,8 @@ Switch to Xcode: ``` If you used the helper script, the output will look like this: -``` + +```bash 2018-02-26 09:18:21.178612+0100 HelloCordova[1089:957630] Node.js Mobile Engine started 2018-02-26 09:18:21.385605+0100 HelloCordova[1089:957630] [cordova] MESSAGE from Node: "main.js loaded" 2018-02-26 09:18:21.385760+0100 HelloCordova[1089:957630] [cordova] "STARTED" event received from Node @@ -326,16 +356,18 @@ If you used the helper script, the output will look like this: ``` ## Node Modules + Node modules can be added to the project using `npm`. The Node modules have to be installed in the `./www/nodejs-project/` folder and a `package.json` file needs to be added to the folder. If you used the helper script to install the sample project, the `package.json` file is already present and you can proceed adding the desired Node modules. -If you don't know how to create the `package.json` file, just copy the sample one from `./plugins/nodejs-mobile-cordova/install/sample-project/www/nodejs-project/package.json`. +If you don't know how to create the `package.json` file, just copy the sample one from `./plugins/@red-mobile/nodejs-mobile-cordova/install/sample-project/www/nodejs-project/package.json`. Then proceed with the installation of the Node modules you want to add to your Node.js project: -``` -$ cd www/nodejs-project/ -$ npm install module-name + +```bash +% cd www/nodejs-project/ +% npm install module-name ``` Rebuild your Cordova project so that the newly added Node modules are added to the Cordova application. @@ -353,10 +385,12 @@ The plugin automatically detects native modules in `./www/nodejs-project/` by se Building native modules for Android can take a long time, since it depends on building a standalone NDK toolchain for each required architecture. The resulting `.node` binaries are then included in the final application in a separate asset path for each architecture and the correct one will be chosen at runtime. While the plugin tries to detect automatically the presence of native modules, there's a way to override this detection and turn the native modules build process on or off, by creating the `www/NODEJS_MOBILE_BUILD_NATIVE_MODULES_VALUE.txt` file and setting its contents to `1` or `0` respectively. E.g., from the root path of your project: + ```sh echo "1" > www/NODEJS_MOBILE_BUILD_NATIVE_MODULES_VALUE.txt cordova run android ``` + ```sh echo "1" > www/NODEJS_MOBILE_BUILD_NATIVE_MODULES_VALUE.txt cordova run ios @@ -367,7 +401,8 @@ cordova run ios ### Android If the installed Android NDK version is `>= r18`, the following error can occur while building for Android: -``` + +```sh FAILURE: Build failed with an exception. * What went wrong: @@ -380,16 +415,18 @@ This is caused by the Gradle version used by `cordova-android` version `6.x` not The [cordova-android issue](https://github.com/apache/cordova-android/issues/504) mentions possible workarounds the user may take to get around this issue, including updating the gradle plugin used by your Android Project / using an older NDK. To solve this issue while using Android NDK versions `>= r18` with cordova-android 6.x without having to update the project created by cordova, the recommended workaround would be to copy the `mips64el-linux-android-4.9` and `mipsel-linux-android-4.9` toolchains from an older release into your local NDK install or create a local link to other toolchains so that the Gradle internal checks pass, since these toolchains won't be used by Cordova. Here's one way to do this, assuming the `ANDROID_NDK_HOME` environment variable is set in your system: -``` -cd $ANDROID_NDK_HOME/toolchains -ln -s aarch64-linux-android-4.9 mips64el-linux-android -ln -s arm-linux-androideabi-4.9 mipsel-linux-android + +```bash +% cd $ANDROID_NDK_HOME/toolchains +% ln -s aarch64-linux-android-4.9 mips64el-linux-android +% ln -s arm-linux-androideabi-4.9 mipsel-linux-android ``` ### iOS When using `Xcode 10` with `cordova-ios` version `4.x`, the following error might occur when trying to build or run the application: -``` + +```sh The executable was signed with invalid entitlements. The entitlements specified in you Application's Code Signing Entitlements file are invalid, not permitted, or do not match those specified in you provisioning profile. @@ -397,17 +434,21 @@ The entitlements specified in you Application's Code Signing Entitlements file a This is caused by the new `Xcode 10` build system, as documented in this [cordova-ios issue](https://github.com/apache/cordova-ios/issues/407), including these recommended workarounds: -* Including the `--buildFlag="-UseModernBuildSystem=0"` flag in the `build` and `run` commands: -``` -cordova run ios --buildFlag='-UseModernBuildSystem=0' -cordova build ios --buildFlag='-UseModernBuildSystem=0' -``` -* Adding the flag under the iOS release or debug config when using a `build.json` config file: -``` -"buildFlag": [ - "-UseModernBuildSystem=0" -] -``` -* Changing the build system to the "Legacy Build System" when building from the Xcode IDE: +- Including the `--buildFlag="-UseModernBuildSystem=0"` flag in the `build` and `run` commands: + + ```bash + % cordova run ios --buildFlag='-UseModernBuildSystem=0' + % cordova build ios --buildFlag='-UseModernBuildSystem=0' + ``` + +- Adding the flag under the iOS release or debug config when using a `build.json` config file: + + ```json + "buildFlag": [ + "-UseModernBuildSystem=0" + ] + ``` + +- Changing the build system to the "Legacy Build System" when building from the Xcode IDE: 1. In the Xcode "File Menu", select "Project Settings..."; 1. In the "Project Settings..." window, inside the "Per-User Project Settings:" area, change the "Build System:" setting to "Legacy Build System". diff --git a/install/hooks/android/after-prepare-create-macOS-builder-helper.js b/install/hooks/android/after-prepare-create-macOS-builder-helper.js index 91eda523..ec8d5e5c 100644 --- a/install/hooks/android/after-prepare-create-macOS-builder-helper.js +++ b/install/hooks/android/after-prepare-create-macOS-builder-helper.js @@ -14,6 +14,7 @@ function getPlatformWWWPath(context, platform) { return platformAPIInstance.locations.www; } + // Adds a helper script to run "npm rebuild" with the current PATH. // This workaround is needed for Android Studio on macOS when it is not started // from the command line, as npm probably won't be in the PATH at build time. diff --git a/install/hooks/android/before-plugin-install.js b/install/hooks/android/before-plugin-install.js index e720d6de..958350fc 100644 --- a/install/hooks/android/before-plugin-install.js +++ b/install/hooks/android/before-plugin-install.js @@ -2,9 +2,8 @@ var fs = require('fs'); var zlib = require('zlib'); const nodeProjectFolder = 'www/nodejs-project'; -const libFolderPath = 'plugins/nodejs-mobile-cordova/libs/android/libnode/bin/'; +const libFolderPath = 'plugins/@red-mobile/nodejs-mobile-cordova/libs/android/libnode/bin/'; const path_armv7 = libFolderPath + 'armeabi-v7a/'; -const path_x86 = libFolderPath + 'x86/' const path_arm64 = libFolderPath + 'arm64-v8a/'; const path_x64 = libFolderPath + 'x86_64/' const lib_name = 'libnode.so'; @@ -27,11 +26,9 @@ function unzip(libFolderPath, callback) { function unzipAll(callback) { unzip(path_armv7, function() { - unzip(path_x86, function() { - unzip(path_arm64, function() { - unzip(path_x64, function() { - callback(null); - }); + unzip(path_arm64, function() { + unzip(path_x64, function() { + callback(null); }); }); }); diff --git a/install/hooks/ios/after-plugin-install.js b/install/hooks/ios/after-plugin-install.js index dbd23dff..c39528ba 100644 --- a/install/hooks/ios/after-plugin-install.js +++ b/install/hooks/ios/after-plugin-install.js @@ -52,14 +52,14 @@ find "$CODESIGNING_FOLDER_PATH/www/nodejs-project/" -name "*.framework" -type d find "$CODESIGNING_FOLDER_PATH/www/nodejs-project/" -path "*/.bin/*" -delete find "$CODESIGNING_FOLDER_PATH/www/nodejs-project/" -name ".bin" -type d -delete # Get the nodejs-mobile-gyp location -if [ -d "$PROJECT_DIR/../../plugins/nodejs-mobile-cordova/node_modules/nodejs-mobile-gyp/" ]; then -NODEJS_MOBILE_GYP_DIR="$( cd "$PROJECT_DIR" && cd ../../plugins/nodejs-mobile-cordova/node_modules/nodejs-mobile-gyp/ && pwd )" +if [ -d "$PROJECT_DIR/../../plugins/@red-mobile/nodejs-mobile-cordova/node_modules/nodejs-mobile-gyp/" ]; then +NODEJS_MOBILE_GYP_DIR="$( cd "$PROJECT_DIR" && cd ../../plugins/@red-mobile/nodejs-mobile-cordova/node_modules/nodejs-mobile-gyp/ && pwd )" else NODEJS_MOBILE_GYP_DIR="$( cd "$PROJECT_DIR" && cd ../../node_modules/nodejs-mobile-gyp/ && pwd )" fi NODEJS_MOBILE_GYP_BIN_FILE="$NODEJS_MOBILE_GYP_DIR"/bin/node-gyp.js # Rebuild modules with right environment -NODEJS_HEADERS_DIR="$( cd "$( dirname "$PRODUCT_SETTINGS_PATH" )" && cd Plugins/nodejs-mobile-cordova/ && pwd )" +NODEJS_HEADERS_DIR="$( cd "$( dirname "$PRODUCT_SETTINGS_PATH" )" && cd Plugins/@red-mobile/nodejs-mobile-cordova/ && pwd )" # Adds the original project .bin to the path. It's a workaround # to correctly build some modules that depend on symlinked modules, # like node-pre-gyp. @@ -115,7 +115,7 @@ if [ "1" != "$NODEJS_MOBILE_BUILD_NATIVE_MODULES" ]; then exit 0; fi find "$CODESIGNING_FOLDER_PATH/www/nodejs-project/" -name "*.o" -type f -delete find "$CODESIGNING_FOLDER_PATH/www/nodejs-project/" -name "*.a" -type f -delete # Create Info.plist for each framework built and loader override. -PATCH_SCRIPT_DIR="$( cd "$PROJECT_DIR" && cd ../../Plugins/nodejs-mobile-cordova/install/helper-scripts/ && pwd )" +PATCH_SCRIPT_DIR="$( cd "$PROJECT_DIR" && cd ../../Plugins/@red-mobile/nodejs-mobile-cordova/install/helper-scripts/ && pwd )" NODEJS_PROJECT_DIR="$( cd "$CODESIGNING_FOLDER_PATH" && cd www/nodejs-project/ && pwd )" node "$PATCH_SCRIPT_DIR"/ios-create-plists-and-dlopen-override.js $NODEJS_PROJECT_DIR # Embed every resulting .framework in the application and delete them afterwards. diff --git a/install/hooks/ios/before-plugin-install.js b/install/hooks/ios/before-plugin-install.js index bf9d705d..14f4c7c3 100644 --- a/install/hooks/ios/before-plugin-install.js +++ b/install/hooks/ios/before-plugin-install.js @@ -2,7 +2,7 @@ var fs = require('fs'); var targz2 = require('tar.gz2'); const nodeProjectFolder = 'www/nodejs-project'; -const nodeMobileFolderPath = 'plugins/nodejs-mobile-cordova/libs/ios/nodemobile/'; +const nodeMobileFolderPath = 'plugins/@red-mobile/nodejs-mobile-cordova/libs/ios/nodemobile/'; const nodeMobileFileName = 'NodeMobile.xcframework'; const nodeMobileFilePath = nodeMobileFolderPath + nodeMobileFileName; const zipFileName = nodeMobileFileName + '.tar.zip'; diff --git a/install/sample-project/copy-sample-project.sh b/install/sample-project/copy-sample-project.sh index 075de21b..2e447932 100755 --- a/install/sample-project/copy-sample-project.sh +++ b/install/sample-project/copy-sample-project.sh @@ -1,5 +1,5 @@ #!/bin/sh -SRC_PATH="plugins/nodejs-mobile-cordova/install/sample-project" +SRC_PATH="plugins/@red-mobile/nodejs-mobile-cordova/install/sample-project" copySampleFile () { cp -i "$SRC_PATH/$1" $1 @@ -9,4 +9,4 @@ mkdir -p "www/nodejs-project" copySampleFile "www/js/index.js" copySampleFile "www/nodejs-project/main.js" -copySampleFile "www/nodejs-project/package.json" \ No newline at end of file +copySampleFile "www/nodejs-project/package.json" diff --git a/libs/android/libnode/bin/arm64-v8a/libnode.so.gz b/libs/android/libnode/bin/arm64-v8a/libnode.so.gz index f58a44cb..b59c58d6 100644 Binary files a/libs/android/libnode/bin/arm64-v8a/libnode.so.gz and b/libs/android/libnode/bin/arm64-v8a/libnode.so.gz differ diff --git a/libs/android/libnode/bin/armeabi-v7a/libnode.so.gz b/libs/android/libnode/bin/armeabi-v7a/libnode.so.gz index 3c281244..e3a8c869 100644 Binary files a/libs/android/libnode/bin/armeabi-v7a/libnode.so.gz and b/libs/android/libnode/bin/armeabi-v7a/libnode.so.gz differ diff --git a/libs/android/libnode/bin/x86/libnode.so.gz b/libs/android/libnode/bin/x86/libnode.so.gz deleted file mode 100644 index df789bd6..00000000 Binary files a/libs/android/libnode/bin/x86/libnode.so.gz and /dev/null differ diff --git a/libs/android/libnode/bin/x86_64/libnode.so.gz b/libs/android/libnode/bin/x86_64/libnode.so.gz index 7e65ae7b..13ec961f 100644 Binary files a/libs/android/libnode/bin/x86_64/libnode.so.gz and b/libs/android/libnode/bin/x86_64/libnode.so.gz differ diff --git a/libs/android/libnode/include/node/common.gypi b/libs/android/libnode/include/node/common.gypi index 84be79f9..70e825f0 100644 --- a/libs/android/libnode/include/node/common.gypi +++ b/libs/android/libnode/include/node/common.gypi @@ -26,21 +26,20 @@ 'uv_library%': 'static_library', 'clang%': 0, + 'error_on_warn%': 'false', 'openssl_fips%': '', + 'openssl_no_asm%': 0, # Don't use ICU data file (icudtl.dat) from V8, we use our own. 'icu_use_data_file_flag%': 0, # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.44', + 'v8_embedder_string': '-node.22', ##### V8 defaults for Node.js ##### - # Old time default, now explicitly stated. - 'v8_use_snapshot': 1, - # Turn on SipHash for hash seed generation, addresses HashWick 'v8_use_siphash': 'true', @@ -61,10 +60,19 @@ # https://github.com/nodejs/node/pull/22920/files#r222779926 'v8_enable_handle_zapping': 0, + # Disable pointer compression. Can be enabled at build time via configure + # options but default values are required here as this file is also used by + # node-gyp to build addons. + 'v8_enable_pointer_compression%': 0, + 'v8_enable_31bit_smis_on_64bit_arch%': 0, + # Disable V8 untrusted code mitigations. # See https://github.com/v8/v8/wiki/Untrusted-code-mitigations 'v8_untrusted_code_mitigations': 0, + # Disable v8 hugepage by default. + 'v8_enable_hugepage%': 0, + # This is more of a V8 dev setting # https://github.com/nodejs/node/pull/22920/files#r222779926 'v8_enable_fast_mksnapshot': 0, @@ -77,67 +85,47 @@ ##### end V8 defaults ##### 'conditions': [ - ['target_arch=="arm64"', { - # Disabled pending https://github.com/nodejs/node/issues/23913. - 'openssl_no_asm%': 1, - }, { - 'openssl_no_asm%': 0, - }], ['OS == "win"', { 'os_posix': 0, 'v8_postmortem_support%': 0, + 'obj_dir': '<(PRODUCT_DIR)/obj', + 'v8_base': '<(PRODUCT_DIR)/lib/libv8_snapshot.a', }, { 'os_posix': 1, 'v8_postmortem_support%': 1, }], - ['v8_use_snapshot==1', { - 'conditions': [ - ['GENERATOR == "ninja"', { - 'obj_dir': '<(PRODUCT_DIR)/obj', - 'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_snapshot.a', - }, { - 'obj_dir%': '<(PRODUCT_DIR)/obj.target', - 'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a', - }], - ['OS == "win"', { - 'obj_dir': '<(PRODUCT_DIR)/obj', - 'v8_base': '<(PRODUCT_DIR)/lib/libv8_snapshot.a', - }], - ['OS == "mac" or OS == "ios"', { - 'obj_dir%': '<(PRODUCT_DIR)/obj.target', - 'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a', - }], - ], + ['GENERATOR == "ninja"', { + 'obj_dir': '<(PRODUCT_DIR)/obj', + 'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_snapshot.a', }, { - 'conditions': [ - ['GENERATOR == "ninja"', { - 'obj_dir': '<(PRODUCT_DIR)/obj', - 'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_nosnapshot.a', - }, { - 'obj_dir%': '<(PRODUCT_DIR)/obj.target', - 'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_nosnapshot.a', - }], - ['OS == "win"', { - 'obj_dir': '<(PRODUCT_DIR)/obj', - 'v8_base': '<(PRODUCT_DIR)/lib/libv8_nosnapshot.a', - }], - ['OS == "mac" or OS == "ios"', { - 'obj_dir%': '<(PRODUCT_DIR)/obj.target', - 'v8_base': '<(PRODUCT_DIR)/libv8_nosnapshot.a', - }], - ], + 'obj_dir%': '<(PRODUCT_DIR)/obj.target', + 'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a', }], ['openssl_fips != ""', { - 'openssl_product': '<(STATIC_LIB_PREFIX)crypto<(STATIC_LIB_SUFFIX)', + 'openssl_product': '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)', }, { 'openssl_product': '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)', }], ['OS=="mac" or OS == "ios"', { 'clang%': 1, + 'obj_dir%': '<(PRODUCT_DIR)/obj.target', + 'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a', + }], + # V8 pointer compression only supports 64bit architectures. + ['target_arch in "arm ia32 mips mipsel ppc"', { + 'v8_enable_pointer_compression': 0, + 'v8_enable_31bit_smis_on_64bit_arch': 0, }], ['target_arch in "ppc64 s390x"', { 'v8_enable_backtrace': 1, }], + ['OS=="linux"', { + 'node_section_ordering_info%': '' + }], + ['OS == "zos"', { + # use ICU data file on z/OS + 'icu_use_data_file_flag%': 1 + }] ], }, @@ -188,22 +176,51 @@ 'v8_enable_handle_zapping': 0, 'pgo_generate': ' -fprofile-generate ', 'pgo_use': ' -fprofile-use -fprofile-correction ', - 'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', 'conditions': [ ['node_shared != "true"', { 'MSVC_runtimeType': 0 # MultiThreaded (/MT) }, { 'MSVC_runtimeType': 2 # MultiThreadedDLL (/MD) }], + ['llvm_version=="0.0"', { + 'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', # GCC + }, { + 'lto': ' -flto ', # Clang + }], ], }, 'cflags': [ '-O3' ], 'conditions': [ + ['enable_lto=="true"', { + 'cflags': ['<(lto)'], + 'ldflags': ['<(lto)'], + 'xcode_settings': { + 'LLVM_LTO': 'YES', + }, + }], + ['OS=="linux"', { + 'conditions': [ + ['node_section_ordering_info!=""', { + 'cflags': [ + '-fuse-ld=gold', + '-ffunction-sections', + ], + 'ldflags': [ + '-fuse-ld=gold', + '-Wl,--section-ordering-file=<(node_section_ordering_info)', + ], + }], + ], + }], ['OS=="solaris"', { # pull in V8's postmortem metadata 'ldflags': [ '-Wl,-z,allextract' ] }], - ['OS!="mac" and OS!="ios" and OS!="win"', { + ['OS=="zos"', { + # increase performance, number from experimentation + 'cflags': [ '-qINLINE=::150:100000' ] + }], + ['OS!="mac" and OS!="ios" and OS!="win" and OS!="zos"', { 'cflags': [ '-fno-omit-frame-pointer' ], }], ['OS=="linux"', { @@ -216,10 +233,6 @@ 'cflags': ['<(pgo_use)'], 'ldflags': ['<(pgo_use)'], },], - ['enable_lto=="true"', { - 'cflags': ['<(lto)'], - 'ldflags': ['<(lto)'], - },], ], },], ['OS == "android"', { @@ -229,6 +242,11 @@ ], 'msvs_settings': { 'VCCLCompilerTool': { + 'conditions': [ + ['target_arch=="arm64"', { + 'FloatingPointModel': 1 # /fp:strict + }] + ], 'EnableFunctionLevelLinking': 'true', 'EnableIntrinsicFunctions': 'true', 'FavorSizeOrSpeed': 1, # /Ot, favor speed over size @@ -250,16 +268,29 @@ 'defines': [ 'V8_DEPRECATION_WARNINGS', 'V8_IMMINENT_DEPRECATION_WARNINGS', + '_GLIBCXX_USE_CXX11_ABI=1', ], # Forcibly disable -Werror. We support a wide range of compilers, it's # simply not feasible to squelch all warnings, never mind that the # libraries in deps/ are not under our control. - 'cflags!': ['-Werror'], + 'conditions': [ + [ 'error_on_warn=="false"', { + 'cflags!': ['-Werror'], + }, '(_target_name!="<(node_lib_target_name)" or ' + '_target_name!="<(node_core_target_name)")', { + 'cflags!': ['-Werror'], + }], + ], 'msvs_settings': { 'VCCLCompilerTool': { + 'AdditionalOptions': ['/Zc:__cplusplus'], 'BufferSecurityCheck': 'true', - 'DebugInformationFormat': 1, # /Z7 embed info in .obj files + 'target_conditions': [ + ['_toolset=="target"', { + 'DebugInformationFormat': 1 # /Z7 embed info in .obj files + }], + ], 'ExceptionHandling': 0, # /EHsc 'MultiProcessorCompilation': 'true', 'StringPooling': 'true', # pool string literals @@ -317,7 +348,7 @@ [ 'target_arch=="arm64"', { 'msvs_configuration_platform': 'arm64', }], - ['asan == 1 and OS != "mac" and OS !="ios"', { + ['asan == 1 and OS != "mac" and OS != "ios" and OS != "zos"', { 'cflags+': [ '-fno-omit-frame-pointer', '-fsanitize=address', @@ -345,6 +376,15 @@ }], ], }], + ['v8_enable_pointer_compression == 1', { + 'defines': [ + 'V8_COMPRESS_POINTERS', + 'V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE', + ], + }], + ['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', { + 'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'], + }], ['OS == "win"', { 'defines': [ 'WIN32', @@ -366,7 +406,7 @@ }], [ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', { 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], - 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++1y' ], + 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++14' ], 'defines': [ '__STDC_FORMAT_MACROS' ], 'ldflags': [ '-rdynamic' ], 'target_conditions': [ @@ -384,10 +424,6 @@ 'cflags': [ '-m32' ], 'ldflags': [ '-m32' ], }], - [ 'target_arch=="x32"', { - 'cflags': [ '-mx32' ], - 'ldflags': [ '-mx32' ], - }], [ 'target_arch=="x64"', { 'cflags': [ '-m64' ], 'ldflags': [ '-m64' ], @@ -400,7 +436,7 @@ 'cflags': [ '-m64', '-mminimal-toc' ], 'ldflags': [ '-m64' ], }], - [ 'target_arch=="s390x"', { + [ 'target_arch=="s390x" and OS=="linux"', { 'cflags': [ '-m64', '-march=z196' ], 'ldflags': [ '-m64', '-march=z196' ], }], @@ -488,7 +524,7 @@ 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings 'PREBINDING': 'NO', # No -Wl,-prebind - 'MACOSX_DEPLOYMENT_TARGET': '10.10', # -mmacosx-version-min=10.10 + 'MACOSX_DEPLOYMENT_TARGET': '10.13', # -mmacosx-version-min=10.13 'USE_HEADERMAP': 'NO', 'OTHER_CFLAGS': [ '-fno-strict-aliasing', @@ -504,8 +540,7 @@ ['_type!="static_library"', { 'xcode_settings': { 'OTHER_LDFLAGS': [ - '-Wl,-no_pie', - '-Wl,-search_paths_first', + '-Wl,-search_paths_first' ], }, }], @@ -528,7 +563,7 @@ ['clang==1', { 'xcode_settings': { 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', - 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++1y', # -std=gnu++1y + 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++14', # -std=gnu++14 'CLANG_CXX_LIBRARY': 'libc++', }, }], @@ -545,7 +580,7 @@ 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings 'PREBINDING': 'NO', # No -Wl,-prebind - 'IPHONEOS_DEPLOYMENT_TARGET': '9.0', # -miphoneos-version-min=9.0 + 'IPHONEOS_DEPLOYMENT_TARGET': '11.0', # -miphoneos-version-min=11.0 'USE_HEADERMAP': 'NO', 'OTHER_CFLAGS': [ '-fno-strict-aliasing', @@ -638,6 +673,50 @@ 'OPENSSL_NO_ASM', ], }], + ['OS == "zos"', { + 'defines': [ + '_XOPEN_SOURCE_EXTENDED', + '_XOPEN_SOURCE=600', + '_UNIX03_THREADS', + '_UNIX03_WITHDRAWN', + '_UNIX03_SOURCE', + '_OPEN_SYS_SOCK_IPV6', + '_OPEN_SYS_FILE_EXT=1', + '_POSIX_SOURCE', + '_OPEN_SYS', + '_OPEN_SYS_IF_EXT', + '_OPEN_SYS_SOCK_IPV6', + '_OPEN_MSGQ_EXT', + '_LARGE_TIME_API', + '_ALL_SOURCE', + '_AE_BIMODAL=1', + '__IBMCPP_TR1__', + 'NODE_PLATFORM="os390"', + 'PATH_MAX=1024', + '_ENHANCED_ASCII_EXT=0xFFFFFFFF', + '_Export=extern', + '__static_assert=static_assert', + ], + 'cflags': [ + '-q64', + '-Wc,DLL', + '-Wa,GOFF', + '-qARCH=10', + '-qASCII', + '-qTUNE=12', + '-qENUM=INT', + '-qEXPORTALL', + '-qASM', + ], + 'cflags_cc': [ + '-qxclang=-std=c++14', + ], + 'ldflags': [ + '-q64', + ], + # for addons due to v8config.h include of "zos-base.h": + 'include_dirs': ['<(zoslib_include_dir)'], + }], ], } } diff --git a/libs/android/libnode/include/node/config.gypi b/libs/android/libnode/include/node/config.gypi index da56cb98..60915ac9 100644 --- a/libs/android/libnode/include/node/config.gypi +++ b/libs/android/libnode/include/node/config.gypi @@ -1,12 +1,11 @@ # Do not edit. Generated by the configure script. -{ 'target_defaults': { 'cflags': [], - 'default_configuration': 'Release', - 'defines': [], - 'include_dirs': [], - 'libraries': []}, +{ 'target_defaults': {'cflags': [], 'default_configuration': 'Release', 'defines': ['NODE_OPENSSL_CONF_NAME=nodejs_conf'], 'include_dirs': [], 'libraries': []}, 'variables': { 'OS': 'android', + 'arm_float_abi': 'default', + 'arm_fpu': 'vfpv3', + 'arm_thumb': 0, + 'arm_version': '7', 'asan': 0, - 'build_v8_with_gn': 'false', 'coverage': 'false', 'dcheck_always_on': 0, 'debug_nghttp2': 'false', @@ -14,26 +13,311 @@ 'enable_lto': 'false', 'enable_pgo_generate': 'false', 'enable_pgo_use': 'false', + 'error_on_warn': 'false', 'force_dynamic_crt': 1, 'host_arch': 'x64', 'icu_small': 'false', 'is_debug': 0, - 'llvm_version': '0.0', - 'napi_build_version': '7', + 'llvm_version': '9.0', + 'napi_build_version': '8', 'node_byteorder': 'little', 'node_debug_lib': 'false', 'node_enable_d8': 'false', + 'node_install_corepack': 'true', 'node_install_npm': 'true', - 'node_module_version': 72, + 'node_library_files': [ 'lib/tls.js', + 'lib/constants.js', + 'lib/async_hooks.js', + 'lib/_http_outgoing.js', + 'lib/vm.js', + 'lib/punycode.js', + 'lib/tty.js', + 'lib/worker_threads.js', + 'lib/querystring.js', + 'lib/_stream_writable.js', + 'lib/readline.js', + 'lib/path.js', + 'lib/module.js', + 'lib/string_decoder.js', + 'lib/perf_hooks.js', + 'lib/http.js', + 'lib/net.js', + 'lib/child_process.js', + 'lib/sys.js', + 'lib/wasi.js', + 'lib/fs.js', + 'lib/v8.js', + 'lib/zlib.js', + 'lib/dgram.js', + 'lib/cluster.js', + 'lib/_stream_transform.js', + 'lib/console.js', + 'lib/url.js', + 'lib/_stream_readable.js', + 'lib/trace_events.js', + 'lib/_stream_duplex.js', + 'lib/_http_common.js', + 'lib/_stream_passthrough.js', + 'lib/buffer.js', + 'lib/http2.js', + 'lib/_http_incoming.js', + 'lib/_stream_wrap.js', + 'lib/events.js', + 'lib/_http_client.js', + 'lib/crypto.js', + 'lib/diagnostics_channel.js', + 'lib/timers.js', + 'lib/inspector.js', + 'lib/_http_agent.js', + 'lib/os.js', + 'lib/https.js', + 'lib/test.js', + 'lib/assert.js', + 'lib/_tls_wrap.js', + 'lib/util.js', + 'lib/stream.js', + 'lib/dns.js', + 'lib/_tls_common.js', + 'lib/_http_server.js', + 'lib/repl.js', + 'lib/process.js', + 'lib/domain.js', + 'lib/assert/strict.js', + 'lib/internal/constants.js', + 'lib/internal/async_hooks.js', + 'lib/internal/priority_queue.js', + 'lib/internal/tty.js', + 'lib/internal/dtrace.js', + 'lib/internal/cli_table.js', + 'lib/internal/querystring.js', + 'lib/internal/options.js', + 'lib/internal/worker.js', + 'lib/internal/trace_events_async_hooks.js', + 'lib/internal/http.js', + 'lib/internal/net.js', + 'lib/internal/child_process.js', + 'lib/internal/js_stream_socket.js', + 'lib/internal/socketaddress.js', + 'lib/internal/dgram.js', + 'lib/internal/url.js', + 'lib/internal/abort_controller.js', + 'lib/internal/fixed_queue.js', + 'lib/internal/buffer.js', + 'lib/internal/validators.js', + 'lib/internal/stream_base_commons.js', + 'lib/internal/timers.js', + 'lib/internal/errors.js', + 'lib/internal/encoding.js', + 'lib/internal/blob.js', + 'lib/internal/v8_prof_processor.js', + 'lib/internal/freelist.js', + 'lib/internal/heap_utils.js', + 'lib/internal/linkedlist.js', + 'lib/internal/error_serdes.js', + 'lib/internal/blocklist.js', + 'lib/internal/idna.js', + 'lib/internal/v8_prof_polyfill.js', + 'lib/internal/histogram.js', + 'lib/internal/watchdog.js', + 'lib/internal/assert.js', + 'lib/internal/util.js', + 'lib/internal/socket_list.js', + 'lib/internal/inspector_async_hook.js', + 'lib/internal/promise_hooks.js', + 'lib/internal/event_target.js', + 'lib/internal/repl.js', + 'lib/internal/freeze_intrinsics.js', + 'lib/internal/modules/run_main.js', + 'lib/internal/modules/package_json_reader.js', + 'lib/internal/modules/esm/translators.js', + 'lib/internal/modules/esm/fetch_module.js', + 'lib/internal/modules/esm/initialize_import_meta.js', + 'lib/internal/modules/esm/formats.js', + 'lib/internal/modules/esm/create_dynamic_module.js', + 'lib/internal/modules/esm/get_format.js', + 'lib/internal/modules/esm/loader.js', + 'lib/internal/modules/esm/module_map.js', + 'lib/internal/modules/esm/handle_process_exit.js', + 'lib/internal/modules/esm/load.js', + 'lib/internal/modules/esm/module_job.js', + 'lib/internal/modules/esm/resolve.js', + 'lib/internal/modules/esm/assert.js', + 'lib/internal/modules/cjs/loader.js', + 'lib/internal/modules/cjs/helpers.js', + 'lib/internal/assert/assertion_error.js', + 'lib/internal/assert/calltracker.js', + 'lib/internal/tls/parse-cert-string.js', + 'lib/internal/tls/secure-pair.js', + 'lib/internal/tls/secure-context.js', + 'lib/internal/test_runner/utils.js', + 'lib/internal/test_runner/test.js', + 'lib/internal/test_runner/harness.js', + 'lib/internal/test_runner/tap_stream.js', + 'lib/internal/vm/module.js', + 'lib/internal/child_process/serialization.js', + 'lib/internal/policy/manifest.js', + 'lib/internal/policy/sri.js', + 'lib/internal/bootstrap/environment.js', + 'lib/internal/bootstrap/loaders.js', + 'lib/internal/bootstrap/pre_execution.js', + 'lib/internal/bootstrap/node.js', + 'lib/internal/bootstrap/switches/is_not_main_thread.js', + 'lib/internal/bootstrap/switches/is_main_thread.js', + 'lib/internal/bootstrap/switches/does_own_process_state.js', + 'lib/internal/bootstrap/switches/does_not_own_process_state.js', + 'lib/internal/fs/read_file_context.js', + 'lib/internal/fs/utils.js', + 'lib/internal/fs/watchers.js', + 'lib/internal/fs/sync_write_stream.js', + 'lib/internal/fs/streams.js', + 'lib/internal/fs/promises.js', + 'lib/internal/fs/rimraf.js', + 'lib/internal/fs/dir.js', + 'lib/internal/fs/cp/cp.js', + 'lib/internal/fs/cp/cp-sync.js', + 'lib/internal/source_map/source_map.js', + 'lib/internal/source_map/prepare_stack_trace.js', + 'lib/internal/source_map/source_map_cache.js', + 'lib/internal/http2/compat.js', + 'lib/internal/http2/util.js', + 'lib/internal/http2/core.js', + 'lib/internal/console/constructor.js', + 'lib/internal/console/global.js', + 'lib/internal/webstreams/transfer.js', + 'lib/internal/webstreams/transformstream.js', + 'lib/internal/webstreams/compression.js', + 'lib/internal/webstreams/queuingstrategies.js', + 'lib/internal/webstreams/encoding.js', + 'lib/internal/webstreams/adapters.js', + 'lib/internal/webstreams/writablestream.js', + 'lib/internal/webstreams/readablestream.js', + 'lib/internal/webstreams/util.js', + 'lib/internal/cluster/child.js', + 'lib/internal/cluster/worker.js', + 'lib/internal/cluster/utils.js', + 'lib/internal/cluster/shared_handle.js', + 'lib/internal/cluster/round_robin_handle.js', + 'lib/internal/cluster/primary.js', + 'lib/internal/crypto/scrypt.js', + 'lib/internal/crypto/x509.js', + 'lib/internal/crypto/diffiehellman.js', + 'lib/internal/crypto/keygen.js', + 'lib/internal/crypto/aes.js', + 'lib/internal/crypto/rsa.js', + 'lib/internal/crypto/hash.js', + 'lib/internal/crypto/random.js', + 'lib/internal/crypto/mac.js', + 'lib/internal/crypto/cipher.js', + 'lib/internal/crypto/sig.js', + 'lib/internal/crypto/webcrypto.js', + 'lib/internal/crypto/certificate.js', + 'lib/internal/crypto/pbkdf2.js', + 'lib/internal/crypto/hkdf.js', + 'lib/internal/crypto/cfrg.js', + 'lib/internal/crypto/util.js', + 'lib/internal/crypto/keys.js', + 'lib/internal/crypto/hashnames.js', + 'lib/internal/crypto/ec.js', + 'lib/internal/perf/performance_entry.js', + 'lib/internal/perf/event_loop_utilization.js', + 'lib/internal/perf/event_loop_delay.js', + 'lib/internal/perf/utils.js', + 'lib/internal/perf/performance.js', + 'lib/internal/perf/timerify.js', + 'lib/internal/perf/observe.js', + 'lib/internal/perf/usertiming.js', + 'lib/internal/perf/resource_timing.js', + 'lib/internal/perf/nodetiming.js', + 'lib/internal/process/worker_thread_only.js', + 'lib/internal/process/execution.js', + 'lib/internal/process/report.js', + 'lib/internal/process/policy.js', + 'lib/internal/process/task_queues.js', + 'lib/internal/process/signal.js', + 'lib/internal/process/esm_loader.js', + 'lib/internal/process/warning.js', + 'lib/internal/process/per_thread.js', + 'lib/internal/process/promises.js', + 'lib/internal/dns/utils.js', + 'lib/internal/dns/promises.js', + 'lib/internal/streams/transform.js', + 'lib/internal/streams/pipeline.js', + 'lib/internal/streams/end-of-stream.js', + 'lib/internal/streams/destroy.js', + 'lib/internal/streams/utils.js', + 'lib/internal/streams/lazy_transform.js', + 'lib/internal/streams/add-abort-signal.js', + 'lib/internal/streams/legacy.js', + 'lib/internal/streams/buffer_list.js', + 'lib/internal/streams/writable.js', + 'lib/internal/streams/state.js', + 'lib/internal/streams/duplexify.js', + 'lib/internal/streams/from.js', + 'lib/internal/streams/readable.js', + 'lib/internal/streams/passthrough.js', + 'lib/internal/streams/compose.js', + 'lib/internal/streams/duplex.js', + 'lib/internal/streams/operators.js', + 'lib/internal/per_context/primordials.js', + 'lib/internal/per_context/domexception.js', + 'lib/internal/per_context/messageport.js', + 'lib/internal/readline/utils.js', + 'lib/internal/readline/emitKeypressEvents.js', + 'lib/internal/readline/callbacks.js', + 'lib/internal/readline/interface.js', + 'lib/internal/test/transfer.js', + 'lib/internal/test/binding.js', + 'lib/internal/legacy/processbinding.js', + 'lib/internal/util/comparisons.js', + 'lib/internal/util/inspect.js', + 'lib/internal/util/iterable_weak_map.js', + 'lib/internal/util/debuglog.js', + 'lib/internal/util/types.js', + 'lib/internal/util/inspector.js', + 'lib/internal/util/parse_args/utils.js', + 'lib/internal/util/parse_args/parse_args.js', + 'lib/internal/v8/startup_snapshot.js', + 'lib/internal/main/test_runner.js', + 'lib/internal/main/prof_process.js', + 'lib/internal/main/print_help.js', + 'lib/internal/main/eval_string.js', + 'lib/internal/main/check_syntax.js', + 'lib/internal/main/inspect.js', + 'lib/internal/main/eval_stdin.js', + 'lib/internal/main/run_main_module.js', + 'lib/internal/main/mksnapshot.js', + 'lib/internal/main/worker_thread.js', + 'lib/internal/main/repl.js', + 'lib/internal/repl/await.js', + 'lib/internal/repl/utils.js', + 'lib/internal/repl/history.js', + 'lib/internal/worker/js_transferable.js', + 'lib/internal/worker/io.js', + 'lib/internal/debugger/inspect_repl.js', + 'lib/internal/debugger/inspect_client.js', + 'lib/internal/debugger/inspect.js', + 'lib/fs/promises.js', + 'lib/timers/promises.js', + 'lib/stream/web.js', + 'lib/stream/consumers.js', + 'lib/stream/promises.js', + 'lib/dns/promises.js', + 'lib/path/posix.js', + 'lib/path/win32.js', + 'lib/util/types.js'], + 'node_module_version': 93, 'node_no_browser_globals': 'false', - 'node_prefix': '/', + 'node_prefix': '/usr/local', 'node_release_urlbase': '', + 'node_section_ordering_info': '', 'node_shared': 'true', 'node_shared_brotli': 'false', 'node_shared_cares': 'false', 'node_shared_http_parser': 'false', 'node_shared_libuv': 'false', 'node_shared_nghttp2': 'false', + 'node_shared_nghttp3': 'false', + 'node_shared_ngtcp2': 'false', 'node_shared_openssl': 'false', 'node_shared_zlib': 'false', 'node_tag': '', @@ -50,19 +334,23 @@ 'openssl_fips': '', 'openssl_is_fips': 'false', 'openssl_no_asm': 1, + 'openssl_quic': 'true', 'ossfuzz': 'false', 'shlib_suffix': 'so', - 'target_arch': 'arm64', + 'target_arch': 'arm', + 'v8_enable_31bit_smis_on_64bit_arch': 0, 'v8_enable_gdbjit': 0, + 'v8_enable_hugepage': 0, 'v8_enable_i18n_support': 0, 'v8_enable_inspector': 0, 'v8_enable_lite_mode': 0, 'v8_enable_object_print': 1, + 'v8_enable_pointer_compression': 0, + 'v8_enable_webassembly': 1, 'v8_no_strict_aliasing': 1, 'v8_optimized_debug': 1, 'v8_promise_internal_field_count': 1, 'v8_random_seed': 0, 'v8_trace_maps': 0, 'v8_use_siphash': 1, - 'v8_use_snapshot': 1, 'want_separate_host_toolset': 1}} diff --git a/libs/android/libnode/include/node/cppgc/allocation.h b/libs/android/libnode/include/node/cppgc/allocation.h new file mode 100644 index 00000000..d75f1a97 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/allocation.h @@ -0,0 +1,233 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_ALLOCATION_H_ +#define INCLUDE_CPPGC_ALLOCATION_H_ + +#include +#include +#include +#include +#include +#include + +#include "cppgc/custom-space.h" +#include "cppgc/internal/api-constants.h" +#include "cppgc/internal/gc-info.h" +#include "cppgc/type-traits.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +/** + * AllocationHandle is used to allocate garbage-collected objects. + */ +class AllocationHandle; + +namespace internal { + +class V8_EXPORT MakeGarbageCollectedTraitInternal { + protected: + static inline void MarkObjectAsFullyConstructed(const void* payload) { + // See api_constants for an explanation of the constants. + std::atomic* atomic_mutable_bitfield = + reinterpret_cast*>( + const_cast(reinterpret_cast( + reinterpret_cast(payload) - + api_constants::kFullyConstructedBitFieldOffsetFromPayload))); + atomic_mutable_bitfield->fetch_or(api_constants::kFullyConstructedBitMask, + std::memory_order_release); + } + + template + struct SpacePolicy { + static void* Allocate(AllocationHandle& handle, size_t size) { + // Custom space. + static_assert(std::is_base_of::value, + "Custom space must inherit from CustomSpaceBase."); + return MakeGarbageCollectedTraitInternal::Allocate( + handle, size, internal::GCInfoTrait::Index(), + CustomSpace::kSpaceIndex); + } + }; + + template + struct SpacePolicy { + static void* Allocate(AllocationHandle& handle, size_t size) { + // Default space. + return MakeGarbageCollectedTraitInternal::Allocate( + handle, size, internal::GCInfoTrait::Index()); + } + }; + + private: + static void* Allocate(cppgc::AllocationHandle& handle, size_t size, + GCInfoIndex index); + static void* Allocate(cppgc::AllocationHandle& handle, size_t size, + GCInfoIndex index, CustomSpaceIndex space_index); + + friend class HeapObjectHeader; +}; + +} // namespace internal + +/** + * Base trait that provides utilities for advancers users that have custom + * allocation needs (e.g., overriding size). It's expected that users override + * MakeGarbageCollectedTrait (see below) and inherit from + * MakeGarbageCollectedTraitBase and make use of the low-level primitives + * offered to allocate and construct an object. + */ +template +class MakeGarbageCollectedTraitBase + : private internal::MakeGarbageCollectedTraitInternal { + private: + static_assert(internal::IsGarbageCollectedType::value, + "T needs to be a garbage collected object"); + static_assert(!IsGarbageCollectedWithMixinTypeV || + sizeof(T) <= + internal::api_constants::kLargeObjectSizeThreshold, + "GarbageCollectedMixin may not be a large object"); + + protected: + /** + * Allocates memory for an object of type T. + * + * \param handle AllocationHandle identifying the heap to allocate the object + * on. + * \param size The size that should be reserved for the object. + * \returns the memory to construct an object of type T on. + */ + V8_INLINE static void* Allocate(AllocationHandle& handle, size_t size) { + static_assert( + std::is_base_of::value, + "U of GarbageCollected must be a base of T. Check " + "GarbageCollected base class inheritance."); + return SpacePolicy< + typename internal::GCInfoFolding< + T, typename T::ParentMostGarbageCollectedType>::ResultType, + typename SpaceTrait::Space>::Allocate(handle, size); + } + + /** + * Marks an object as fully constructed, resulting in precise handling by the + * garbage collector. + * + * \param payload The base pointer the object is allocated at. + */ + V8_INLINE static void MarkObjectAsFullyConstructed(const void* payload) { + internal::MakeGarbageCollectedTraitInternal::MarkObjectAsFullyConstructed( + payload); + } +}; + +/** + * Passed to MakeGarbageCollected to specify how many bytes should be appended + * to the allocated object. + * + * Example: + * \code + * class InlinedArray final : public GarbageCollected { + * public: + * explicit InlinedArray(size_t bytes) : size(bytes), byte_array(this + 1) {} + * void Trace(Visitor*) const {} + + * size_t size; + * char* byte_array; + * }; + * + * auto* inlined_array = MakeGarbageCollectedbyte_array[i]); + * } + * \endcode + */ +struct AdditionalBytes { + constexpr explicit AdditionalBytes(size_t bytes) : value(bytes) {} + const size_t value; +}; + +/** + * Default trait class that specifies how to construct an object of type T. + * Advanced users may override how an object is constructed using the utilities + * that are provided through MakeGarbageCollectedTraitBase. + * + * Any trait overriding construction must + * - allocate through `MakeGarbageCollectedTraitBase::Allocate`; + * - mark the object as fully constructed using + * `MakeGarbageCollectedTraitBase::MarkObjectAsFullyConstructed`; + */ +template +class MakeGarbageCollectedTrait : public MakeGarbageCollectedTraitBase { + public: + template + static T* Call(AllocationHandle& handle, Args&&... args) { + void* memory = + MakeGarbageCollectedTraitBase::Allocate(handle, sizeof(T)); + T* object = ::new (memory) T(std::forward(args)...); + MakeGarbageCollectedTraitBase::MarkObjectAsFullyConstructed(object); + return object; + } + + template + static T* Call(AllocationHandle& handle, AdditionalBytes additional_bytes, + Args&&... args) { + void* memory = MakeGarbageCollectedTraitBase::Allocate( + handle, sizeof(T) + additional_bytes.value); + T* object = ::new (memory) T(std::forward(args)...); + MakeGarbageCollectedTraitBase::MarkObjectAsFullyConstructed(object); + return object; + } +}; + +/** + * Allows users to specify a post-construction callback for specific types. The + * callback is invoked on the instance of type T right after it has been + * constructed. This can be useful when the callback requires a + * fully-constructed object to be able to dispatch to virtual methods. + */ +template +struct PostConstructionCallbackTrait { + static void Call(T*) {} +}; + +/** + * Constructs a managed object of type T where T transitively inherits from + * GarbageCollected. + * + * \param args List of arguments with which an instance of T will be + * constructed. + * \returns an instance of type T. + */ +template +T* MakeGarbageCollected(AllocationHandle& handle, Args&&... args) { + T* object = + MakeGarbageCollectedTrait::Call(handle, std::forward(args)...); + PostConstructionCallbackTrait::Call(object); + return object; +} + +/** + * Constructs a managed object of type T where T transitively inherits from + * GarbageCollected. Created objects will have additional bytes appended to + * it. Allocated memory would suffice for `sizeof(T) + additional_bytes`. + * + * \param additional_bytes Denotes how many bytes to append to T. + * \param args List of arguments with which an instance of T will be + * constructed. + * \returns an instance of type T. + */ +template +T* MakeGarbageCollected(AllocationHandle& handle, + AdditionalBytes additional_bytes, Args&&... args) { + T* object = MakeGarbageCollectedTrait::Call(handle, additional_bytes, + std::forward(args)...); + PostConstructionCallbackTrait::Call(object); + return object; +} + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_ALLOCATION_H_ diff --git a/libs/android/libnode/include/node/cppgc/common.h b/libs/android/libnode/include/node/cppgc/common.h new file mode 100644 index 00000000..b6dbff3d --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/common.h @@ -0,0 +1,29 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_COMMON_H_ +#define INCLUDE_CPPGC_COMMON_H_ + +// TODO(chromium:1056170): Remove dependency on v8. +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +/** + * Indicator for the stack state of the embedder. + */ +enum class EmbedderStackState { + /** + * Stack may contain interesting heap pointers. + */ + kMayContainHeapPointers, + /** + * Stack does not contain any interesting heap pointers. + */ + kNoHeapPointers, +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_COMMON_H_ diff --git a/libs/android/libnode/include/node/cppgc/cross-thread-persistent.h b/libs/android/libnode/include/node/cppgc/cross-thread-persistent.h new file mode 100644 index 00000000..0a9afdcd --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/cross-thread-persistent.h @@ -0,0 +1,413 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_CROSS_THREAD_PERSISTENT_H_ +#define INCLUDE_CPPGC_CROSS_THREAD_PERSISTENT_H_ + +#include + +#include "cppgc/internal/persistent-node.h" +#include "cppgc/internal/pointer-policies.h" +#include "cppgc/persistent.h" +#include "cppgc/visitor.h" + +namespace cppgc { +namespace internal { + +// Wrapper around PersistentBase that allows accessing poisoned memory when +// using ASAN. This is needed as the GC of the heap that owns the value +// of a CTP, may clear it (heap termination, weakness) while the object +// holding the CTP may be poisoned as itself may be deemed dead. +class CrossThreadPersistentBase : public PersistentBase { + public: + CrossThreadPersistentBase() = default; + explicit CrossThreadPersistentBase(const void* raw) : PersistentBase(raw) {} + + V8_CLANG_NO_SANITIZE("address") const void* GetValueFromGC() const { + return raw_; + } + + V8_CLANG_NO_SANITIZE("address") + PersistentNode* GetNodeFromGC() const { return node_; } + + V8_CLANG_NO_SANITIZE("address") + void ClearFromGC() const { + raw_ = nullptr; + node_ = nullptr; + } +}; + +template +class BasicCrossThreadPersistent final : public CrossThreadPersistentBase, + public LocationPolicy, + private WeaknessPolicy, + private CheckingPolicy { + public: + using typename WeaknessPolicy::IsStrongPersistent; + using PointeeType = T; + + ~BasicCrossThreadPersistent() { Clear(); } + + BasicCrossThreadPersistent( + const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc) {} + + BasicCrossThreadPersistent( + std::nullptr_t, const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc) {} + + BasicCrossThreadPersistent( + SentinelPointer s, const SourceLocation& loc = SourceLocation::Current()) + : CrossThreadPersistentBase(s), LocationPolicy(loc) {} + + BasicCrossThreadPersistent( + T* raw, const SourceLocation& loc = SourceLocation::Current()) + : CrossThreadPersistentBase(raw), LocationPolicy(loc) { + if (!IsValid(raw)) return; + PersistentRegionLock guard; + CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw); + SetNode(region.AllocateNode(this, &Trace)); + this->CheckPointer(raw); + } + + class UnsafeCtorTag { + private: + UnsafeCtorTag() = default; + template + friend class BasicCrossThreadPersistent; + }; + + BasicCrossThreadPersistent( + UnsafeCtorTag, T* raw, + const SourceLocation& loc = SourceLocation::Current()) + : CrossThreadPersistentBase(raw), LocationPolicy(loc) { + if (!IsValid(raw)) return; + CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw); + SetNode(region.AllocateNode(this, &Trace)); + this->CheckPointer(raw); + } + + BasicCrossThreadPersistent( + T& raw, const SourceLocation& loc = SourceLocation::Current()) + : BasicCrossThreadPersistent(&raw, loc) {} + + template ::value>> + BasicCrossThreadPersistent( + internal::BasicMember + member, + const SourceLocation& loc = SourceLocation::Current()) + : BasicCrossThreadPersistent(member.Get(), loc) {} + + BasicCrossThreadPersistent( + const BasicCrossThreadPersistent& other, + const SourceLocation& loc = SourceLocation::Current()) + : BasicCrossThreadPersistent(loc) { + // Invoke operator=. + *this = other; + } + + // Heterogeneous ctor. + template ::value>> + BasicCrossThreadPersistent( + const BasicCrossThreadPersistent& other, + const SourceLocation& loc = SourceLocation::Current()) + : BasicCrossThreadPersistent(loc) { + *this = other; + } + + BasicCrossThreadPersistent( + BasicCrossThreadPersistent&& other, + const SourceLocation& loc = SourceLocation::Current()) noexcept { + // Invoke operator=. + *this = std::move(other); + } + + BasicCrossThreadPersistent& operator=( + const BasicCrossThreadPersistent& other) { + PersistentRegionLock guard; + AssignUnsafe(other.Get()); + return *this; + } + + template ::value>> + BasicCrossThreadPersistent& operator=( + const BasicCrossThreadPersistent& other) { + PersistentRegionLock guard; + AssignUnsafe(other.Get()); + return *this; + } + + BasicCrossThreadPersistent& operator=(BasicCrossThreadPersistent&& other) { + if (this == &other) return *this; + Clear(); + PersistentRegionLock guard; + PersistentBase::operator=(std::move(other)); + LocationPolicy::operator=(std::move(other)); + if (!IsValid(GetValue())) return *this; + GetNode()->UpdateOwner(this); + other.SetValue(nullptr); + other.SetNode(nullptr); + this->CheckPointer(Get()); + return *this; + } + + BasicCrossThreadPersistent& operator=(T* other) { + Assign(other); + return *this; + } + + // Assignment from member. + template ::value>> + BasicCrossThreadPersistent& operator=( + internal::BasicMember + member) { + return operator=(member.Get()); + } + + BasicCrossThreadPersistent& operator=(std::nullptr_t) { + Clear(); + return *this; + } + + BasicCrossThreadPersistent& operator=(SentinelPointer s) { + Assign(s); + return *this; + } + + /** + * Returns a pointer to the stored object. + * + * Note: **Not thread-safe.** + * + * \returns a pointer to the stored object. + */ + // CFI cast exemption to allow passing SentinelPointer through T* and support + // heterogeneous assignments between different Member and Persistent handles + // based on their actual types. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") T* Get() const { + return static_cast(const_cast(GetValue())); + } + + /** + * Clears the stored object. + */ + void Clear() { + // Simplified version of `Assign()` to allow calling without a complete type + // `T`. + const void* old_value = GetValue(); + if (IsValid(old_value)) { + PersistentRegionLock guard; + old_value = GetValue(); + // The fast path check (IsValid()) does not acquire the lock. Reload + // the value to ensure the reference has not been cleared. + if (IsValid(old_value)) { + CrossThreadPersistentRegion& region = + this->GetPersistentRegion(old_value); + region.FreeNode(GetNode()); + SetNode(nullptr); + } else { + CPPGC_DCHECK(!GetNode()); + } + } + SetValue(nullptr); + } + + /** + * Returns a pointer to the stored object and releases it. + * + * Note: **Not thread-safe.** + * + * \returns a pointer to the stored object. + */ + T* Release() { + T* result = Get(); + Clear(); + return result; + } + + /** + * Conversio to boolean. + * + * Note: **Not thread-safe.** + * + * \returns true if an actual object has been stored and false otherwise. + */ + explicit operator bool() const { return Get(); } + + /** + * Conversion to object of type T. + * + * Note: **Not thread-safe.** + * + * \returns the object. + */ + operator T*() const { return Get(); } + + /** + * Dereferences the stored object. + * + * Note: **Not thread-safe.** + */ + T* operator->() const { return Get(); } + T& operator*() const { return *Get(); } + + template + BasicCrossThreadPersistent + To() const { + using OtherBasicCrossThreadPersistent = + BasicCrossThreadPersistent; + PersistentRegionLock guard; + return OtherBasicCrossThreadPersistent( + typename OtherBasicCrossThreadPersistent::UnsafeCtorTag(), + static_cast(Get())); + } + + template ::IsStrongPersistent::value>::type> + BasicCrossThreadPersistent + Lock() const { + return BasicCrossThreadPersistent< + U, internal::StrongCrossThreadPersistentPolicy>(*this); + } + + private: + static bool IsValid(const void* ptr) { + return ptr && ptr != kSentinelPointer; + } + + static void Trace(Visitor* v, const void* ptr) { + const auto* handle = static_cast(ptr); + v->TraceRoot(*handle, handle->Location()); + } + + void Assign(T* ptr) { + const void* old_value = GetValue(); + if (IsValid(old_value)) { + PersistentRegionLock guard; + old_value = GetValue(); + // The fast path check (IsValid()) does not acquire the lock. Reload + // the value to ensure the reference has not been cleared. + if (IsValid(old_value)) { + CrossThreadPersistentRegion& region = + this->GetPersistentRegion(old_value); + if (IsValid(ptr) && (®ion == &this->GetPersistentRegion(ptr))) { + SetValue(ptr); + this->CheckPointer(ptr); + return; + } + region.FreeNode(GetNode()); + SetNode(nullptr); + } else { + CPPGC_DCHECK(!GetNode()); + } + } + SetValue(ptr); + if (!IsValid(ptr)) return; + PersistentRegionLock guard; + SetNode(this->GetPersistentRegion(ptr).AllocateNode(this, &Trace)); + this->CheckPointer(ptr); + } + + void AssignUnsafe(T* ptr) { + PersistentRegionLock::AssertLocked(); + const void* old_value = GetValue(); + if (IsValid(old_value)) { + CrossThreadPersistentRegion& region = + this->GetPersistentRegion(old_value); + if (IsValid(ptr) && (®ion == &this->GetPersistentRegion(ptr))) { + SetValue(ptr); + this->CheckPointer(ptr); + return; + } + region.FreeNode(GetNode()); + SetNode(nullptr); + } + SetValue(ptr); + if (!IsValid(ptr)) return; + SetNode(this->GetPersistentRegion(ptr).AllocateNode(this, &Trace)); + this->CheckPointer(ptr); + } + + void ClearFromGC() const { + if (IsValid(GetValueFromGC())) { + WeaknessPolicy::GetPersistentRegion(GetValueFromGC()) + .FreeNode(GetNodeFromGC()); + CrossThreadPersistentBase::ClearFromGC(); + } + } + + // See Get() for details. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") + T* GetFromGC() const { + return static_cast(const_cast(GetValueFromGC())); + } + + friend class cppgc::Visitor; +}; + +template +struct IsWeak< + BasicCrossThreadPersistent> + : std::true_type {}; + +} // namespace internal + +namespace subtle { + +/** + * **DO NOT USE: Has known caveats, see below.** + * + * CrossThreadPersistent allows retaining objects from threads other than the + * thread the owning heap is operating on. + * + * Known caveats: + * - Does not protect the heap owning an object from terminating. + * - Reaching transitively through the graph is unsupported as objects may be + * moved concurrently on the thread owning the object. + */ +template +using CrossThreadPersistent = internal::BasicCrossThreadPersistent< + T, internal::StrongCrossThreadPersistentPolicy>; + +/** + * **DO NOT USE: Has known caveats, see below.** + * + * CrossThreadPersistent allows weakly retaining objects from threads other than + * the thread the owning heap is operating on. + * + * Known caveats: + * - Does not protect the heap owning an object from terminating. + * - Reaching transitively through the graph is unsupported as objects may be + * moved concurrently on the thread owning the object. + */ +template +using WeakCrossThreadPersistent = internal::BasicCrossThreadPersistent< + T, internal::WeakCrossThreadPersistentPolicy>; + +} // namespace subtle +} // namespace cppgc + +#endif // INCLUDE_CPPGC_CROSS_THREAD_PERSISTENT_H_ diff --git a/libs/android/libnode/include/node/cppgc/custom-space.h b/libs/android/libnode/include/node/cppgc/custom-space.h new file mode 100644 index 00000000..757c4fde --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/custom-space.h @@ -0,0 +1,97 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_CUSTOM_SPACE_H_ +#define INCLUDE_CPPGC_CUSTOM_SPACE_H_ + +#include + +namespace cppgc { + +/** + * Index identifying a custom space. + */ +struct CustomSpaceIndex { + constexpr CustomSpaceIndex(size_t value) : value(value) {} // NOLINT + size_t value; +}; + +/** + * Top-level base class for custom spaces. Users must inherit from CustomSpace + * below. + */ +class CustomSpaceBase { + public: + virtual ~CustomSpaceBase() = default; + virtual CustomSpaceIndex GetCustomSpaceIndex() const = 0; + virtual bool IsCompactable() const = 0; +}; + +/** + * Base class custom spaces should directly inherit from. The class inheriting + * from `CustomSpace` must define `kSpaceIndex` as unique space index. These + * indices need for form a sequence starting at 0. + * + * Example: + * \code + * class CustomSpace1 : public CustomSpace { + * public: + * static constexpr CustomSpaceIndex kSpaceIndex = 0; + * }; + * class CustomSpace2 : public CustomSpace { + * public: + * static constexpr CustomSpaceIndex kSpaceIndex = 1; + * }; + * \endcode + */ +template +class CustomSpace : public CustomSpaceBase { + public: + /** + * Compaction is only supported on spaces that manually manage slots + * recording. + */ + static constexpr bool kSupportsCompaction = false; + + CustomSpaceIndex GetCustomSpaceIndex() const final { + return ConcreteCustomSpace::kSpaceIndex; + } + bool IsCompactable() const final { + return ConcreteCustomSpace::kSupportsCompaction; + } +}; + +/** + * User-overridable trait that allows pinning types to custom spaces. + */ +template +struct SpaceTrait { + using Space = void; +}; + +namespace internal { + +template +struct IsAllocatedOnCompactableSpaceImpl { + static constexpr bool value = CustomSpace::kSupportsCompaction; +}; + +template <> +struct IsAllocatedOnCompactableSpaceImpl { + // Non-custom spaces are by default not compactable. + static constexpr bool value = false; +}; + +template +struct IsAllocatedOnCompactableSpace { + public: + static constexpr bool value = + IsAllocatedOnCompactableSpaceImpl::Space>::value; +}; + +} // namespace internal + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_CUSTOM_SPACE_H_ diff --git a/libs/android/libnode/include/node/cppgc/default-platform.h b/libs/android/libnode/include/node/cppgc/default-platform.h new file mode 100644 index 00000000..2ccdeddd --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/default-platform.h @@ -0,0 +1,75 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_DEFAULT_PLATFORM_H_ +#define INCLUDE_CPPGC_DEFAULT_PLATFORM_H_ + +#include +#include + +#include "cppgc/platform.h" +#include "libplatform/libplatform.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +/** + * Platform provided by cppgc. Uses V8's DefaultPlatform provided by + * libplatform internally. Exception: `GetForegroundTaskRunner()`, see below. + */ +class V8_EXPORT DefaultPlatform : public Platform { + public: + /** + * Use this method instead of 'cppgc::InitializeProcess' when using + * 'cppgc::DefaultPlatform'. 'cppgc::DefaultPlatform::InitializeProcess' + * will initialize cppgc and v8 if needed (for non-standalone builds). + * + * \param platform DefaultPlatform instance used to initialize cppgc/v8. + */ + static void InitializeProcess(DefaultPlatform* platform); + + using IdleTaskSupport = v8::platform::IdleTaskSupport; + explicit DefaultPlatform( + int thread_pool_size = 0, + IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled, + std::unique_ptr tracing_controller = {}) + : v8_platform_(v8::platform::NewDefaultPlatform( + thread_pool_size, idle_task_support, + v8::platform::InProcessStackDumping::kDisabled, + std::move(tracing_controller))) {} + + cppgc::PageAllocator* GetPageAllocator() override { + return v8_platform_->GetPageAllocator(); + } + + double MonotonicallyIncreasingTime() override { + return v8_platform_->MonotonicallyIncreasingTime(); + } + + std::shared_ptr GetForegroundTaskRunner() override { + // V8's default platform creates a new task runner when passed the + // `v8::Isolate` pointer the first time. For non-default platforms this will + // require getting the appropriate task runner. + return v8_platform_->GetForegroundTaskRunner(kNoIsolate); + } + + std::unique_ptr PostJob( + cppgc::TaskPriority priority, + std::unique_ptr job_task) override { + return v8_platform_->PostJob(priority, std::move(job_task)); + } + + TracingController* GetTracingController() override { + return v8_platform_->GetTracingController(); + } + + protected: + static constexpr v8::Isolate* kNoIsolate = nullptr; + + std::unique_ptr v8_platform_; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_DEFAULT_PLATFORM_H_ diff --git a/libs/android/libnode/include/node/cppgc/ephemeron-pair.h b/libs/android/libnode/include/node/cppgc/ephemeron-pair.h new file mode 100644 index 00000000..e16cf1f0 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/ephemeron-pair.h @@ -0,0 +1,30 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_EPHEMERON_PAIR_H_ +#define INCLUDE_CPPGC_EPHEMERON_PAIR_H_ + +#include "cppgc/liveness-broker.h" +#include "cppgc/member.h" + +namespace cppgc { + +/** + * An ephemeron pair is used to conditionally retain an object. + * The `value` will be kept alive only if the `key` is alive. + */ +template +struct EphemeronPair { + EphemeronPair(K* k, V* v) : key(k), value(v) {} + WeakMember key; + Member value; + + void ClearValueIfKeyIsDead(const LivenessBroker& broker) { + if (!broker.IsHeapObjectAlive(key)) value = nullptr; + } +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_EPHEMERON_PAIR_H_ diff --git a/libs/android/libnode/include/node/cppgc/explicit-management.h b/libs/android/libnode/include/node/cppgc/explicit-management.h new file mode 100644 index 00000000..cdb6af48 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/explicit-management.h @@ -0,0 +1,82 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_EXPLICIT_MANAGEMENT_H_ +#define INCLUDE_CPPGC_EXPLICIT_MANAGEMENT_H_ + +#include + +#include "cppgc/allocation.h" +#include "cppgc/internal/logging.h" +#include "cppgc/type-traits.h" + +namespace cppgc { + +class HeapHandle; + +namespace internal { + +V8_EXPORT void FreeUnreferencedObject(HeapHandle&, void*); +V8_EXPORT bool Resize(void*, size_t); + +} // namespace internal + +namespace subtle { + +/** + * Informs the garbage collector that `object` can be immediately reclaimed. The + * destructor may not be invoked immediately but only on next garbage + * collection. + * + * It is up to the embedder to guarantee that no other object holds a reference + * to `object` after calling `FreeUnreferencedObject()`. In case such a + * reference exists, it's use results in a use-after-free. + * + * To aid in using the API, `FreeUnreferencedObject()` may be called from + * destructors on objects that would be reclaimed in the same garbage collection + * cycle. + * + * \param heap_handle The corresponding heap. + * \param object Reference to an object that is of type `GarbageCollected` and + * should be immediately reclaimed. + */ +template +void FreeUnreferencedObject(HeapHandle& heap_handle, T& object) { + static_assert(IsGarbageCollectedTypeV, + "Object must be of type GarbageCollected."); + internal::FreeUnreferencedObject(heap_handle, &object); +} + +/** + * Tries to resize `object` of type `T` with additional bytes on top of + * sizeof(T). Resizing is only useful with trailing inlined storage, see e.g. + * `MakeGarbageCollected(AllocationHandle&, AdditionalBytes)`. + * + * `Resize()` performs growing or shrinking as needed and may skip the operation + * for internal reasons, see return value. + * + * It is up to the embedder to guarantee that in case of shrinking a larger + * object down, the reclaimed area is not used anymore. Any subsequent use + * results in a use-after-free. + * + * The `object` must be live when calling `Resize()`. + * + * \param object Reference to an object that is of type `GarbageCollected` and + * should be resized. + * \param additional_bytes Bytes in addition to sizeof(T) that the object should + * provide. + * \returns true when the operation was successful and the result can be relied + * on, and false otherwise. + */ +template +bool Resize(T& object, AdditionalBytes additional_bytes) { + static_assert(IsGarbageCollectedTypeV, + "Object must be of type GarbageCollected."); + return internal::Resize(&object, sizeof(T) + additional_bytes.value); +} + +} // namespace subtle +} // namespace cppgc + +#endif // INCLUDE_CPPGC_EXPLICIT_MANAGEMENT_H_ diff --git a/libs/android/libnode/include/node/cppgc/garbage-collected.h b/libs/android/libnode/include/node/cppgc/garbage-collected.h new file mode 100644 index 00000000..a3839e1b --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/garbage-collected.h @@ -0,0 +1,117 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_GARBAGE_COLLECTED_H_ +#define INCLUDE_CPPGC_GARBAGE_COLLECTED_H_ + +#include + +#include "cppgc/internal/api-constants.h" +#include "cppgc/platform.h" +#include "cppgc/trace-trait.h" +#include "cppgc/type-traits.h" + +namespace cppgc { + +class Visitor; + +namespace internal { + +class GarbageCollectedBase { + public: + // Must use MakeGarbageCollected. + void* operator new(size_t) = delete; + void* operator new[](size_t) = delete; + // The garbage collector is taking care of reclaiming the object. Also, + // virtual destructor requires an unambiguous, accessible 'operator delete'. + void operator delete(void*) { +#ifdef V8_ENABLE_CHECKS + internal::Abort(); +#endif // V8_ENABLE_CHECKS + } + void operator delete[](void*) = delete; + + protected: + GarbageCollectedBase() = default; +}; + +} // namespace internal + +/** + * Base class for managed objects. Only descendent types of `GarbageCollected` + * can be constructed using `MakeGarbageCollected()`. Must be inherited from as + * left-most base class. + * + * Types inheriting from GarbageCollected must provide a method of + * signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed + * pointers to the visitor and delegates to garbage-collected base classes. + * The method must be virtual if the type is not directly a child of + * GarbageCollected and marked as final. + * + * \code + * // Example using final class. + * class FinalType final : public GarbageCollected { + * public: + * void Trace(cppgc::Visitor* visitor) const { + * // Dispatch using visitor->Trace(...); + * } + * }; + * + * // Example using non-final base class. + * class NonFinalBase : public GarbageCollected { + * public: + * virtual void Trace(cppgc::Visitor*) const {} + * }; + * + * class FinalChild final : public NonFinalBase { + * public: + * void Trace(cppgc::Visitor* visitor) const final { + * // Dispatch using visitor->Trace(...); + * NonFinalBase::Trace(visitor); + * } + * }; + * \endcode + */ +template +class GarbageCollected : public internal::GarbageCollectedBase { + public: + using IsGarbageCollectedTypeMarker = void; + using ParentMostGarbageCollectedType = T; + + protected: + GarbageCollected() = default; +}; + +/** + * Base class for managed mixin objects. Such objects cannot be constructed + * directly but must be mixed into the inheritance hierarchy of a + * GarbageCollected object. + * + * Types inheriting from GarbageCollectedMixin must override a virtual method + * of signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed + * pointers to the visitor and delegates to base classes. + * + * \code + * class Mixin : public GarbageCollectedMixin { + * public: + * void Trace(cppgc::Visitor* visitor) const override { + * // Dispatch using visitor->Trace(...); + * } + * }; + * \endcode + */ +class GarbageCollectedMixin : public internal::GarbageCollectedBase { + public: + using IsGarbageCollectedMixinTypeMarker = void; + + /** + * This Trace method must be overriden by objects inheriting from + * GarbageCollectedMixin. + */ + virtual void Trace(cppgc::Visitor*) const {} +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_GARBAGE_COLLECTED_H_ diff --git a/libs/android/libnode/include/node/cppgc/heap-consistency.h b/libs/android/libnode/include/node/cppgc/heap-consistency.h new file mode 100644 index 00000000..8e603d5d --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/heap-consistency.h @@ -0,0 +1,253 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_HEAP_CONSISTENCY_H_ +#define INCLUDE_CPPGC_HEAP_CONSISTENCY_H_ + +#include + +#include "cppgc/internal/write-barrier.h" +#include "cppgc/macros.h" +#include "cppgc/trace-trait.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class HeapHandle; + +namespace subtle { + +/** + * **DO NOT USE: Use the appropriate managed types.** + * + * Consistency helpers that aid in maintaining a consistent internal state of + * the garbage collector. + */ +class HeapConsistency final { + public: + using WriteBarrierParams = internal::WriteBarrier::Params; + using WriteBarrierType = internal::WriteBarrier::Type; + + /** + * Gets the required write barrier type for a specific write. + * + * \param slot Slot containing the pointer to the object. The slot itself + * must reside in an object that has been allocated using + * `MakeGarbageCollected()`. + * \param value The pointer to the object. May be an interior pointer to an + * interface of the actual object. + * \param params Parameters that may be used for actual write barrier calls. + * Only filled if return value indicates that a write barrier is needed. The + * contents of the `params` are an implementation detail. + * \returns whether a write barrier is needed and which barrier to invoke. + */ + static V8_INLINE WriteBarrierType GetWriteBarrierType( + const void* slot, const void* value, WriteBarrierParams& params) { + return internal::WriteBarrier::GetWriteBarrierType(slot, value, params); + } + + /** + * Gets the required write barrier type for a specific write. + * + * \param slot Slot to some part of an object. The object must not necessarily + have been allocated using `MakeGarbageCollected()` but can also live + off-heap or on stack. + * \param params Parameters that may be used for actual write barrier calls. + * Only filled if return value indicates that a write barrier is needed. The + * contents of the `params` are an implementation detail. + * \param callback Callback returning the corresponding heap handle. The + * callback is only invoked if the heap cannot otherwise be figured out. The + * callback must not allocate. + * \returns whether a write barrier is needed and which barrier to invoke. + */ + template + static V8_INLINE WriteBarrierType + GetWriteBarrierType(const void* slot, WriteBarrierParams& params, + HeapHandleCallback callback) { + return internal::WriteBarrier::GetWriteBarrierType(slot, params, callback); + } + + /** + * Gets the required write barrier type for a specific write. + * This version is meant to be used in conjunction with with a marking write + * barrier barrier which doesn't consider the slot. + * + * \param value The pointer to the object. May be an interior pointer to an + * interface of the actual object. + * \param params Parameters that may be used for actual write barrier calls. + * Only filled if return value indicates that a write barrier is needed. The + * contents of the `params` are an implementation detail. + * \returns whether a write barrier is needed and which barrier to invoke. + */ + static V8_INLINE WriteBarrierType + GetWriteBarrierType(const void* value, WriteBarrierParams& params) { + return internal::WriteBarrier::GetWriteBarrierType(value, params); + } + + /** + * Conservative Dijkstra-style write barrier that processes an object if it + * has not yet been processed. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param object The pointer to the object. May be an interior pointer to a + * an interface of the actual object. + */ + static V8_INLINE void DijkstraWriteBarrier(const WriteBarrierParams& params, + const void* object) { + internal::WriteBarrier::DijkstraMarkingBarrier(params, object); + } + + /** + * Conservative Dijkstra-style write barrier that processes a range of + * elements if they have not yet been processed. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param first_element Pointer to the first element that should be processed. + * The slot itself must reside in an object that has been allocated using + * `MakeGarbageCollected()`. + * \param element_size Size of the element in bytes. + * \param number_of_elements Number of elements that should be processed, + * starting with `first_element`. + * \param trace_callback The trace callback that should be invoked for each + * element if necessary. + */ + static V8_INLINE void DijkstraWriteBarrierRange( + const WriteBarrierParams& params, const void* first_element, + size_t element_size, size_t number_of_elements, + TraceCallback trace_callback) { + internal::WriteBarrier::DijkstraMarkingBarrierRange( + params, first_element, element_size, number_of_elements, + trace_callback); + } + + /** + * Steele-style write barrier that re-processes an object if it has already + * been processed. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param object The pointer to the object which must point to an object that + * has been allocated using `MakeGarbageCollected()`. Interior pointers are + * not supported. + */ + static V8_INLINE void SteeleWriteBarrier(const WriteBarrierParams& params, + const void* object) { + internal::WriteBarrier::SteeleMarkingBarrier(params, object); + } + + /** + * Generational barrier for maintaining consistency when running with multiple + * generations. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param slot Slot containing the pointer to the object. The slot itself + * must reside in an object that has been allocated using + * `MakeGarbageCollected()`. + */ + static V8_INLINE void GenerationalBarrier(const WriteBarrierParams& params, + const void* slot) { + internal::WriteBarrier::GenerationalBarrier(params, slot); + } + + private: + HeapConsistency() = delete; +}; + +/** + * Disallows garbage collection finalizations. Any garbage collection triggers + * result in a crash when in this scope. + * + * Note that the garbage collector already covers paths that can lead to garbage + * collections, so user code does not require checking + * `IsGarbageCollectionAllowed()` before allocations. + */ +class V8_EXPORT V8_NODISCARD DisallowGarbageCollectionScope final { + CPPGC_STACK_ALLOCATED(); + + public: + /** + * \returns whether garbage collections are currently allowed. + */ + static bool IsGarbageCollectionAllowed(HeapHandle& heap_handle); + + /** + * Enters a disallow garbage collection scope. Must be paired with `Leave()`. + * Prefer a scope instance of `DisallowGarbageCollectionScope`. + * + * \param heap_handle The corresponding heap. + */ + static void Enter(HeapHandle& heap_handle); + + /** + * Leaves a disallow garbage collection scope. Must be paired with `Enter()`. + * Prefer a scope instance of `DisallowGarbageCollectionScope`. + * + * \param heap_handle The corresponding heap. + */ + static void Leave(HeapHandle& heap_handle); + + /** + * Constructs a scoped object that automatically enters and leaves a disallow + * garbage collection scope based on its lifetime. + * + * \param heap_handle The corresponding heap. + */ + explicit DisallowGarbageCollectionScope(HeapHandle& heap_handle); + ~DisallowGarbageCollectionScope(); + + DisallowGarbageCollectionScope(const DisallowGarbageCollectionScope&) = + delete; + DisallowGarbageCollectionScope& operator=( + const DisallowGarbageCollectionScope&) = delete; + + private: + HeapHandle& heap_handle_; +}; + +/** + * Avoids invoking garbage collection finalizations. Already running garbage + * collection phase are unaffected by this scope. + * + * Should only be used temporarily as the scope has an impact on memory usage + * and follow up garbage collections. + */ +class V8_EXPORT V8_NODISCARD NoGarbageCollectionScope final { + CPPGC_STACK_ALLOCATED(); + + public: + /** + * Enters a no garbage collection scope. Must be paired with `Leave()`. Prefer + * a scope instance of `NoGarbageCollectionScope`. + * + * \param heap_handle The corresponding heap. + */ + static void Enter(HeapHandle& heap_handle); + + /** + * Leaves a no garbage collection scope. Must be paired with `Enter()`. Prefer + * a scope instance of `NoGarbageCollectionScope`. + * + * \param heap_handle The corresponding heap. + */ + static void Leave(HeapHandle& heap_handle); + + /** + * Constructs a scoped object that automatically enters and leaves a no + * garbage collection scope based on its lifetime. + * + * \param heap_handle The corresponding heap. + */ + explicit NoGarbageCollectionScope(HeapHandle& heap_handle); + ~NoGarbageCollectionScope(); + + NoGarbageCollectionScope(const NoGarbageCollectionScope&) = delete; + NoGarbageCollectionScope& operator=(const NoGarbageCollectionScope&) = delete; + + private: + HeapHandle& heap_handle_; +}; + +} // namespace subtle +} // namespace cppgc + +#endif // INCLUDE_CPPGC_HEAP_CONSISTENCY_H_ diff --git a/libs/android/libnode/include/node/cppgc/heap-state.h b/libs/android/libnode/include/node/cppgc/heap-state.h new file mode 100644 index 00000000..3fd6b54a --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/heap-state.h @@ -0,0 +1,70 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_HEAP_STATE_H_ +#define INCLUDE_CPPGC_HEAP_STATE_H_ + +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class HeapHandle; + +namespace subtle { + +/** + * Helpers to peek into heap-internal state. + */ +class V8_EXPORT HeapState final { + public: + /** + * Returns whether the garbage collector is marking. This API is experimental + * and is expected to be removed in future. + * + * \param heap_handle The corresponding heap. + * \returns true if the garbage collector is currently marking, and false + * otherwise. + */ + static bool IsMarking(const HeapHandle& heap_handle); + + /* + * Returns whether the garbage collector is sweeping. This API is experimental + * and is expected to be removed in future. + * + * \param heap_handle The corresponding heap. + * \returns true if the garbage collector is currently sweeping, and false + * otherwise. + */ + static bool IsSweeping(const HeapHandle& heap_handle); + + /** + * Returns whether the garbage collector is in the atomic pause, i.e., the + * mutator is stopped from running. This API is experimental and is expected + * to be removed in future. + * + * \param heap_handle The corresponding heap. + * \returns true if the garbage collector is currently in the atomic pause, + * and false otherwise. + */ + static bool IsInAtomicPause(const HeapHandle& heap_handle); + + /** + * Returns whether the last garbage collection was finalized conservatively + * (i.e., with a non-empty stack). This API is experimental and is expected to + * be removed in future. + * + * \param heap_handle The corresponding heap. + * \returns true if the last garbage collection was finalized conservatively, + * and false otherwise. + */ + static bool PreviousGCWasConservative(const HeapHandle& heap_handle); + + private: + HeapState() = delete; +}; + +} // namespace subtle +} // namespace cppgc + +#endif // INCLUDE_CPPGC_HEAP_STATE_H_ diff --git a/libs/android/libnode/include/node/cppgc/heap-statistics.h b/libs/android/libnode/include/node/cppgc/heap-statistics.h new file mode 100644 index 00000000..8e626596 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/heap-statistics.h @@ -0,0 +1,120 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_HEAP_STATISTICS_H_ +#define INCLUDE_CPPGC_HEAP_STATISTICS_H_ + +#include +#include +#include +#include + +namespace cppgc { + +/** + * `HeapStatistics` contains memory consumption and utilization statistics for a + * cppgc heap. + */ +struct HeapStatistics final { + /** + * Specifies the detail level of the heap statistics. Brief statistics contain + * only the top-level allocated and used memory statistics for the entire + * heap. Detailed statistics also contain a break down per space and page, as + * well as freelist statistics and object type histograms. Note that used + * memory reported by brief statistics and detailed statistics might differ + * slightly. + */ + enum DetailLevel : uint8_t { + kBrief, + kDetailed, + }; + + /** + * Object statistics for a single type. + */ + struct ObjectStatsEntry { + /** + * Number of allocated bytes. + */ + size_t allocated_bytes; + /** + * Number of allocated objects. + */ + size_t object_count; + }; + + /** + * Page granularity statistics. For each page the statistics record the + * allocated memory size and overall used memory size for the page. + */ + struct PageStatistics { + /** Overall committed amount of memory for the page. */ + size_t committed_size_bytes = 0; + /** Resident amount of memory held by the page. */ + size_t resident_size_bytes = 0; + /** Amount of memory actually used on the page. */ + size_t used_size_bytes = 0; + /** Statistics for object allocated on the page. Filled only when + * NameProvider::HideInternalNames() is false. */ + std::vector object_statistics; + }; + + /** + * Statistics of the freelist (used only in non-large object spaces). For + * each bucket in the freelist the statistics record the bucket size, the + * number of freelist entries in the bucket, and the overall allocated memory + * consumed by these freelist entries. + */ + struct FreeListStatistics { + /** bucket sizes in the freelist. */ + std::vector bucket_size; + /** number of freelist entries per bucket. */ + std::vector free_count; + /** memory size consumed by freelist entries per size. */ + std::vector free_size; + }; + + /** + * Space granularity statistics. For each space the statistics record the + * space name, the amount of allocated memory and overall used memory for the + * space. The statistics also contain statistics for each of the space's + * pages, its freelist and the objects allocated on the space. + */ + struct SpaceStatistics { + /** The space name */ + std::string name; + /** Overall committed amount of memory for the heap. */ + size_t committed_size_bytes = 0; + /** Resident amount of memory held by the heap. */ + size_t resident_size_bytes = 0; + /** Amount of memory actually used on the space. */ + size_t used_size_bytes = 0; + /** Statistics for each of the pages in the space. */ + std::vector page_stats; + /** Statistics for the freelist of the space. */ + FreeListStatistics free_list_stats; + }; + + /** Overall committed amount of memory for the heap. */ + size_t committed_size_bytes = 0; + /** Resident amount of memory help by the heap. */ + size_t resident_size_bytes = 0; + /** Amount of memory actually used on the heap. */ + size_t used_size_bytes = 0; + /** Detail level of this HeapStatistics. */ + DetailLevel detail_level; + + /** Statistics for each of the spaces in the heap. Filled only when + * `detail_level` is `DetailLevel::kDetailed`. */ + std::vector space_stats; + + /** + * Vector of `cppgc::GarbageCollected` type names. + */ + std::vector type_names; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_HEAP_STATISTICS_H_ diff --git a/libs/android/libnode/include/node/cppgc/heap.h b/libs/android/libnode/include/node/cppgc/heap.h new file mode 100644 index 00000000..136c4fb4 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/heap.h @@ -0,0 +1,201 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_HEAP_H_ +#define INCLUDE_CPPGC_HEAP_H_ + +#include +#include +#include +#include + +#include "cppgc/common.h" +#include "cppgc/custom-space.h" +#include "cppgc/platform.h" +#include "v8config.h" // NOLINT(build/include_directory) + +/** + * cppgc - A C++ garbage collection library. + */ +namespace cppgc { + +class AllocationHandle; + +/** + * Implementation details of cppgc. Those details are considered internal and + * may change at any point in time without notice. Users should never rely on + * the contents of this namespace. + */ +namespace internal { +class Heap; +} // namespace internal + +/** + * Used for additional heap APIs. + */ +class HeapHandle; + +class V8_EXPORT Heap { + public: + /** + * Specifies the stack state the embedder is in. + */ + using StackState = EmbedderStackState; + + /** + * Specifies whether conservative stack scanning is supported. + */ + enum class StackSupport : uint8_t { + /** + * Conservative stack scan is supported. + */ + kSupportsConservativeStackScan, + /** + * Conservative stack scan is not supported. Embedders may use this option + * when using custom infrastructure that is unsupported by the library. + */ + kNoConservativeStackScan, + }; + + /** + * Specifies supported marking types + */ + enum class MarkingType : uint8_t { + /** + * Atomic stop-the-world marking. This option does not require any write + * barriers but is the most intrusive in terms of jank. + */ + kAtomic, + /** + * Incremental marking, i.e. interleave marking is the rest of the + * application on the same thread. + */ + kIncremental, + /** + * Incremental and concurrent marking. + */ + kIncrementalAndConcurrent + }; + + /** + * Specifies supported sweeping types + */ + enum class SweepingType : uint8_t { + /** + * Atomic stop-the-world sweeping. All of sweeping is performed at once. + */ + kAtomic, + /** + * Incremental and concurrent sweeping. Sweeping is split and interleaved + * with the rest of the application. + */ + kIncrementalAndConcurrent + }; + + /** + * Constraints for a Heap setup. + */ + struct ResourceConstraints { + /** + * Allows the heap to grow to some initial size in bytes before triggering + * garbage collections. This is useful when it is known that applications + * need a certain minimum heap to run to avoid repeatedly invoking the + * garbage collector when growing the heap. + */ + size_t initial_heap_size_bytes = 0; + }; + + /** + * Options specifying Heap properties (e.g. custom spaces) when initializing a + * heap through `Heap::Create()`. + */ + struct HeapOptions { + /** + * Creates reasonable defaults for instantiating a Heap. + * + * \returns the HeapOptions that can be passed to `Heap::Create()`. + */ + static HeapOptions Default() { return {}; } + + /** + * Custom spaces added to heap are required to have indices forming a + * numbered sequence starting at 0, i.e., their `kSpaceIndex` must + * correspond to the index they reside in the vector. + */ + std::vector> custom_spaces; + + /** + * Specifies whether conservative stack scan is supported. When conservative + * stack scan is not supported, the collector may try to invoke + * garbage collections using non-nestable task, which are guaranteed to have + * no interesting stack, through the provided Platform. If such tasks are + * not supported by the Platform, the embedder must take care of invoking + * the GC through `ForceGarbageCollectionSlow()`. + */ + StackSupport stack_support = StackSupport::kSupportsConservativeStackScan; + + /** + * Specifies which types of marking are supported by the heap. + */ + MarkingType marking_support = MarkingType::kIncrementalAndConcurrent; + + /** + * Specifies which types of sweeping are supported by the heap. + */ + SweepingType sweeping_support = SweepingType::kIncrementalAndConcurrent; + + /** + * Resource constraints specifying various properties that the internal + * GC scheduler follows. + */ + ResourceConstraints resource_constraints; + }; + + /** + * Creates a new heap that can be used for object allocation. + * + * \param platform implemented and provided by the embedder. + * \param options HeapOptions specifying various properties for the Heap. + * \returns a new Heap instance. + */ + static std::unique_ptr Create( + std::shared_ptr platform, + HeapOptions options = HeapOptions::Default()); + + virtual ~Heap() = default; + + /** + * Forces garbage collection. + * + * \param source String specifying the source (or caller) triggering a + * forced garbage collection. + * \param reason String specifying the reason for the forced garbage + * collection. + * \param stack_state The embedder stack state, see StackState. + */ + void ForceGarbageCollectionSlow( + const char* source, const char* reason, + StackState stack_state = StackState::kMayContainHeapPointers); + + /** + * \returns the opaque handle for allocating objects using + * `MakeGarbageCollected()`. + */ + AllocationHandle& GetAllocationHandle(); + + /** + * \returns the opaque heap handle which may be used to refer to this heap in + * other APIs. Valid as long as the underlying `Heap` is alive. + */ + HeapHandle& GetHeapHandle(); + + private: + Heap() = default; + + friend class internal::Heap; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_HEAP_H_ diff --git a/libs/android/libnode/include/node/cppgc/liveness-broker.h b/libs/android/libnode/include/node/cppgc/liveness-broker.h new file mode 100644 index 00000000..c94eef0d --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/liveness-broker.h @@ -0,0 +1,77 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_LIVENESS_BROKER_H_ +#define INCLUDE_CPPGC_LIVENESS_BROKER_H_ + +#include "cppgc/heap.h" +#include "cppgc/member.h" +#include "cppgc/trace-trait.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +namespace internal { +class LivenessBrokerFactory; +} // namespace internal + +/** + * The broker is passed to weak callbacks to allow (temporarily) querying + * the liveness state of an object. References to non-live objects must be + * cleared when `IsHeapObjectAlive()` returns false. + * + * \code + * class GCedWithCustomWeakCallback final + * : public GarbageCollected { + * public: + * UntracedMember bar; + * + * void CustomWeakCallbackMethod(const LivenessBroker& broker) { + * if (!broker.IsHeapObjectAlive(bar)) + * bar = nullptr; + * } + * + * void Trace(cppgc::Visitor* visitor) const { + * visitor->RegisterWeakCallbackMethod< + * GCedWithCustomWeakCallback, + * &GCedWithCustomWeakCallback::CustomWeakCallbackMethod>(this); + * } + * }; + * \endcode + */ +class V8_EXPORT LivenessBroker final { + public: + template + bool IsHeapObjectAlive(const T* object) const { + // nullptr objects are considered alive to allow weakness to be used from + // stack while running into a conservative GC. Treating nullptr as dead + // would mean that e.g. custom collectins could not be strongified on stack. + return !object || + IsHeapObjectAliveImpl( + TraceTrait::GetTraceDescriptor(object).base_object_payload); + } + + template + bool IsHeapObjectAlive(const WeakMember& weak_member) const { + return (weak_member != kSentinelPointer) && + IsHeapObjectAlive(weak_member.Get()); + } + + template + bool IsHeapObjectAlive(const UntracedMember& untraced_member) const { + return (untraced_member != kSentinelPointer) && + IsHeapObjectAlive(untraced_member.Get()); + } + + private: + LivenessBroker() = default; + + bool IsHeapObjectAliveImpl(const void*) const; + + friend class internal::LivenessBrokerFactory; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_LIVENESS_BROKER_H_ diff --git a/libs/android/libnode/include/node/cppgc/macros.h b/libs/android/libnode/include/node/cppgc/macros.h new file mode 100644 index 00000000..030f397e --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/macros.h @@ -0,0 +1,26 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_MACROS_H_ +#define INCLUDE_CPPGC_MACROS_H_ + +#include + +#include "cppgc/internal/compiler-specific.h" + +namespace cppgc { + +// Use if the object is only stack allocated. +#define CPPGC_STACK_ALLOCATED() \ + public: \ + using IsStackAllocatedTypeMarker CPPGC_UNUSED = int; \ + \ + private: \ + void* operator new(size_t) = delete; \ + void* operator new(size_t, void*) = delete; \ + static_assert(true, "Force semicolon.") + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_MACROS_H_ diff --git a/libs/android/libnode/include/node/cppgc/member.h b/libs/android/libnode/include/node/cppgc/member.h new file mode 100644 index 00000000..38105b8e --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/member.h @@ -0,0 +1,288 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_MEMBER_H_ +#define INCLUDE_CPPGC_MEMBER_H_ + +#include +#include +#include + +#include "cppgc/internal/pointer-policies.h" +#include "cppgc/sentinel-pointer.h" +#include "cppgc/type-traits.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class Visitor; + +namespace internal { + +// MemberBase always refers to the object as const object and defers to +// BasicMember on casting to the right type as needed. +class MemberBase { + protected: + struct AtomicInitializerTag {}; + + MemberBase() = default; + explicit MemberBase(const void* value) : raw_(value) {} + MemberBase(const void* value, AtomicInitializerTag) { SetRawAtomic(value); } + + const void** GetRawSlot() const { return &raw_; } + const void* GetRaw() const { return raw_; } + void SetRaw(void* value) { raw_ = value; } + + const void* GetRawAtomic() const { + return reinterpret_cast*>(&raw_)->load( + std::memory_order_relaxed); + } + void SetRawAtomic(const void* value) { + reinterpret_cast*>(&raw_)->store( + value, std::memory_order_relaxed); + } + + void ClearFromGC() const { raw_ = nullptr; } + + private: + mutable const void* raw_ = nullptr; +}; + +// The basic class from which all Member classes are 'generated'. +template +class BasicMember final : private MemberBase, private CheckingPolicy { + public: + using PointeeType = T; + + constexpr BasicMember() = default; + constexpr BasicMember(std::nullptr_t) {} // NOLINT + BasicMember(SentinelPointer s) : MemberBase(s) {} // NOLINT + BasicMember(T* raw) : MemberBase(raw) { // NOLINT + InitializingWriteBarrier(); + this->CheckPointer(Get()); + } + BasicMember(T& raw) : BasicMember(&raw) {} // NOLINT + // Atomic ctor. Using the AtomicInitializerTag forces BasicMember to + // initialize using atomic assignments. This is required for preventing + // data races with concurrent marking. + using AtomicInitializerTag = MemberBase::AtomicInitializerTag; + BasicMember(std::nullptr_t, AtomicInitializerTag atomic) + : MemberBase(nullptr, atomic) {} + BasicMember(SentinelPointer s, AtomicInitializerTag atomic) + : MemberBase(s, atomic) {} + BasicMember(T* raw, AtomicInitializerTag atomic) : MemberBase(raw, atomic) { + InitializingWriteBarrier(); + this->CheckPointer(Get()); + } + BasicMember(T& raw, AtomicInitializerTag atomic) + : BasicMember(&raw, atomic) {} + // Copy ctor. + BasicMember(const BasicMember& other) : BasicMember(other.Get()) {} + // Allow heterogeneous construction. + template ::value>> + BasicMember( // NOLINT + const BasicMember& other) + : BasicMember(other.Get()) {} + // Move ctor. + BasicMember(BasicMember&& other) noexcept : BasicMember(other.Get()) { + other.Clear(); + } + // Allow heterogeneous move construction. + template ::value>> + BasicMember(BasicMember&& other) noexcept + : BasicMember(other.Get()) { + other.Clear(); + } + // Construction from Persistent. + template ::value>> + BasicMember(const BasicPersistent& p) + : BasicMember(p.Get()) {} + + // Copy assignment. + BasicMember& operator=(const BasicMember& other) { + return operator=(other.Get()); + } + // Allow heterogeneous copy assignment. + template ::value>> + BasicMember& operator=( + const BasicMember& other) { + return operator=(other.Get()); + } + // Move assignment. + BasicMember& operator=(BasicMember&& other) noexcept { + operator=(other.Get()); + other.Clear(); + return *this; + } + // Heterogeneous move assignment. + template ::value>> + BasicMember& operator=(BasicMember&& other) noexcept { + operator=(other.Get()); + other.Clear(); + return *this; + } + // Assignment from Persistent. + template ::value>> + BasicMember& operator=( + const BasicPersistent& + other) { + return operator=(other.Get()); + } + BasicMember& operator=(T* other) { + SetRawAtomic(other); + AssigningWriteBarrier(); + this->CheckPointer(Get()); + return *this; + } + BasicMember& operator=(std::nullptr_t) { + Clear(); + return *this; + } + BasicMember& operator=(SentinelPointer s) { + SetRawAtomic(s); + return *this; + } + + template + void Swap(BasicMember& other) { + T* tmp = Get(); + *this = other; + other = tmp; + } + + explicit operator bool() const { return Get(); } + operator T*() const { return Get(); } + T* operator->() const { return Get(); } + T& operator*() const { return *Get(); } + + // CFI cast exemption to allow passing SentinelPointer through T* and support + // heterogeneous assignments between different Member and Persistent handles + // based on their actual types. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") T* Get() const { + // Executed by the mutator, hence non atomic load. + // + // The const_cast below removes the constness from MemberBase storage. The + // following static_cast re-adds any constness if specified through the + // user-visible template parameter T. + return static_cast(const_cast(MemberBase::GetRaw())); + } + + void Clear() { SetRawAtomic(nullptr); } + + T* Release() { + T* result = Get(); + Clear(); + return result; + } + + const T** GetSlotForTesting() const { + return reinterpret_cast(GetRawSlot()); + } + + private: + const T* GetRawAtomic() const { + return static_cast(MemberBase::GetRawAtomic()); + } + + void InitializingWriteBarrier() const { + WriteBarrierPolicy::InitializingBarrier(GetRawSlot(), GetRaw()); + } + void AssigningWriteBarrier() const { + WriteBarrierPolicy::AssigningBarrier(GetRawSlot(), GetRaw()); + } + + void ClearFromGC() const { MemberBase::ClearFromGC(); } + + T* GetFromGC() const { return Get(); } + + friend class cppgc::Visitor; + template + friend struct cppgc::TraceTrait; +}; + +template +bool operator==(const BasicMember& member1, + const BasicMember& member2) { + return member1.Get() == member2.Get(); +} + +template +bool operator!=(const BasicMember& member1, + const BasicMember& member2) { + return !(member1 == member2); +} + +template +struct IsWeak< + internal::BasicMember> + : std::true_type {}; + +} // namespace internal + +/** + * Members are used in classes to contain strong pointers to other garbage + * collected objects. All Member fields of a class must be traced in the class' + * trace method. + */ +template +using Member = internal::BasicMember; + +/** + * WeakMember is similar to Member in that it is used to point to other garbage + * collected objects. However instead of creating a strong pointer to the + * object, the WeakMember creates a weak pointer, which does not keep the + * pointee alive. Hence if all pointers to to a heap allocated object are weak + * the object will be garbage collected. At the time of GC the weak pointers + * will automatically be set to null. + */ +template +using WeakMember = internal::BasicMember; + +/** + * UntracedMember is a pointer to an on-heap object that is not traced for some + * reason. Do not use this unless you know what you are doing. Keeping raw + * pointers to on-heap objects is prohibited unless used from stack. Pointee + * must be kept alive through other means. + */ +template +using UntracedMember = internal::BasicMember; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_MEMBER_H_ diff --git a/libs/android/libnode/include/node/cppgc/name-provider.h b/libs/android/libnode/include/node/cppgc/name-provider.h new file mode 100644 index 00000000..224dd4b5 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/name-provider.h @@ -0,0 +1,65 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_NAME_PROVIDER_H_ +#define INCLUDE_CPPGC_NAME_PROVIDER_H_ + +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +/** + * NameProvider allows for providing a human-readable name for garbage-collected + * objects. + * + * There's two cases of names to distinguish: + * a. Explicitly specified names via using NameProvider. Such names are always + * preserved in the system. + * b. Internal names that Oilpan infers from a C++ type on the class hierarchy + * of the object. This is not necessarily the type of the actually + * instantiated object. + * + * Depending on the build configuration, Oilpan may hide names, i.e., represent + * them with kHiddenName, of case b. to avoid exposing internal details. + */ +class V8_EXPORT NameProvider { + public: + /** + * Name that is used when hiding internals. + */ + static constexpr const char kHiddenName[] = "InternalNode"; + + /** + * Name that is used in case compiler support is missing for composing a name + * from C++ types. + */ + static constexpr const char kNoNameDeducible[] = ""; + + /** + * Indicating whether internal names are hidden or not. + * + * @returns true if C++ names should be hidden and represented by kHiddenName. + */ + static constexpr bool HideInternalNames() { +#if CPPGC_SUPPORTS_OBJECT_NAMES + return false; +#else // !CPPGC_SUPPORTS_OBJECT_NAMES + return true; +#endif // !CPPGC_SUPPORTS_OBJECT_NAMES + } + + virtual ~NameProvider() = default; + + /** + * Specifies a name for the garbage-collected object. Such names will never + * be hidden, as they are explicitly specified by the user of this API. + * + * @returns a human readable name for the object. + */ + virtual const char* GetHumanReadableName() const = 0; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_NAME_PROVIDER_H_ diff --git a/libs/android/libnode/include/node/cppgc/object-size-trait.h b/libs/android/libnode/include/node/cppgc/object-size-trait.h new file mode 100644 index 00000000..35795596 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/object-size-trait.h @@ -0,0 +1,58 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_OBJECT_SIZE_TRAIT_H_ +#define INCLUDE_CPPGC_OBJECT_SIZE_TRAIT_H_ + +#include + +#include "cppgc/type-traits.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +namespace internal { + +struct V8_EXPORT BaseObjectSizeTrait { + protected: + static size_t GetObjectSizeForGarbageCollected(const void*); + static size_t GetObjectSizeForGarbageCollectedMixin(const void*); +}; + +} // namespace internal + +namespace subtle { + +/** + * Trait specifying how to get the size of an object that was allocated using + * `MakeGarbageCollected()`. Also supports querying the size with an inner + * pointer to a mixin. + */ +template > +struct ObjectSizeTrait; + +template +struct ObjectSizeTrait : cppgc::internal::BaseObjectSizeTrait { + static_assert(sizeof(T), "T must be fully defined"); + static_assert(IsGarbageCollectedTypeV, + "T must be of type GarbageCollected or GarbageCollectedMixin"); + + static size_t GetSize(const T& object) { + return GetObjectSizeForGarbageCollected(&object); + } +}; + +template +struct ObjectSizeTrait : cppgc::internal::BaseObjectSizeTrait { + static_assert(sizeof(T), "T must be fully defined"); + + static size_t GetSize(const T& object) { + return GetObjectSizeForGarbageCollectedMixin(&object); + } +}; + +} // namespace subtle +} // namespace cppgc + +#endif // INCLUDE_CPPGC_OBJECT_SIZE_TRAIT_H_ diff --git a/libs/android/libnode/include/node/cppgc/persistent.h b/libs/android/libnode/include/node/cppgc/persistent.h new file mode 100644 index 00000000..b83a4645 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/persistent.h @@ -0,0 +1,371 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_PERSISTENT_H_ +#define INCLUDE_CPPGC_PERSISTENT_H_ + +#include + +#include "cppgc/internal/persistent-node.h" +#include "cppgc/internal/pointer-policies.h" +#include "cppgc/sentinel-pointer.h" +#include "cppgc/source-location.h" +#include "cppgc/type-traits.h" +#include "cppgc/visitor.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class Visitor; + +namespace internal { + +// PersistentBase always refers to the object as const object and defers to +// BasicPersistent on casting to the right type as needed. +class PersistentBase { + protected: + PersistentBase() = default; + explicit PersistentBase(const void* raw) : raw_(raw) {} + + const void* GetValue() const { return raw_; } + void SetValue(const void* value) { raw_ = value; } + + PersistentNode* GetNode() const { return node_; } + void SetNode(PersistentNode* node) { node_ = node; } + + // Performs a shallow clear which assumes that internal persistent nodes are + // destroyed elsewhere. + void ClearFromGC() const { + raw_ = nullptr; + node_ = nullptr; + } + + protected: + mutable const void* raw_ = nullptr; + mutable PersistentNode* node_ = nullptr; + + friend class PersistentRegion; +}; + +// The basic class from which all Persistent classes are generated. +template +class BasicPersistent final : public PersistentBase, + public LocationPolicy, + private WeaknessPolicy, + private CheckingPolicy { + public: + using typename WeaknessPolicy::IsStrongPersistent; + using PointeeType = T; + + // Null-state/sentinel constructors. + BasicPersistent( // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc) {} + + BasicPersistent(std::nullptr_t, // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc) {} + + BasicPersistent( // NOLINT + SentinelPointer s, const SourceLocation& loc = SourceLocation::Current()) + : PersistentBase(s), LocationPolicy(loc) {} + + // Raw value constructors. + BasicPersistent(T* raw, // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : PersistentBase(raw), LocationPolicy(loc) { + if (!IsValid()) return; + SetNode(WeaknessPolicy::GetPersistentRegion(GetValue()) + .AllocateNode(this, &BasicPersistent::Trace)); + this->CheckPointer(Get()); + } + + BasicPersistent(T& raw, // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(&raw, loc) {} + + // Copy ctor. + BasicPersistent(const BasicPersistent& other, + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(other.Get(), loc) {} + + // Heterogeneous ctor. + template ::value>> + BasicPersistent( + const BasicPersistent& other, + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(other.Get(), loc) {} + + // Move ctor. The heterogeneous move ctor is not supported since e.g. + // persistent can't reuse persistent node from weak persistent. + BasicPersistent( + BasicPersistent&& other, + const SourceLocation& loc = SourceLocation::Current()) noexcept + : PersistentBase(std::move(other)), LocationPolicy(std::move(other)) { + if (!IsValid()) return; + GetNode()->UpdateOwner(this); + other.SetValue(nullptr); + other.SetNode(nullptr); + this->CheckPointer(Get()); + } + + // Constructor from member. + template ::value>> + BasicPersistent(internal::BasicMember + member, + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(member.Get(), loc) {} + + ~BasicPersistent() { Clear(); } + + // Copy assignment. + BasicPersistent& operator=(const BasicPersistent& other) { + return operator=(other.Get()); + } + + template ::value>> + BasicPersistent& operator=( + const BasicPersistent& other) { + return operator=(other.Get()); + } + + // Move assignment. + BasicPersistent& operator=(BasicPersistent&& other) noexcept { + if (this == &other) return *this; + Clear(); + PersistentBase::operator=(std::move(other)); + LocationPolicy::operator=(std::move(other)); + if (!IsValid()) return *this; + GetNode()->UpdateOwner(this); + other.SetValue(nullptr); + other.SetNode(nullptr); + this->CheckPointer(Get()); + return *this; + } + + // Assignment from member. + template ::value>> + BasicPersistent& operator=( + internal::BasicMember + member) { + return operator=(member.Get()); + } + + BasicPersistent& operator=(T* other) { + Assign(other); + return *this; + } + + BasicPersistent& operator=(std::nullptr_t) { + Clear(); + return *this; + } + + BasicPersistent& operator=(SentinelPointer s) { + Assign(s); + return *this; + } + + explicit operator bool() const { return Get(); } + operator T*() const { return Get(); } + T* operator->() const { return Get(); } + T& operator*() const { return *Get(); } + + // CFI cast exemption to allow passing SentinelPointer through T* and support + // heterogeneous assignments between different Member and Persistent handles + // based on their actual types. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") T* Get() const { + // The const_cast below removes the constness from PersistentBase storage. + // The following static_cast re-adds any constness if specified through the + // user-visible template parameter T. + return static_cast(const_cast(GetValue())); + } + + void Clear() { + // Simplified version of `Assign()` to allow calling without a complete type + // `T`. + if (IsValid()) { + WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode()); + SetNode(nullptr); + } + SetValue(nullptr); + } + + T* Release() { + T* result = Get(); + Clear(); + return result; + } + + template + BasicPersistent + To() const { + return BasicPersistent(static_cast(Get())); + } + + private: + static void Trace(Visitor* v, const void* ptr) { + const auto* persistent = static_cast(ptr); + v->TraceRoot(*persistent, persistent->Location()); + } + + bool IsValid() const { + // Ideally, handling kSentinelPointer would be done by the embedder. On the + // other hand, having Persistent aware of it is beneficial since no node + // gets wasted. + return GetValue() != nullptr && GetValue() != kSentinelPointer; + } + + void Assign(T* ptr) { + if (IsValid()) { + if (ptr && ptr != kSentinelPointer) { + // Simply assign the pointer reusing the existing node. + SetValue(ptr); + this->CheckPointer(ptr); + return; + } + WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode()); + SetNode(nullptr); + } + SetValue(ptr); + if (!IsValid()) return; + SetNode(WeaknessPolicy::GetPersistentRegion(GetValue()) + .AllocateNode(this, &BasicPersistent::Trace)); + this->CheckPointer(Get()); + } + + void ClearFromGC() const { + if (IsValid()) { + WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode()); + PersistentBase::ClearFromGC(); + } + } + + // Set Get() for details. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") + T* GetFromGC() const { + return static_cast(const_cast(GetValue())); + } + + friend class cppgc::Visitor; +}; + +template +bool operator==(const BasicPersistent& p1, + const BasicPersistent& p2) { + return p1.Get() == p2.Get(); +} + +template +bool operator!=(const BasicPersistent& p1, + const BasicPersistent& p2) { + return !(p1 == p2); +} + +template +bool operator==(const BasicPersistent& p, + BasicMember + m) { + return p.Get() == m.Get(); +} + +template +bool operator!=(const BasicPersistent& p, + BasicMember + m) { + return !(p == m); +} + +template +bool operator==(BasicMember + m, + const BasicPersistent& p) { + return m.Get() == p.Get(); +} + +template +bool operator!=(BasicMember + m, + const BasicPersistent& p) { + return !(m == p); +} + +template +struct IsWeak> : std::true_type {}; +} // namespace internal + +/** + * Persistent is a way to create a strong pointer from an off-heap object to + * another on-heap object. As long as the Persistent handle is alive the GC will + * keep the object pointed to alive. The Persistent handle is always a GC root + * from the point of view of the GC. Persistent must be constructed and + * destructed in the same thread. + */ +template +using Persistent = + internal::BasicPersistent; + +/** + * WeakPersistent is a way to create a weak pointer from an off-heap object to + * an on-heap object. The pointer is automatically cleared when the pointee gets + * collected. WeakPersistent must be constructed and destructed in the same + * thread. + */ +template +using WeakPersistent = + internal::BasicPersistent; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_PERSISTENT_H_ diff --git a/libs/android/libnode/include/node/cppgc/platform.h b/libs/android/libnode/include/node/cppgc/platform.h new file mode 100644 index 00000000..3276a26b --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/platform.h @@ -0,0 +1,154 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_PLATFORM_H_ +#define INCLUDE_CPPGC_PLATFORM_H_ + +#include + +#include "v8-platform.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +// TODO(v8:10346): Create separate includes for concepts that are not +// V8-specific. +using IdleTask = v8::IdleTask; +using JobHandle = v8::JobHandle; +using JobDelegate = v8::JobDelegate; +using JobTask = v8::JobTask; +using PageAllocator = v8::PageAllocator; +using Task = v8::Task; +using TaskPriority = v8::TaskPriority; +using TaskRunner = v8::TaskRunner; +using TracingController = v8::TracingController; + +/** + * Platform interface used by Heap. Contains allocators and executors. + */ +class V8_EXPORT Platform { + public: + virtual ~Platform() = default; + + /** + * Returns the allocator used by cppgc to allocate its heap and various + * support structures. + */ + virtual PageAllocator* GetPageAllocator() = 0; + + /** + * Monotonically increasing time in seconds from an arbitrary fixed point in + * the past. This function is expected to return at least + * millisecond-precision values. For this reason, + * it is recommended that the fixed point be no further in the past than + * the epoch. + **/ + virtual double MonotonicallyIncreasingTime() = 0; + + /** + * Foreground task runner that should be used by a Heap. + */ + virtual std::shared_ptr GetForegroundTaskRunner() { + return nullptr; + } + + /** + * Posts `job_task` to run in parallel. Returns a `JobHandle` associated with + * the `Job`, which can be joined or canceled. + * This avoids degenerate cases: + * - Calling `CallOnWorkerThread()` for each work item, causing significant + * overhead. + * - Fixed number of `CallOnWorkerThread()` calls that split the work and + * might run for a long time. This is problematic when many components post + * "num cores" tasks and all expect to use all the cores. In these cases, + * the scheduler lacks context to be fair to multiple same-priority requests + * and/or ability to request lower priority work to yield when high priority + * work comes in. + * A canonical implementation of `job_task` looks like: + * \code + * class MyJobTask : public JobTask { + * public: + * MyJobTask(...) : worker_queue_(...) {} + * // JobTask implementation. + * void Run(JobDelegate* delegate) override { + * while (!delegate->ShouldYield()) { + * // Smallest unit of work. + * auto work_item = worker_queue_.TakeWorkItem(); // Thread safe. + * if (!work_item) return; + * ProcessWork(work_item); + * } + * } + * + * size_t GetMaxConcurrency() const override { + * return worker_queue_.GetSize(); // Thread safe. + * } + * }; + * + * // ... + * auto handle = PostJob(TaskPriority::kUserVisible, + * std::make_unique(...)); + * handle->Join(); + * \endcode + * + * `PostJob()` and methods of the returned JobHandle/JobDelegate, must never + * be called while holding a lock that could be acquired by `JobTask::Run()` + * or `JobTask::GetMaxConcurrency()` -- that could result in a deadlock. This + * is because (1) `JobTask::GetMaxConcurrency()` may be invoked while holding + * internal lock (A), hence `JobTask::GetMaxConcurrency()` can only use a lock + * (B) if that lock is *never* held while calling back into `JobHandle` from + * any thread (A=>B/B=>A deadlock) and (2) `JobTask::Run()` or + * `JobTask::GetMaxConcurrency()` may be invoked synchronously from + * `JobHandle` (B=>JobHandle::foo=>B deadlock). + * + * A sufficient `PostJob()` implementation that uses the default Job provided + * in libplatform looks like: + * \code + * std::unique_ptr PostJob( + * TaskPriority priority, std::unique_ptr job_task) override { + * return std::make_unique( + * std::make_shared( + * this, std::move(job_task), kNumThreads)); + * } + * \endcode + */ + virtual std::unique_ptr PostJob( + TaskPriority priority, std::unique_ptr job_task) { + return nullptr; + } + + /** + * Returns an instance of a `TracingController`. This must be non-nullptr. The + * default implementation returns an empty `TracingController` that consumes + * trace data without effect. + */ + virtual TracingController* GetTracingController(); +}; + +/** + * Process-global initialization of the garbage collector. Must be called before + * creating a Heap. + * + * Can be called multiple times when paired with `ShutdownProcess()`. + * + * \param page_allocator The allocator used for maintaining meta data. Must not + * change between multiple calls to InitializeProcess. + */ +V8_EXPORT void InitializeProcess(PageAllocator* page_allocator); + +/** + * Must be called after destroying the last used heap. Some process-global + * metadata may not be returned and reused upon a subsequent + * `InitializeProcess()` call. + */ +V8_EXPORT void ShutdownProcess(); + +namespace internal { + +V8_EXPORT void Abort(); + +} // namespace internal + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_PLATFORM_H_ diff --git a/libs/android/libnode/include/node/cppgc/prefinalizer.h b/libs/android/libnode/include/node/cppgc/prefinalizer.h new file mode 100644 index 00000000..29b18bef --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/prefinalizer.h @@ -0,0 +1,52 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_PREFINALIZER_H_ +#define INCLUDE_CPPGC_PREFINALIZER_H_ + +#include "cppgc/internal/compiler-specific.h" +#include "cppgc/internal/prefinalizer-handler.h" +#include "cppgc/liveness-broker.h" + +namespace cppgc { + +namespace internal { + +template +class PrefinalizerRegistration final { + public: + explicit PrefinalizerRegistration(T* self) { + static_assert(sizeof(&T::InvokePreFinalizer) > 0, + "USING_PRE_FINALIZER(T) must be defined."); + + cppgc::internal::PreFinalizerRegistrationDispatcher::RegisterPrefinalizer( + {self, T::InvokePreFinalizer}); + } + + void* operator new(size_t, void* location) = delete; + void* operator new(size_t) = delete; +}; + +} // namespace internal + +#define CPPGC_USING_PRE_FINALIZER(Class, PreFinalizer) \ + public: \ + static bool InvokePreFinalizer(const cppgc::LivenessBroker& liveness_broker, \ + void* object) { \ + static_assert(cppgc::IsGarbageCollectedOrMixinTypeV, \ + "Only garbage collected objects can have prefinalizers"); \ + Class* self = static_cast(object); \ + if (liveness_broker.IsHeapObjectAlive(self)) return false; \ + self->Class::PreFinalizer(); \ + return true; \ + } \ + \ + private: \ + CPPGC_NO_UNIQUE_ADDRESS cppgc::internal::PrefinalizerRegistration \ + prefinalizer_dummy_{this}; \ + static_assert(true, "Force semicolon.") + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_PREFINALIZER_H_ diff --git a/libs/android/libnode/include/node/cppgc/process-heap-statistics.h b/libs/android/libnode/include/node/cppgc/process-heap-statistics.h new file mode 100644 index 00000000..774cc92f --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/process-heap-statistics.h @@ -0,0 +1,36 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_PROCESS_HEAP_STATISTICS_H_ +#define INCLUDE_CPPGC_PROCESS_HEAP_STATISTICS_H_ + +#include +#include + +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { +namespace internal { +class ProcessHeapStatisticsUpdater; +} // namespace internal + +class V8_EXPORT ProcessHeapStatistics final { + public: + static size_t TotalAllocatedObjectSize() { + return total_allocated_object_size_.load(std::memory_order_relaxed); + } + static size_t TotalAllocatedSpace() { + return total_allocated_space_.load(std::memory_order_relaxed); + } + + private: + static std::atomic_size_t total_allocated_space_; + static std::atomic_size_t total_allocated_object_size_; + + friend class internal::ProcessHeapStatisticsUpdater; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_PROCESS_HEAP_STATISTICS_H_ diff --git a/libs/android/libnode/include/node/cppgc/sentinel-pointer.h b/libs/android/libnode/include/node/cppgc/sentinel-pointer.h new file mode 100644 index 00000000..b049d1a2 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/sentinel-pointer.h @@ -0,0 +1,32 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_SENTINEL_POINTER_H_ +#define INCLUDE_CPPGC_SENTINEL_POINTER_H_ + +#include + +namespace cppgc { +namespace internal { + +// Special tag type used to denote some sentinel member. The semantics of the +// sentinel is defined by the embedder. +struct SentinelPointer { + template + operator T*() const { + static constexpr intptr_t kSentinelValue = 1; + return reinterpret_cast(kSentinelValue); + } + // Hidden friends. + friend bool operator==(SentinelPointer, SentinelPointer) { return true; } + friend bool operator!=(SentinelPointer, SentinelPointer) { return false; } +}; + +} // namespace internal + +constexpr internal::SentinelPointer kSentinelPointer; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_SENTINEL_POINTER_H_ diff --git a/libs/android/libnode/include/node/cppgc/source-location.h b/libs/android/libnode/include/node/cppgc/source-location.h new file mode 100644 index 00000000..da5a5ede --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/source-location.h @@ -0,0 +1,92 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_SOURCE_LOCATION_H_ +#define INCLUDE_CPPGC_SOURCE_LOCATION_H_ + +#include +#include + +#include "v8config.h" // NOLINT(build/include_directory) + +#if defined(__has_builtin) +#define CPPGC_SUPPORTS_SOURCE_LOCATION \ + (__has_builtin(__builtin_FUNCTION) && __has_builtin(__builtin_FILE) && \ + __has_builtin(__builtin_LINE)) // NOLINT +#elif defined(V8_CC_GNU) && __GNUC__ >= 7 +#define CPPGC_SUPPORTS_SOURCE_LOCATION 1 +#elif defined(V8_CC_INTEL) && __ICC >= 1800 +#define CPPGC_SUPPORTS_SOURCE_LOCATION 1 +#else +#define CPPGC_SUPPORTS_SOURCE_LOCATION 0 +#endif + +namespace cppgc { + +/** + * Encapsulates source location information. Mimics C++20's + * `std::source_location`. + */ +class V8_EXPORT SourceLocation final { + public: + /** + * Construct source location information corresponding to the location of the + * call site. + */ +#if CPPGC_SUPPORTS_SOURCE_LOCATION + static constexpr SourceLocation Current( + const char* function = __builtin_FUNCTION(), + const char* file = __builtin_FILE(), size_t line = __builtin_LINE()) { + return SourceLocation(function, file, line); + } +#else + static constexpr SourceLocation Current() { return SourceLocation(); } +#endif // CPPGC_SUPPORTS_SOURCE_LOCATION + + /** + * Constructs unspecified source location information. + */ + constexpr SourceLocation() = default; + + /** + * Returns the name of the function associated with the position represented + * by this object, if any. + * + * \returns the function name as cstring. + */ + constexpr const char* Function() const { return function_; } + + /** + * Returns the name of the current source file represented by this object. + * + * \returns the file name as cstring. + */ + constexpr const char* FileName() const { return file_; } + + /** + * Returns the line number represented by this object. + * + * \returns the line number. + */ + constexpr size_t Line() const { return line_; } + + /** + * Returns a human-readable string representing this object. + * + * \returns a human-readable string representing source location information. + */ + std::string ToString() const; + + private: + constexpr SourceLocation(const char* function, const char* file, size_t line) + : function_(function), file_(file), line_(line) {} + + const char* function_ = nullptr; + const char* file_ = nullptr; + size_t line_ = 0u; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_SOURCE_LOCATION_H_ diff --git a/libs/android/libnode/include/node/cppgc/testing.h b/libs/android/libnode/include/node/cppgc/testing.h new file mode 100644 index 00000000..229ce140 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/testing.h @@ -0,0 +1,99 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_TESTING_H_ +#define INCLUDE_CPPGC_TESTING_H_ + +#include "cppgc/common.h" +#include "cppgc/macros.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class HeapHandle; + +/** + * Namespace contains testing helpers. + */ +namespace testing { + +/** + * Overrides the state of the stack with the provided value. Takes precedence + * over other parameters that set the stack state. Must no be nested. + */ +class V8_EXPORT V8_NODISCARD OverrideEmbedderStackStateScope final { + CPPGC_STACK_ALLOCATED(); + + public: + /** + * Constructs a scoped object that automatically enters and leaves the scope. + * + * \param heap_handle The corresponding heap. + */ + explicit OverrideEmbedderStackStateScope(HeapHandle& heap_handle, + EmbedderStackState state); + ~OverrideEmbedderStackStateScope(); + + OverrideEmbedderStackStateScope(const OverrideEmbedderStackStateScope&) = + delete; + OverrideEmbedderStackStateScope& operator=( + const OverrideEmbedderStackStateScope&) = delete; + + private: + HeapHandle& heap_handle_; +}; + +/** + * Testing interface for managed heaps that allows for controlling garbage + * collection timings. Embedders should use this class when testing the + * interaction of their code with incremental/concurrent garbage collection. + */ +class V8_EXPORT StandaloneTestingHeap final { + public: + explicit StandaloneTestingHeap(HeapHandle&); + + /** + * Start an incremental garbage collection. + */ + void StartGarbageCollection(); + + /** + * Perform an incremental step. This will also schedule concurrent steps if + * needed. + * + * \param stack_state The state of the stack during the step. + */ + bool PerformMarkingStep(EmbedderStackState stack_state); + + /** + * Finalize the current garbage collection cycle atomically. + * Assumes that garbage collection is in progress. + * + * \param stack_state The state of the stack for finalizing the garbage + * collection cycle. + */ + void FinalizeGarbageCollection(EmbedderStackState stack_state); + + /** + * Toggle main thread marking on/off. Allows to stress concurrent marking + * (e.g. to better detect data races). + * + * \param should_mark Denotes whether the main thread should contribute to + * marking. Defaults to true. + */ + void ToggleMainThreadMarking(bool should_mark); + + /** + * Force enable compaction for the next garbage collection cycle. + */ + void ForceCompactionForNextGarbageCollection(); + + private: + HeapHandle& heap_handle_; +}; + +} // namespace testing +} // namespace cppgc + +#endif // INCLUDE_CPPGC_TESTING_H_ diff --git a/libs/android/libnode/include/node/cppgc/trace-trait.h b/libs/android/libnode/include/node/cppgc/trace-trait.h new file mode 100644 index 00000000..83619b1d --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/trace-trait.h @@ -0,0 +1,116 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_TRACE_TRAIT_H_ +#define INCLUDE_CPPGC_TRACE_TRAIT_H_ + +#include + +#include "cppgc/type-traits.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class Visitor; + +namespace internal { + +// Implementation of the default TraceTrait handling GarbageCollected and +// GarbageCollectedMixin. +template ::type>> +struct TraceTraitImpl; + +} // namespace internal + +/** + * Callback for invoking tracing on a given object. + * + * \param visitor The visitor to dispatch to. + * \param object The object to invoke tracing on. + */ +using TraceCallback = void (*)(Visitor* visitor, const void* object); + +/** + * Describes how to trace an object, i.e., how to visit all Oilpan-relevant + * fields of an object. + */ +struct TraceDescriptor { + /** + * Adjusted base pointer, i.e., the pointer to the class inheriting directly + * from GarbageCollected, of the object that is being traced. + */ + const void* base_object_payload; + /** + * Callback for tracing the object. + */ + TraceCallback callback; +}; + +namespace internal { + +struct V8_EXPORT TraceTraitFromInnerAddressImpl { + static TraceDescriptor GetTraceDescriptor(const void* address); +}; + +/** + * Trait specifying how the garbage collector processes an object of type T. + * + * Advanced users may override handling by creating a specialization for their + * type. + */ +template +struct TraceTraitBase { + static_assert(internal::IsTraceableV, "T must have a Trace() method"); + + /** + * Accessor for retrieving a TraceDescriptor to process an object of type T. + * + * \param self The object to be processed. + * \returns a TraceDescriptor to process the object. + */ + static TraceDescriptor GetTraceDescriptor(const void* self) { + return internal::TraceTraitImpl::GetTraceDescriptor( + static_cast(self)); + } + + /** + * Function invoking the tracing for an object of type T. + * + * \param visitor The visitor to dispatch to. + * \param self The object to invoke tracing on. + */ + static void Trace(Visitor* visitor, const void* self) { + static_cast(self)->Trace(visitor); + } +}; + +} // namespace internal + +template +struct TraceTrait : public internal::TraceTraitBase {}; + +namespace internal { + +template +struct TraceTraitImpl { + static_assert(IsGarbageCollectedTypeV, + "T must be of type GarbageCollected or GarbageCollectedMixin"); + static TraceDescriptor GetTraceDescriptor(const void* self) { + return {self, TraceTrait::Trace}; + } +}; + +template +struct TraceTraitImpl { + static TraceDescriptor GetTraceDescriptor(const void* self) { + return internal::TraceTraitFromInnerAddressImpl::GetTraceDescriptor(self); + } +}; + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_TRACE_TRAIT_H_ diff --git a/libs/android/libnode/include/node/cppgc/type-traits.h b/libs/android/libnode/include/node/cppgc/type-traits.h new file mode 100644 index 00000000..56cd55d6 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/type-traits.h @@ -0,0 +1,247 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_TYPE_TRAITS_H_ +#define INCLUDE_CPPGC_TYPE_TRAITS_H_ + +// This file should stay with minimal dependencies to allow embedder to check +// against Oilpan types without including any other parts. +#include +#include + +namespace cppgc { + +class Visitor; + +namespace internal { +template +class BasicMember; +struct DijkstraWriteBarrierPolicy; +struct NoWriteBarrierPolicy; +class StrongMemberTag; +class UntracedMemberTag; +class WeakMemberTag; + +// Pre-C++17 custom implementation of std::void_t. +template +struct make_void { + typedef void type; +}; +template +using void_t = typename make_void::type; + +// Not supposed to be specialized by the user. +template +struct IsWeak : std::false_type {}; + +// IsTraceMethodConst is used to verify that all Trace methods are marked as +// const. It is equivalent to IsTraceable but for a non-const object. +template +struct IsTraceMethodConst : std::false_type {}; + +template +struct IsTraceMethodConst().Trace( + std::declval()))>> : std::true_type { +}; + +template +struct IsTraceable : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsTraceable< + T, void_t().Trace(std::declval()))>> + : std::true_type { + // All Trace methods should be marked as const. If an object of type + // 'T' is traceable then any object of type 'const T' should also + // be traceable. + static_assert(IsTraceMethodConst(), + "Trace methods should be marked as const."); +}; + +template +constexpr bool IsTraceableV = IsTraceable::value; + +template +struct HasGarbageCollectedMixinTypeMarker : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct HasGarbageCollectedMixinTypeMarker< + T, + void_t::IsGarbageCollectedMixinTypeMarker>> + : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct HasGarbageCollectedTypeMarker : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct HasGarbageCollectedTypeMarker< + T, void_t::IsGarbageCollectedTypeMarker>> + : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template ::value, + bool = HasGarbageCollectedMixinTypeMarker::value> +struct IsGarbageCollectedMixinType : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsGarbageCollectedMixinType : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template ::value> +struct IsGarbageCollectedType : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsGarbageCollectedType : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsGarbageCollectedOrMixinType + : std::integral_constant::value || + IsGarbageCollectedMixinType::value> { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template ::value && + HasGarbageCollectedMixinTypeMarker::value)> +struct IsGarbageCollectedWithMixinType : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsGarbageCollectedWithMixinType : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsSubclassOfBasicMemberTemplate { + private: + template + static std::true_type SubclassCheck( + BasicMember*); + static std::false_type SubclassCheck(...); + + public: + static constexpr bool value = + decltype(SubclassCheck(std::declval()))::value; +}; + +template ::value> +struct IsMemberType : std::false_type {}; + +template +struct IsMemberType : std::true_type {}; + +template ::value> +struct IsWeakMemberType : std::false_type {}; + +template +struct IsWeakMemberType : std::true_type {}; + +template ::value> +struct IsUntracedMemberType : std::false_type {}; + +template +struct IsUntracedMemberType : std::true_type {}; + +template +struct IsComplete { + private: + template + static std::true_type IsSizeOfKnown(U*); + static std::false_type IsSizeOfKnown(...); + + public: + static constexpr bool value = + decltype(IsSizeOfKnown(std::declval()))::value; +}; + +} // namespace internal + +/** + * Value is true for types that inherit from `GarbageCollectedMixin` but not + * `GarbageCollected` (i.e., they are free mixins), and false otherwise. + */ +template +constexpr bool IsGarbageCollectedMixinTypeV = + internal::IsGarbageCollectedMixinType::value; + +/** + * Value is true for types that inherit from `GarbageCollected`, and false + * otherwise. + */ +template +constexpr bool IsGarbageCollectedTypeV = + internal::IsGarbageCollectedType::value; + +/** + * Value is true for types that inherit from either `GarbageCollected` or + * `GarbageCollectedMixin`, and false otherwise. + */ +template +constexpr bool IsGarbageCollectedOrMixinTypeV = + internal::IsGarbageCollectedOrMixinType::value; + +/** + * Value is true for types that inherit from `GarbageCollected` and + * `GarbageCollectedMixin`, and false otherwise. + */ +template +constexpr bool IsGarbageCollectedWithMixinTypeV = + internal::IsGarbageCollectedWithMixinType::value; + +/** + * Value is true for types of type `Member`, and false otherwise. + */ +template +constexpr bool IsMemberTypeV = internal::IsMemberType::value; + +/** + * Value is true for types of type `UntracedMember`, and false otherwise. + */ +template +constexpr bool IsUntracedMemberTypeV = internal::IsUntracedMemberType::value; + +/** + * Value is true for types of type `WeakMember`, and false otherwise. + */ +template +constexpr bool IsWeakMemberTypeV = internal::IsWeakMemberType::value; + +/** + * Value is true for types that are considered weak references, and false + * otherwise. + */ +template +constexpr bool IsWeakV = internal::IsWeak::value; + +/** + * Value is true for types that are complete, and false otherwise. + */ +template +constexpr bool IsCompleteV = internal::IsComplete::value; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_TYPE_TRAITS_H_ diff --git a/libs/android/libnode/include/node/cppgc/visitor.h b/libs/android/libnode/include/node/cppgc/visitor.h new file mode 100644 index 00000000..57e2ce39 --- /dev/null +++ b/libs/android/libnode/include/node/cppgc/visitor.h @@ -0,0 +1,379 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_VISITOR_H_ +#define INCLUDE_CPPGC_VISITOR_H_ + +#include "cppgc/custom-space.h" +#include "cppgc/ephemeron-pair.h" +#include "cppgc/garbage-collected.h" +#include "cppgc/internal/logging.h" +#include "cppgc/internal/pointer-policies.h" +#include "cppgc/liveness-broker.h" +#include "cppgc/member.h" +#include "cppgc/sentinel-pointer.h" +#include "cppgc/source-location.h" +#include "cppgc/trace-trait.h" +#include "cppgc/type-traits.h" + +namespace cppgc { + +namespace internal { +template +class BasicCrossThreadPersistent; +template +class BasicPersistent; +class ConservativeTracingVisitor; +class VisitorBase; +class VisitorFactory; +} // namespace internal + +using WeakCallback = void (*)(const LivenessBroker&, const void*); + +/** + * Visitor passed to trace methods. All managed pointers must have called the + * Visitor's trace method on them. + * + * \code + * class Foo final : public GarbageCollected { + * public: + * void Trace(Visitor* visitor) const { + * visitor->Trace(foo_); + * visitor->Trace(weak_foo_); + * } + * private: + * Member foo_; + * WeakMember weak_foo_; + * }; + * \endcode + */ +class V8_EXPORT Visitor { + public: + class Key { + private: + Key() = default; + friend class internal::VisitorFactory; + }; + + explicit Visitor(Key) {} + + virtual ~Visitor() = default; + + /** + * Trace method for raw pointers. Prefer the versions for managed pointers. + * + * \param member Reference retaining an object. + */ + template + void Trace(const T* t) { + static_assert(sizeof(T), "Pointee type must be fully defined."); + static_assert(internal::IsGarbageCollectedOrMixinType::value, + "T must be GarbageCollected or GarbageCollectedMixin type"); + if (!t) { + return; + } + Visit(t, TraceTrait::GetTraceDescriptor(t)); + } + + /** + * Trace method for Member. + * + * \param member Member reference retaining an object. + */ + template + void Trace(const Member& member) { + const T* value = member.GetRawAtomic(); + CPPGC_DCHECK(value != kSentinelPointer); + Trace(value); + } + + /** + * Trace method for WeakMember. + * + * \param weak_member WeakMember reference weakly retaining an object. + */ + template + void Trace(const WeakMember& weak_member) { + static_assert(sizeof(T), "Pointee type must be fully defined."); + static_assert(internal::IsGarbageCollectedOrMixinType::value, + "T must be GarbageCollected or GarbageCollectedMixin type"); + static_assert(!internal::IsAllocatedOnCompactableSpace::value, + "Weak references to compactable objects are not allowed"); + + const T* value = weak_member.GetRawAtomic(); + + // Bailout assumes that WeakMember emits write barrier. + if (!value) { + return; + } + + CPPGC_DCHECK(value != kSentinelPointer); + VisitWeak(value, TraceTrait::GetTraceDescriptor(value), + &HandleWeak>, &weak_member); + } + + /** + * Trace method for inlined objects that are not allocated themselves but + * otherwise follow managed heap layout and have a Trace() method. + * + * \param object reference of the inlined object. + */ + template + void Trace(const T& object) { +#if V8_ENABLE_CHECKS + // This object is embedded in potentially multiple nested objects. The + // outermost object must not be in construction as such objects are (a) not + // processed immediately, and (b) only processed conservatively if not + // otherwise possible. + CheckObjectNotInConstruction(&object); +#endif // V8_ENABLE_CHECKS + TraceTrait::Trace(this, &object); + } + + /** + * Registers a weak callback method on the object of type T. See + * LivenessBroker for an usage example. + * + * \param object of type T specifying a weak callback method. + */ + template + void RegisterWeakCallbackMethod(const T* object) { + RegisterWeakCallback(&WeakCallbackMethodDelegate, object); + } + + /** + * Trace method for EphemeronPair. + * + * \param ephemeron_pair EphemeronPair reference weakly retaining a key object + * and strongly retaining a value object in case the key object is alive. + */ + template + void Trace(const EphemeronPair& ephemeron_pair) { + TraceEphemeron(ephemeron_pair.key, &ephemeron_pair.value); + RegisterWeakCallbackMethod, + &EphemeronPair::ClearValueIfKeyIsDead>( + &ephemeron_pair); + } + + /** + * Trace method for a single ephemeron. Used for tracing a raw ephemeron in + * which the `key` and `value` are kept separately. + * + * \param weak_member_key WeakMember reference weakly retaining a key object. + * \param member_value Member reference with ephemeron semantics. + */ + template + void TraceEphemeron(const WeakMember& weak_member_key, + const Member* member_value) { + const KeyType* key = weak_member_key.GetRawAtomic(); + if (!key) return; + + // `value` must always be non-null. + CPPGC_DCHECK(member_value); + const ValueType* value = member_value->GetRawAtomic(); + if (!value) return; + + // KeyType and ValueType may refer to GarbageCollectedMixin. + TraceDescriptor value_desc = + TraceTrait::GetTraceDescriptor(value); + CPPGC_DCHECK(value_desc.base_object_payload); + const void* key_base_object_payload = + TraceTrait::GetTraceDescriptor(key).base_object_payload; + CPPGC_DCHECK(key_base_object_payload); + + VisitEphemeron(key_base_object_payload, value, value_desc); + } + + /** + * Trace method for a single ephemeron. Used for tracing a raw ephemeron in + * which the `key` and `value` are kept separately. Note that this overload + * is for non-GarbageCollected `value`s that can be traced though. + * + * \param key `WeakMember` reference weakly retaining a key object. + * \param value Reference weakly retaining a value object. Note that + * `ValueType` here should not be `Member`. It is expected that + * `TraceTrait::GetTraceDescriptor(value)` returns a + * `TraceDescriptor` with a null base pointer but a valid trace method. + */ + template + void TraceEphemeron(const WeakMember& weak_member_key, + const ValueType* value) { + static_assert(!IsGarbageCollectedOrMixinTypeV, + "garbage-collected types must use WeakMember and Member"); + const KeyType* key = weak_member_key.GetRawAtomic(); + if (!key) return; + + // `value` must always be non-null. + CPPGC_DCHECK(value); + TraceDescriptor value_desc = + TraceTrait::GetTraceDescriptor(value); + // `value_desc.base_object_payload` must be null as this override is only + // taken for non-garbage-collected values. + CPPGC_DCHECK(!value_desc.base_object_payload); + + // KeyType might be a GarbageCollectedMixin. + const void* key_base_object_payload = + TraceTrait::GetTraceDescriptor(key).base_object_payload; + CPPGC_DCHECK(key_base_object_payload); + + VisitEphemeron(key_base_object_payload, value, value_desc); + } + + /** + * Trace method that strongifies a WeakMember. + * + * \param weak_member WeakMember reference retaining an object. + */ + template + void TraceStrongly(const WeakMember& weak_member) { + const T* value = weak_member.GetRawAtomic(); + CPPGC_DCHECK(value != kSentinelPointer); + Trace(value); + } + + /** + * Trace method for weak containers. + * + * \param object reference of the weak container. + * \param callback to be invoked. + * \param data custom data that is passed to the callback. + */ + template + void TraceWeakContainer(const T* object, WeakCallback callback, + const void* data) { + if (!object) return; + VisitWeakContainer(object, TraceTrait::GetTraceDescriptor(object), + TraceTrait::GetWeakTraceDescriptor(object), callback, + data); + } + + /** + * Registers a slot containing a reference to an object allocated on a + * compactable space. Such references maybe be arbitrarily moved by the GC. + * + * \param slot location of reference to object that might be moved by the GC. + */ + template + void RegisterMovableReference(const T** slot) { + static_assert(internal::IsAllocatedOnCompactableSpace::value, + "Only references to objects allocated on compactable spaces " + "should be registered as movable slots."); + static_assert(!IsGarbageCollectedMixinTypeV, + "Mixin types do not support compaction."); + HandleMovableReference(reinterpret_cast(slot)); + } + + /** + * Registers a weak callback that is invoked during garbage collection. + * + * \param callback to be invoked. + * \param data custom data that is passed to the callback. + */ + virtual void RegisterWeakCallback(WeakCallback callback, const void* data) {} + + /** + * Defers tracing an object from a concurrent thread to the mutator thread. + * Should be called by Trace methods of types that are not safe to trace + * concurrently. + * + * \param parameter tells the trace callback which object was deferred. + * \param callback to be invoked for tracing on the mutator thread. + * \param deferred_size size of deferred object. + * + * \returns false if the object does not need to be deferred (i.e. currently + * traced on the mutator thread) and true otherwise (i.e. currently traced on + * a concurrent thread). + */ + virtual V8_WARN_UNUSED_RESULT bool DeferTraceToMutatorThreadIfConcurrent( + const void* parameter, TraceCallback callback, size_t deferred_size) { + // By default tracing is not deferred. + return false; + } + + protected: + virtual void Visit(const void* self, TraceDescriptor) {} + virtual void VisitWeak(const void* self, TraceDescriptor, WeakCallback, + const void* weak_member) {} + virtual void VisitRoot(const void*, TraceDescriptor, const SourceLocation&) {} + virtual void VisitWeakRoot(const void* self, TraceDescriptor, WeakCallback, + const void* weak_root, const SourceLocation&) {} + virtual void VisitEphemeron(const void* key, const void* value, + TraceDescriptor value_desc) {} + virtual void VisitWeakContainer(const void* self, TraceDescriptor strong_desc, + TraceDescriptor weak_desc, + WeakCallback callback, const void* data) {} + virtual void HandleMovableReference(const void**) {} + + private: + template + static void WeakCallbackMethodDelegate(const LivenessBroker& info, + const void* self) { + // Callback is registered through a potential const Trace method but needs + // to be able to modify fields. See HandleWeak. + (const_cast(static_cast(self))->*method)(info); + } + + template + static void HandleWeak(const LivenessBroker& info, const void* object) { + const PointerType* weak = static_cast(object); + auto* raw_ptr = weak->GetFromGC(); + // Sentinel values are preserved for weak pointers. + if (raw_ptr == kSentinelPointer) return; + if (!info.IsHeapObjectAlive(raw_ptr)) { + weak->ClearFromGC(); + } + } + + template * = nullptr> + void TraceRoot(const Persistent& p, const SourceLocation& loc) { + using PointeeType = typename Persistent::PointeeType; + static_assert(sizeof(PointeeType), + "Persistent's pointee type must be fully defined"); + static_assert(internal::IsGarbageCollectedOrMixinType::value, + "Persistent's pointee type must be GarbageCollected or " + "GarbageCollectedMixin"); + auto* ptr = p.GetFromGC(); + if (!ptr) { + return; + } + VisitRoot(ptr, TraceTrait::GetTraceDescriptor(ptr), loc); + } + + template < + typename WeakPersistent, + std::enable_if_t* = nullptr> + void TraceRoot(const WeakPersistent& p, const SourceLocation& loc) { + using PointeeType = typename WeakPersistent::PointeeType; + static_assert(sizeof(PointeeType), + "Persistent's pointee type must be fully defined"); + static_assert(internal::IsGarbageCollectedOrMixinType::value, + "Persistent's pointee type must be GarbageCollected or " + "GarbageCollectedMixin"); + static_assert(!internal::IsAllocatedOnCompactableSpace::value, + "Weak references to compactable objects are not allowed"); + auto* ptr = p.GetFromGC(); + VisitWeakRoot(ptr, TraceTrait::GetTraceDescriptor(ptr), + &HandleWeak, &p, loc); + } + +#if V8_ENABLE_CHECKS + void CheckObjectNotInConstruction(const void* address); +#endif // V8_ENABLE_CHECKS + + template + friend class internal::BasicCrossThreadPersistent; + template + friend class internal::BasicPersistent; + friend class internal::ConservativeTracingVisitor; + friend class internal::VisitorBase; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_VISITOR_H_ diff --git a/libs/android/libnode/include/node/js_native_api.h b/libs/android/libnode/include/node/js_native_api.h index bd8bd35d..220d140d 100644 --- a/libs/android/libnode/include/node/js_native_api.h +++ b/libs/android/libnode/include/node/js_native_api.h @@ -2,8 +2,8 @@ #define SRC_JS_NATIVE_API_H_ // This file needs to be compatible with C compilers. -#include // NOLINT(modernize-deprecated-headers) #include // NOLINT(modernize-deprecated-headers) +#include // NOLINT(modernize-deprecated-headers) // Use INT_MAX, this should only be consumed by the pre-processor anyway. #define NAPI_VERSION_EXPERIMENTAL 2147483647 @@ -17,7 +17,7 @@ // functions available in a new version of N-API that is not yet ported in all // LTS versions, they can set NAPI_VERSION knowing that they have specifically // depended on that version. -#define NAPI_VERSION 7 +#define NAPI_VERSION 8 #endif #endif @@ -26,14 +26,15 @@ // If you need __declspec(dllimport), either include instead, or // define NAPI_EXTERN as __declspec(dllimport) on the compiler's command line. #ifndef NAPI_EXTERN - #ifdef _WIN32 - #define NAPI_EXTERN __declspec(dllexport) - #elif defined(__wasm32__) - #define NAPI_EXTERN __attribute__((visibility("default"))) \ - __attribute__((__import_module__("napi"))) - #else - #define NAPI_EXTERN __attribute__((visibility("default"))) - #endif +#ifdef _WIN32 +#define NAPI_EXTERN __declspec(dllexport) +#elif defined(__wasm32__) +#define NAPI_EXTERN \ + __attribute__((visibility("default"))) \ + __attribute__((__import_module__("napi"))) +#else +#define NAPI_EXTERN __attribute__((visibility("default"))) +#endif #endif #define NAPI_AUTO_LENGTH SIZE_MAX @@ -48,222 +49,228 @@ EXTERN_C_START -NAPI_EXTERN napi_status -napi_get_last_error_info(napi_env env, - const napi_extended_error_info** result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_get_last_error_info(napi_env env, const napi_extended_error_info** result); // Getters for defined singletons -NAPI_EXTERN napi_status napi_get_undefined(napi_env env, napi_value* result); -NAPI_EXTERN napi_status napi_get_null(napi_env env, napi_value* result); -NAPI_EXTERN napi_status napi_get_global(napi_env env, napi_value* result); -NAPI_EXTERN napi_status napi_get_boolean(napi_env env, - bool value, - napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_undefined(napi_env env, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_null(napi_env env, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_global(napi_env env, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_boolean(napi_env env, + bool value, + napi_value* result); // Methods to create Primitive types/Objects -NAPI_EXTERN napi_status napi_create_object(napi_env env, napi_value* result); -NAPI_EXTERN napi_status napi_create_array(napi_env env, napi_value* result); -NAPI_EXTERN napi_status napi_create_array_with_length(napi_env env, - size_t length, +NAPI_EXTERN napi_status NAPI_CDECL napi_create_object(napi_env env, napi_value* result); -NAPI_EXTERN napi_status napi_create_double(napi_env env, - double value, - napi_value* result); -NAPI_EXTERN napi_status napi_create_int32(napi_env env, - int32_t value, - napi_value* result); -NAPI_EXTERN napi_status napi_create_uint32(napi_env env, - uint32_t value, - napi_value* result); -NAPI_EXTERN napi_status napi_create_int64(napi_env env, - int64_t value, - napi_value* result); -NAPI_EXTERN napi_status napi_create_string_latin1(napi_env env, - const char* str, - size_t length, - napi_value* result); -NAPI_EXTERN napi_status napi_create_string_utf8(napi_env env, - const char* str, - size_t length, - napi_value* result); -NAPI_EXTERN napi_status napi_create_string_utf16(napi_env env, - const char16_t* str, - size_t length, - napi_value* result); -NAPI_EXTERN napi_status napi_create_symbol(napi_env env, - napi_value description, - napi_value* result); -NAPI_EXTERN napi_status napi_create_function(napi_env env, - const char* utf8name, - size_t length, - napi_callback cb, - void* data, - napi_value* result); -NAPI_EXTERN napi_status napi_create_error(napi_env env, - napi_value code, - napi_value msg, - napi_value* result); -NAPI_EXTERN napi_status napi_create_type_error(napi_env env, - napi_value code, - napi_value msg, - napi_value* result); -NAPI_EXTERN napi_status napi_create_range_error(napi_env env, - napi_value code, - napi_value msg, - napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_array(napi_env env, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_array_with_length(napi_env env, size_t length, napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_double(napi_env env, + double value, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_int32(napi_env env, + int32_t value, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_uint32(napi_env env, + uint32_t value, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_int64(napi_env env, + int64_t value, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_string_latin1( + napi_env env, const char* str, size_t length, napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_string_utf8(napi_env env, + const char* str, + size_t length, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_string_utf16(napi_env env, + const char16_t* str, + size_t length, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_symbol(napi_env env, + napi_value description, + napi_value* result); +#ifdef NAPI_EXPERIMENTAL +NAPI_EXTERN napi_status NAPI_CDECL +node_api_symbol_for(napi_env env, + const char* utf8description, + size_t length, + napi_value* result); +#endif // NAPI_EXPERIMENTAL +NAPI_EXTERN napi_status NAPI_CDECL napi_create_function(napi_env env, + const char* utf8name, + size_t length, + napi_callback cb, + void* data, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_error(napi_env env, + napi_value code, + napi_value msg, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_type_error(napi_env env, + napi_value code, + napi_value msg, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_range_error(napi_env env, + napi_value code, + napi_value msg, + napi_value* result); +#ifdef NAPI_EXPERIMENTAL +NAPI_EXTERN napi_status NAPI_CDECL node_api_create_syntax_error( + napi_env env, napi_value code, napi_value msg, napi_value* result); +#endif // NAPI_EXPERIMENTAL // Methods to get the native napi_value from Primitive type -NAPI_EXTERN napi_status napi_typeof(napi_env env, - napi_value value, - napi_valuetype* result); -NAPI_EXTERN napi_status napi_get_value_double(napi_env env, - napi_value value, - double* result); -NAPI_EXTERN napi_status napi_get_value_int32(napi_env env, - napi_value value, - int32_t* result); -NAPI_EXTERN napi_status napi_get_value_uint32(napi_env env, - napi_value value, - uint32_t* result); -NAPI_EXTERN napi_status napi_get_value_int64(napi_env env, - napi_value value, - int64_t* result); -NAPI_EXTERN napi_status napi_get_value_bool(napi_env env, - napi_value value, - bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_typeof(napi_env env, + napi_value value, + napi_valuetype* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_double(napi_env env, + napi_value value, + double* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_int32(napi_env env, + napi_value value, + int32_t* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_uint32(napi_env env, + napi_value value, + uint32_t* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_int64(napi_env env, + napi_value value, + int64_t* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_bool(napi_env env, + napi_value value, + bool* result); // Copies LATIN-1 encoded bytes from a string into a buffer. -NAPI_EXTERN napi_status napi_get_value_string_latin1(napi_env env, - napi_value value, - char* buf, - size_t bufsize, - size_t* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_string_latin1( + napi_env env, napi_value value, char* buf, size_t bufsize, size_t* result); // Copies UTF-8 encoded bytes from a string into a buffer. -NAPI_EXTERN napi_status napi_get_value_string_utf8(napi_env env, - napi_value value, - char* buf, - size_t bufsize, - size_t* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_string_utf8( + napi_env env, napi_value value, char* buf, size_t bufsize, size_t* result); // Copies UTF-16 encoded bytes from a string into a buffer. -NAPI_EXTERN napi_status napi_get_value_string_utf16(napi_env env, - napi_value value, - char16_t* buf, - size_t bufsize, - size_t* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_string_utf16(napi_env env, + napi_value value, + char16_t* buf, + size_t bufsize, + size_t* result); // Methods to coerce values // These APIs may execute user scripts -NAPI_EXTERN napi_status napi_coerce_to_bool(napi_env env, - napi_value value, - napi_value* result); -NAPI_EXTERN napi_status napi_coerce_to_number(napi_env env, - napi_value value, - napi_value* result); -NAPI_EXTERN napi_status napi_coerce_to_object(napi_env env, - napi_value value, - napi_value* result); -NAPI_EXTERN napi_status napi_coerce_to_string(napi_env env, - napi_value value, - napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_coerce_to_bool(napi_env env, + napi_value value, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_coerce_to_number(napi_env env, + napi_value value, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_coerce_to_object(napi_env env, + napi_value value, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_coerce_to_string(napi_env env, + napi_value value, + napi_value* result); // Methods to work with Objects -NAPI_EXTERN napi_status napi_get_prototype(napi_env env, - napi_value object, - napi_value* result); -NAPI_EXTERN napi_status napi_get_property_names(napi_env env, - napi_value object, - napi_value* result); -NAPI_EXTERN napi_status napi_set_property(napi_env env, - napi_value object, - napi_value key, - napi_value value); -NAPI_EXTERN napi_status napi_has_property(napi_env env, - napi_value object, - napi_value key, - bool* result); -NAPI_EXTERN napi_status napi_get_property(napi_env env, - napi_value object, - napi_value key, - napi_value* result); -NAPI_EXTERN napi_status napi_delete_property(napi_env env, - napi_value object, - napi_value key, - bool* result); -NAPI_EXTERN napi_status napi_has_own_property(napi_env env, - napi_value object, - napi_value key, - bool* result); -NAPI_EXTERN napi_status napi_set_named_property(napi_env env, - napi_value object, - const char* utf8name, - napi_value value); -NAPI_EXTERN napi_status napi_has_named_property(napi_env env, - napi_value object, - const char* utf8name, - bool* result); -NAPI_EXTERN napi_status napi_get_named_property(napi_env env, - napi_value object, - const char* utf8name, - napi_value* result); -NAPI_EXTERN napi_status napi_set_element(napi_env env, - napi_value object, - uint32_t index, - napi_value value); -NAPI_EXTERN napi_status napi_has_element(napi_env env, - napi_value object, - uint32_t index, - bool* result); -NAPI_EXTERN napi_status napi_get_element(napi_env env, - napi_value object, - uint32_t index, - napi_value* result); -NAPI_EXTERN napi_status napi_delete_element(napi_env env, - napi_value object, - uint32_t index, - bool* result); -NAPI_EXTERN napi_status +NAPI_EXTERN napi_status NAPI_CDECL napi_get_prototype(napi_env env, + napi_value object, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_property_names(napi_env env, + napi_value object, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_set_property(napi_env env, + napi_value object, + napi_value key, + napi_value value); +NAPI_EXTERN napi_status NAPI_CDECL napi_has_property(napi_env env, + napi_value object, + napi_value key, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_property(napi_env env, + napi_value object, + napi_value key, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_delete_property(napi_env env, + napi_value object, + napi_value key, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_has_own_property(napi_env env, + napi_value object, + napi_value key, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_set_named_property(napi_env env, + napi_value object, + const char* utf8name, + napi_value value); +NAPI_EXTERN napi_status NAPI_CDECL napi_has_named_property(napi_env env, + napi_value object, + const char* utf8name, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_named_property(napi_env env, + napi_value object, + const char* utf8name, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_set_element(napi_env env, + napi_value object, + uint32_t index, + napi_value value); +NAPI_EXTERN napi_status NAPI_CDECL napi_has_element(napi_env env, + napi_value object, + uint32_t index, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_element(napi_env env, + napi_value object, + uint32_t index, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_delete_element(napi_env env, + napi_value object, + uint32_t index, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_define_properties(napi_env env, napi_value object, size_t property_count, const napi_property_descriptor* properties); // Methods to work with Arrays -NAPI_EXTERN napi_status napi_is_array(napi_env env, - napi_value value, - bool* result); -NAPI_EXTERN napi_status napi_get_array_length(napi_env env, - napi_value value, - uint32_t* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_is_array(napi_env env, + napi_value value, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_array_length(napi_env env, + napi_value value, + uint32_t* result); // Methods to compare values -NAPI_EXTERN napi_status napi_strict_equals(napi_env env, - napi_value lhs, - napi_value rhs, - bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_strict_equals(napi_env env, + napi_value lhs, + napi_value rhs, + bool* result); // Methods to work with Functions -NAPI_EXTERN napi_status napi_call_function(napi_env env, - napi_value recv, - napi_value func, - size_t argc, - const napi_value* argv, - napi_value* result); -NAPI_EXTERN napi_status napi_new_instance(napi_env env, - napi_value constructor, - size_t argc, - const napi_value* argv, - napi_value* result); -NAPI_EXTERN napi_status napi_instanceof(napi_env env, - napi_value object, - napi_value constructor, - bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_call_function(napi_env env, + napi_value recv, + napi_value func, + size_t argc, + const napi_value* argv, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_new_instance(napi_env env, + napi_value constructor, + size_t argc, + const napi_value* argv, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_instanceof(napi_env env, + napi_value object, + napi_value constructor, + bool* result); // Methods to work with napi_callbacks // Gets all callback info in a single call. (Ugly, but faster.) -NAPI_EXTERN napi_status napi_get_cb_info( +NAPI_EXTERN napi_status NAPI_CDECL napi_get_cb_info( napi_env env, // [in] NAPI environment handle napi_callback_info cbinfo, // [in] Opaque callback-info handle size_t* argc, // [in-out] Specifies the size of the provided argv array @@ -272,10 +279,9 @@ NAPI_EXTERN napi_status napi_get_cb_info( napi_value* this_arg, // [out] Receives the JS 'this' arg for the call void** data); // [out] Receives the data pointer for the callback. -NAPI_EXTERN napi_status napi_get_new_target(napi_env env, - napi_callback_info cbinfo, - napi_value* result); -NAPI_EXTERN napi_status +NAPI_EXTERN napi_status NAPI_CDECL napi_get_new_target( + napi_env env, napi_callback_info cbinfo, napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_define_class(napi_env env, const char* utf8name, size_t length, @@ -286,232 +292,240 @@ napi_define_class(napi_env env, napi_value* result); // Methods to work with external data objects -NAPI_EXTERN napi_status napi_wrap(napi_env env, - napi_value js_object, - void* native_object, - napi_finalize finalize_cb, - void* finalize_hint, - napi_ref* result); -NAPI_EXTERN napi_status napi_unwrap(napi_env env, - napi_value js_object, - void** result); -NAPI_EXTERN napi_status napi_remove_wrap(napi_env env, - napi_value js_object, - void** result); -NAPI_EXTERN napi_status napi_create_external(napi_env env, - void* data, +NAPI_EXTERN napi_status NAPI_CDECL napi_wrap(napi_env env, + napi_value js_object, + void* native_object, napi_finalize finalize_cb, void* finalize_hint, - napi_value* result); -NAPI_EXTERN napi_status napi_get_value_external(napi_env env, - napi_value value, - void** result); + napi_ref* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_unwrap(napi_env env, + napi_value js_object, + void** result); +NAPI_EXTERN napi_status NAPI_CDECL napi_remove_wrap(napi_env env, + napi_value js_object, + void** result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_external(napi_env env, + void* data, + napi_finalize finalize_cb, + void* finalize_hint, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_external(napi_env env, + napi_value value, + void** result); // Methods to control object lifespan // Set initial_refcount to 0 for a weak reference, >0 for a strong reference. -NAPI_EXTERN napi_status napi_create_reference(napi_env env, - napi_value value, - uint32_t initial_refcount, - napi_ref* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_reference(napi_env env, + napi_value value, + uint32_t initial_refcount, + napi_ref* result); // Deletes a reference. The referenced value is released, and may // be GC'd unless there are other references to it. -NAPI_EXTERN napi_status napi_delete_reference(napi_env env, napi_ref ref); +NAPI_EXTERN napi_status NAPI_CDECL napi_delete_reference(napi_env env, + napi_ref ref); // Increments the reference count, optionally returning the resulting count. // After this call the reference will be a strong reference because its // refcount is >0, and the referenced object is effectively "pinned". // Calling this when the refcount is 0 and the object is unavailable // results in an error. -NAPI_EXTERN napi_status napi_reference_ref(napi_env env, - napi_ref ref, - uint32_t* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_reference_ref(napi_env env, + napi_ref ref, + uint32_t* result); // Decrements the reference count, optionally returning the resulting count. // If the result is 0 the reference is now weak and the object may be GC'd // at any time if there are no other references. Calling this when the // refcount is already 0 results in an error. -NAPI_EXTERN napi_status napi_reference_unref(napi_env env, - napi_ref ref, - uint32_t* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_reference_unref(napi_env env, + napi_ref ref, + uint32_t* result); // Attempts to get a referenced value. If the reference is weak, // the value might no longer be available, in that case the call // is still successful but the result is NULL. -NAPI_EXTERN napi_status napi_get_reference_value(napi_env env, - napi_ref ref, - napi_value* result); - -NAPI_EXTERN napi_status napi_open_handle_scope(napi_env env, - napi_handle_scope* result); -NAPI_EXTERN napi_status napi_close_handle_scope(napi_env env, - napi_handle_scope scope); -NAPI_EXTERN napi_status -napi_open_escapable_handle_scope(napi_env env, - napi_escapable_handle_scope* result); -NAPI_EXTERN napi_status -napi_close_escapable_handle_scope(napi_env env, - napi_escapable_handle_scope scope); - -NAPI_EXTERN napi_status napi_escape_handle(napi_env env, - napi_escapable_handle_scope scope, - napi_value escapee, - napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_reference_value(napi_env env, + napi_ref ref, + napi_value* result); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_open_handle_scope(napi_env env, napi_handle_scope* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_close_handle_scope(napi_env env, napi_handle_scope scope); +NAPI_EXTERN napi_status NAPI_CDECL napi_open_escapable_handle_scope( + napi_env env, napi_escapable_handle_scope* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_close_escapable_handle_scope( + napi_env env, napi_escapable_handle_scope scope); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_escape_handle(napi_env env, + napi_escapable_handle_scope scope, + napi_value escapee, + napi_value* result); // Methods to support error handling -NAPI_EXTERN napi_status napi_throw(napi_env env, napi_value error); -NAPI_EXTERN napi_status napi_throw_error(napi_env env, - const char* code, - const char* msg); -NAPI_EXTERN napi_status napi_throw_type_error(napi_env env, - const char* code, - const char* msg); -NAPI_EXTERN napi_status napi_throw_range_error(napi_env env, - const char* code, - const char* msg); -NAPI_EXTERN napi_status napi_is_error(napi_env env, - napi_value value, - bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_throw(napi_env env, napi_value error); +NAPI_EXTERN napi_status NAPI_CDECL napi_throw_error(napi_env env, + const char* code, + const char* msg); +NAPI_EXTERN napi_status NAPI_CDECL napi_throw_type_error(napi_env env, + const char* code, + const char* msg); +NAPI_EXTERN napi_status NAPI_CDECL napi_throw_range_error(napi_env env, + const char* code, + const char* msg); +#ifdef NAPI_EXPERIMENTAL +NAPI_EXTERN napi_status NAPI_CDECL node_api_throw_syntax_error(napi_env env, + const char* code, + const char* msg); +#endif // NAPI_EXPERIMENTAL +NAPI_EXTERN napi_status NAPI_CDECL napi_is_error(napi_env env, + napi_value value, + bool* result); // Methods to support catching exceptions -NAPI_EXTERN napi_status napi_is_exception_pending(napi_env env, bool* result); -NAPI_EXTERN napi_status napi_get_and_clear_last_exception(napi_env env, - napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_is_exception_pending(napi_env env, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_get_and_clear_last_exception(napi_env env, napi_value* result); // Methods to work with array buffers and typed arrays -NAPI_EXTERN napi_status napi_is_arraybuffer(napi_env env, - napi_value value, - bool* result); -NAPI_EXTERN napi_status napi_create_arraybuffer(napi_env env, - size_t byte_length, - void** data, - napi_value* result); -NAPI_EXTERN napi_status +NAPI_EXTERN napi_status NAPI_CDECL napi_is_arraybuffer(napi_env env, + napi_value value, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_arraybuffer(napi_env env, + size_t byte_length, + void** data, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_external_arraybuffer(napi_env env, void* external_data, size_t byte_length, napi_finalize finalize_cb, void* finalize_hint, napi_value* result); -NAPI_EXTERN napi_status napi_get_arraybuffer_info(napi_env env, - napi_value arraybuffer, - void** data, - size_t* byte_length); -NAPI_EXTERN napi_status napi_is_typedarray(napi_env env, - napi_value value, - bool* result); -NAPI_EXTERN napi_status napi_create_typedarray(napi_env env, - napi_typedarray_type type, - size_t length, - napi_value arraybuffer, - size_t byte_offset, - napi_value* result); -NAPI_EXTERN napi_status napi_get_typedarray_info(napi_env env, - napi_value typedarray, - napi_typedarray_type* type, - size_t* length, - void** data, - napi_value* arraybuffer, - size_t* byte_offset); - -NAPI_EXTERN napi_status napi_create_dataview(napi_env env, - size_t length, - napi_value arraybuffer, - size_t byte_offset, - napi_value* result); -NAPI_EXTERN napi_status napi_is_dataview(napi_env env, - napi_value value, - bool* result); -NAPI_EXTERN napi_status napi_get_dataview_info(napi_env env, - napi_value dataview, - size_t* bytelength, - void** data, - napi_value* arraybuffer, - size_t* byte_offset); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_arraybuffer_info( + napi_env env, napi_value arraybuffer, void** data, size_t* byte_length); +NAPI_EXTERN napi_status NAPI_CDECL napi_is_typedarray(napi_env env, + napi_value value, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_typedarray(napi_env env, + napi_typedarray_type type, + size_t length, + napi_value arraybuffer, + size_t byte_offset, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_get_typedarray_info(napi_env env, + napi_value typedarray, + napi_typedarray_type* type, + size_t* length, + void** data, + napi_value* arraybuffer, + size_t* byte_offset); + +NAPI_EXTERN napi_status NAPI_CDECL napi_create_dataview(napi_env env, + size_t length, + napi_value arraybuffer, + size_t byte_offset, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_is_dataview(napi_env env, + napi_value value, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_get_dataview_info(napi_env env, + napi_value dataview, + size_t* bytelength, + void** data, + napi_value* arraybuffer, + size_t* byte_offset); // version management -NAPI_EXTERN napi_status napi_get_version(napi_env env, uint32_t* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_version(napi_env env, + uint32_t* result); // Promises -NAPI_EXTERN napi_status napi_create_promise(napi_env env, - napi_deferred* deferred, - napi_value* promise); -NAPI_EXTERN napi_status napi_resolve_deferred(napi_env env, - napi_deferred deferred, - napi_value resolution); -NAPI_EXTERN napi_status napi_reject_deferred(napi_env env, - napi_deferred deferred, - napi_value rejection); -NAPI_EXTERN napi_status napi_is_promise(napi_env env, - napi_value value, - bool* is_promise); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_promise(napi_env env, + napi_deferred* deferred, + napi_value* promise); +NAPI_EXTERN napi_status NAPI_CDECL napi_resolve_deferred(napi_env env, + napi_deferred deferred, + napi_value resolution); +NAPI_EXTERN napi_status NAPI_CDECL napi_reject_deferred(napi_env env, + napi_deferred deferred, + napi_value rejection); +NAPI_EXTERN napi_status NAPI_CDECL napi_is_promise(napi_env env, + napi_value value, + bool* is_promise); // Running a script -NAPI_EXTERN napi_status napi_run_script(napi_env env, - napi_value script, - napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_run_script(napi_env env, + napi_value script, + napi_value* result); // Memory management -NAPI_EXTERN napi_status napi_adjust_external_memory(napi_env env, - int64_t change_in_bytes, - int64_t* adjusted_value); +NAPI_EXTERN napi_status NAPI_CDECL napi_adjust_external_memory( + napi_env env, int64_t change_in_bytes, int64_t* adjusted_value); #if NAPI_VERSION >= 5 // Dates -NAPI_EXTERN napi_status napi_create_date(napi_env env, - double time, - napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_date(napi_env env, + double time, + napi_value* result); -NAPI_EXTERN napi_status napi_is_date(napi_env env, - napi_value value, - bool* is_date); +NAPI_EXTERN napi_status NAPI_CDECL napi_is_date(napi_env env, + napi_value value, + bool* is_date); -NAPI_EXTERN napi_status napi_get_date_value(napi_env env, - napi_value value, - double* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_date_value(napi_env env, + napi_value value, + double* result); // Add finalizer for pointer -NAPI_EXTERN napi_status napi_add_finalizer(napi_env env, - napi_value js_object, - void* native_object, - napi_finalize finalize_cb, - void* finalize_hint, - napi_ref* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_add_finalizer(napi_env env, + napi_value js_object, + void* native_object, + napi_finalize finalize_cb, + void* finalize_hint, + napi_ref* result); #endif // NAPI_VERSION >= 5 #if NAPI_VERSION >= 6 // BigInt -NAPI_EXTERN napi_status napi_create_bigint_int64(napi_env env, - int64_t value, - napi_value* result); -NAPI_EXTERN napi_status napi_create_bigint_uint64(napi_env env, - uint64_t value, - napi_value* result); -NAPI_EXTERN napi_status napi_create_bigint_words(napi_env env, - int sign_bit, - size_t word_count, - const uint64_t* words, - napi_value* result); -NAPI_EXTERN napi_status napi_get_value_bigint_int64(napi_env env, - napi_value value, - int64_t* result, - bool* lossless); -NAPI_EXTERN napi_status napi_get_value_bigint_uint64(napi_env env, - napi_value value, - uint64_t* result, - bool* lossless); -NAPI_EXTERN napi_status napi_get_value_bigint_words(napi_env env, - napi_value value, - int* sign_bit, - size_t* word_count, - uint64_t* words); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_bigint_int64(napi_env env, + int64_t value, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_bigint_uint64(napi_env env, uint64_t value, napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_bigint_words(napi_env env, + int sign_bit, + size_t word_count, + const uint64_t* words, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_bigint_int64(napi_env env, + napi_value value, + int64_t* result, + bool* lossless); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_bigint_uint64( + napi_env env, napi_value value, uint64_t* result, bool* lossless); +NAPI_EXTERN napi_status NAPI_CDECL +napi_get_value_bigint_words(napi_env env, + napi_value value, + int* sign_bit, + size_t* word_count, + uint64_t* words); // Object -NAPI_EXTERN napi_status +NAPI_EXTERN napi_status NAPI_CDECL napi_get_all_property_names(napi_env env, napi_value object, napi_key_collection_mode key_mode, @@ -520,37 +534,37 @@ napi_get_all_property_names(napi_env env, napi_value* result); // Instance data -NAPI_EXTERN napi_status napi_set_instance_data(napi_env env, - void* data, - napi_finalize finalize_cb, - void* finalize_hint); +NAPI_EXTERN napi_status NAPI_CDECL napi_set_instance_data( + napi_env env, void* data, napi_finalize finalize_cb, void* finalize_hint); -NAPI_EXTERN napi_status napi_get_instance_data(napi_env env, - void** data); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_instance_data(napi_env env, + void** data); #endif // NAPI_VERSION >= 6 #if NAPI_VERSION >= 7 // ArrayBuffer detaching -NAPI_EXTERN napi_status napi_detach_arraybuffer(napi_env env, - napi_value arraybuffer); +NAPI_EXTERN napi_status NAPI_CDECL +napi_detach_arraybuffer(napi_env env, napi_value arraybuffer); -NAPI_EXTERN napi_status napi_is_detached_arraybuffer(napi_env env, - napi_value value, - bool* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_is_detached_arraybuffer(napi_env env, napi_value value, bool* result); #endif // NAPI_VERSION >= 7 -#ifdef NAPI_EXPERIMENTAL +#if NAPI_VERSION >= 8 // Type tagging -NAPI_EXTERN napi_status napi_type_tag_object(napi_env env, - napi_value value, - const napi_type_tag* type_tag); +NAPI_EXTERN napi_status NAPI_CDECL napi_type_tag_object( + napi_env env, napi_value value, const napi_type_tag* type_tag); -NAPI_EXTERN napi_status +NAPI_EXTERN napi_status NAPI_CDECL napi_check_object_type_tag(napi_env env, napi_value value, const napi_type_tag* type_tag, bool* result); -#endif // NAPI_EXPERIMENTAL +NAPI_EXTERN napi_status NAPI_CDECL napi_object_freeze(napi_env env, + napi_value object); +NAPI_EXTERN napi_status NAPI_CDECL napi_object_seal(napi_env env, + napi_value object); +#endif // NAPI_VERSION >= 8 EXTERN_C_END diff --git a/libs/android/libnode/include/node/js_native_api_types.h b/libs/android/libnode/include/node/js_native_api_types.h index f139a1e2..376930ba 100644 --- a/libs/android/libnode/include/node/js_native_api_types.h +++ b/libs/android/libnode/include/node/js_native_api_types.h @@ -8,7 +8,15 @@ #include // NOLINT(modernize-deprecated-headers) #if !defined __cplusplus || (defined(_MSC_VER) && _MSC_VER < 1900) - typedef uint16_t char16_t; +typedef uint16_t char16_t; +#endif + +#ifndef NAPI_CDECL +#ifdef _WIN32 +#define NAPI_CDECL __cdecl +#else +#define NAPI_CDECL +#endif #endif // JSVM API types are all opaque pointers for ABI stability @@ -30,6 +38,14 @@ typedef enum { // Used with napi_define_class to distinguish static properties // from instance properties. Ignored by napi_define_properties. napi_static = 1 << 10, + +#if NAPI_VERSION >= 8 + // Default for class methods. + napi_default_method = napi_writable | napi_configurable, + + // Default for object properties, like in JS obj[prop]. + napi_default_jsproperty = napi_writable | napi_enumerable | napi_configurable, +#endif // NAPI_VERSION >= 8 } napi_property_attributes; typedef enum { @@ -82,17 +98,21 @@ typedef enum { napi_date_expected, napi_arraybuffer_expected, napi_detachable_arraybuffer_expected, + napi_would_deadlock // unused } napi_status; // Note: when adding a new enum value to `napi_status`, please also update -// `const int last_status` in `napi_get_last_error_info()' definition, -// in file js_native_api_v8.cc. Please also update the definition of -// `napi_status` in doc/api/n-api.md to reflect the newly added value(s). - -typedef napi_value (*napi_callback)(napi_env env, - napi_callback_info info); -typedef void (*napi_finalize)(napi_env env, - void* finalize_data, - void* finalize_hint); +// * `const int last_status` in the definition of `napi_get_last_error_info()' +// in file js_native_api_v8.cc. +// * `const char* error_messages[]` in file js_native_api_v8.cc with a brief +// message explaining the error. +// * the definition of `napi_status` in doc/api/n-api.md to reflect the newly +// added value(s). + +typedef napi_value(NAPI_CDECL* napi_callback)(napi_env env, + napi_callback_info info); +typedef void(NAPI_CDECL* napi_finalize)(napi_env env, + void* finalize_data, + void* finalize_hint); typedef struct { // One of utf8name or name should be NULL. @@ -136,11 +156,11 @@ typedef enum { } napi_key_conversion; #endif // NAPI_VERSION >= 6 -#ifdef NAPI_EXPERIMENTAL +#if NAPI_VERSION >= 8 typedef struct { uint64_t lower; uint64_t upper; } napi_type_tag; -#endif // NAPI_EXPERIMENTAL +#endif // NAPI_VERSION >= 8 #endif // SRC_JS_NATIVE_API_TYPES_H_ diff --git a/libs/android/libnode/include/node/libplatform/libplatform.h b/libs/android/libnode/include/node/libplatform/libplatform.h index 6908aeaa..00de81df 100644 --- a/libs/android/libnode/include/node/libplatform/libplatform.h +++ b/libs/android/libnode/include/node/libplatform/libplatform.h @@ -5,10 +5,12 @@ #ifndef V8_LIBPLATFORM_LIBPLATFORM_H_ #define V8_LIBPLATFORM_LIBPLATFORM_H_ +#include + #include "libplatform/libplatform-export.h" #include "libplatform/v8-tracing.h" -#include "v8-platform.h" // NOLINT(build/include) -#include "v8config.h" // NOLINT(build/include) +#include "v8-platform.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { namespace platform { @@ -41,13 +43,36 @@ V8_PLATFORM_EXPORT std::unique_ptr NewDefaultPlatform( InProcessStackDumping::kDisabled, std::unique_ptr tracing_controller = {}); +/** + * The same as NewDefaultPlatform but disables the worker thread pool. + * It must be used with the --single-threaded V8 flag. + */ +V8_PLATFORM_EXPORT std::unique_ptr +NewSingleThreadedDefaultPlatform( + IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled, + InProcessStackDumping in_process_stack_dumping = + InProcessStackDumping::kDisabled, + std::unique_ptr tracing_controller = {}); + +/** + * Returns a new instance of the default v8::JobHandle implementation. + * + * The job will be executed by spawning up to |num_worker_threads| many worker + * threads on the provided |platform| with the given |priority|. + */ +V8_PLATFORM_EXPORT std::unique_ptr NewDefaultJobHandle( + v8::Platform* platform, v8::TaskPriority priority, + std::unique_ptr job_task, size_t num_worker_threads); + /** * Pumps the message loop for the given isolate. * * The caller has to make sure that this is called from the right thread. - * Returns true if a task was executed, and false otherwise. Unless requested - * through the |behavior| parameter, this call does not block if no task is - * pending. The |platform| has to be created using |NewDefaultPlatform|. + * Returns true if a task was executed, and false otherwise. If the call to + * PumpMessageLoop is nested within another call to PumpMessageLoop, only + * nestable tasks may run. Otherwise, any task may run. Unless requested through + * the |behavior| parameter, this call does not block if no task is pending. The + * |platform| has to be created using |NewDefaultPlatform|. */ V8_PLATFORM_EXPORT bool PumpMessageLoop( v8::Platform* platform, v8::Isolate* isolate, @@ -70,11 +95,21 @@ V8_PLATFORM_EXPORT void RunIdleTasks(v8::Platform* platform, * The |platform| has to be created using |NewDefaultPlatform|. * */ -V8_PLATFORM_EXPORT V8_DEPRECATE_SOON( - "Access the DefaultPlatform directly", - void SetTracingController( - v8::Platform* platform, - v8::platform::tracing::TracingController* tracing_controller)); +V8_DEPRECATE_SOON("Access the DefaultPlatform directly") +V8_PLATFORM_EXPORT void SetTracingController( + v8::Platform* platform, + v8::platform::tracing::TracingController* tracing_controller); + +/** + * Notifies the given platform about the Isolate getting deleted soon. Has to be + * called for all Isolates which are deleted - unless we're shutting down the + * platform. + * + * The |platform| has to be created using |NewDefaultPlatform|. + * + */ +V8_PLATFORM_EXPORT void NotifyIsolateShutdown(v8::Platform* platform, + Isolate* isolate); } // namespace platform } // namespace v8 diff --git a/libs/android/libnode/include/node/libplatform/v8-tracing.h b/libs/android/libnode/include/node/libplatform/v8-tracing.h index df145e95..c7a5c4f9 100644 --- a/libs/android/libnode/include/node/libplatform/v8-tracing.h +++ b/libs/android/libnode/include/node/libplatform/v8-tracing.h @@ -12,9 +12,12 @@ #include #include "libplatform/libplatform-export.h" -#include "v8-platform.h" // NOLINT(build/include) +#include "v8-platform.h" // NOLINT(build/include_directory) namespace perfetto { +namespace trace_processor { +class TraceProcessorStorage; +} class TracingSession; } @@ -28,14 +31,13 @@ namespace platform { namespace tracing { class TraceEventListener; -class JSONTraceEventListener; const int kTraceMaxNumArgs = 2; class V8_PLATFORM_EXPORT TraceObject { public: union ArgValue { - bool as_bool; + V8_DEPRECATED("use as_uint ? true : false") bool as_bool; uint64_t as_uint; int64_t as_int; double as_double; @@ -123,6 +125,8 @@ class V8_PLATFORM_EXPORT TraceWriter { static TraceWriter* CreateJSONTraceWriter(std::ostream& stream, const std::string& tag); + static TraceWriter* CreateSystemInstrumentationTraceWriter(); + private: // Disallow copy and assign TraceWriter(const TraceWriter&) = delete; @@ -197,6 +201,9 @@ class V8_PLATFORM_EXPORT TraceConfig { TraceConfig() : enable_systrace_(false), enable_argument_filter_(false) {} TraceRecordMode GetTraceRecordMode() const { return record_mode_; } + const StringList& GetEnabledCategories() const { + return included_categories_; + } bool IsSystraceEnabled() const { return enable_systrace_; } bool IsArgumentFilterEnabled() const { return enable_argument_filter_; } @@ -229,6 +236,17 @@ class V8_PLATFORM_EXPORT TraceConfig { class V8_PLATFORM_EXPORT TracingController : public V8_PLATFORM_NON_EXPORTED_BASE(v8::TracingController) { public: + TracingController(); + ~TracingController() override; + +#if defined(V8_USE_PERFETTO) + // Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides + // the output stream for the JSON trace data. + void InitializeForPerfetto(std::ostream* output_stream); + // Provide an optional listener for testing that will receive trace events. + // Must be called before StartTracing(). + void SetTraceEventListenerForTesting(TraceEventListener* listener); +#else // defined(V8_USE_PERFETTO) // The pointer returned from GetCategoryGroupEnabled() points to a value with // zero or more of the following bits. Used in this class only. The // TRACE_EVENT macros should only use the value as a bool. These values must @@ -242,19 +260,8 @@ class V8_PLATFORM_EXPORT TracingController ENABLED_FOR_ETW_EXPORT = 1 << 3 }; - TracingController(); - ~TracingController() override; - // Takes ownership of |trace_buffer|. void Initialize(TraceBuffer* trace_buffer); -#ifdef V8_USE_PERFETTO - // Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides - // the output stream for the JSON trace data. - void InitializeForPerfetto(std::ostream* output_stream); - // Provide an optional listener for testing that will receive trace events. - // Must be called before StartTracing(). - void SetTraceEventListenerForTesting(TraceEventListener* listener); -#endif // v8::TracingController implementation. const uint8_t* GetCategoryGroupEnabled(const char* category_group) override; @@ -274,6 +281,10 @@ class V8_PLATFORM_EXPORT TracingController unsigned int flags, int64_t timestamp) override; void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, const char* name, uint64_t handle) override; + + static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag); +#endif // !defined(V8_USE_PERFETTO) + void AddTraceStateObserver( v8::TracingController::TraceStateObserver* observer) override; void RemoveTraceStateObserver( @@ -282,27 +293,32 @@ class V8_PLATFORM_EXPORT TracingController void StartTracing(TraceConfig* trace_config); void StopTracing(); - static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag); - protected: +#if !defined(V8_USE_PERFETTO) virtual int64_t CurrentTimestampMicroseconds(); virtual int64_t CurrentCpuTimestampMicroseconds(); +#endif // !defined(V8_USE_PERFETTO) private: +#if !defined(V8_USE_PERFETTO) void UpdateCategoryGroupEnabledFlag(size_t category_index); void UpdateCategoryGroupEnabledFlags(); +#endif // !defined(V8_USE_PERFETTO) - std::unique_ptr trace_buffer_; - std::unique_ptr trace_config_; std::unique_ptr mutex_; - std::unordered_set observers_; + std::unique_ptr trace_config_; std::atomic_bool recording_{false}; -#ifdef V8_USE_PERFETTO + std::unordered_set observers_; + +#if defined(V8_USE_PERFETTO) std::ostream* output_stream_ = nullptr; - std::unique_ptr json_listener_; + std::unique_ptr + trace_processor_; TraceEventListener* listener_for_testing_ = nullptr; std::unique_ptr tracing_session_; -#endif +#else // !defined(V8_USE_PERFETTO) + std::unique_ptr trace_buffer_; +#endif // !defined(V8_USE_PERFETTO) // Disallow copy and assign TracingController(const TracingController&) = delete; diff --git a/libs/android/libnode/include/node/node.h b/libs/android/libnode/include/node/node.h index 001d4972..4be002ac 100644 --- a/libs/android/libnode/include/node/node.h +++ b/libs/android/libnode/include/node/node.h @@ -32,6 +32,16 @@ # define NODE_EXTERN __attribute__((visibility("default"))) #endif +// Declarations annotated with NODE_EXTERN_PRIVATE do not form part of +// the public API. They are implementation details that can and will +// change between releases, even in semver patch releases. Do not use +// any such symbol in external code. +#ifdef NODE_SHARED_MODE +#define NODE_EXTERN_PRIVATE NODE_EXTERN +#else +#define NODE_EXTERN_PRIVATE +#endif + #ifdef BUILDING_NODE_EXTENSION # undef BUILDING_V8_SHARED # undef BUILDING_UV_SHARED @@ -60,14 +70,7 @@ # define SIGKILL 9 #endif -#if (__GNUC__ >= 8) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-function-type" -#endif #include "v8.h" // NOLINT(build/include_order) -#if (__GNUC__ >= 8) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif #include "v8-platform.h" // NOLINT(build/include_order) #include "node_version.h" // NODE_MODULE_VERSION @@ -75,6 +78,12 @@ #include #include +// We cannot use __POSIX__ in this header because that's only defined when +// building Node.js. +#ifndef _WIN32 +#include +#endif // _WIN32 + #define NODE_MAKE_VERSION(major, minor, patch) \ ((major) * 0x1000 + (minor) * 0x100 + (patch)) @@ -111,6 +120,8 @@ // Forward-declare libuv loop struct uv_loop_s; +struct napi_module; + // Forward-declare these functions now to stop MSVS from becoming // terminally confused when it's done in node_internals.h namespace node { @@ -213,31 +224,42 @@ namespace node { class IsolateData; class Environment; +namespace ProcessFlags { +enum Flags : uint64_t { + kNoFlags = 0, + // Enable stdio inheritance, which is disabled by default. + kEnableStdioInheritance = 1 << 0, + // Disable reading the NODE_OPTIONS environment variable. + kDisableNodeOptionsEnv = 1 << 1, + // Do not parse CLI options. + kDisableCLIOptions = 1 << 2, + // Do not initialize ICU. + kNoICU = 1 << 3, +}; +} // namespace ProcessFlags + // TODO(addaleax): Officially deprecate this and replace it with something // better suited for a public embedder API. NODE_EXTERN int Start(int argc, char* argv[]); // Tear down Node.js while it is running (there are active handles -// in the loop and / or actively executing JavaScript code). This also stops -// all Workers that may have been started earlier. +// in the loop and / or actively executing JavaScript code). NODE_EXTERN int Stop(Environment* env); -// TODO(addaleax): Officially deprecate this and replace it with something -// better suited for a public embedder API. -// It is recommended to use InitializeNodeWithArgs() instead as an embedder. -// Init() calls InitializeNodeWithArgs() and exits the process with the exit -// code returned from it. -NODE_EXTERN void Init(int* argc, - const char** argv, - int* exec_argc, - const char*** exec_argv); // Set up per-process state needed to run Node.js. This will consume arguments // from argv, fill exec_argv, and possibly add errors resulting from parsing // the arguments to `errors`. The return value is a suggested exit code for the // program; If it is 0, then initializing Node.js succeeded. -NODE_EXTERN int InitializeNodeWithArgs(std::vector* argv, - std::vector* exec_argv, - std::vector* errors); +NODE_EXTERN int InitializeNodeWithArgs( + std::vector* argv, + std::vector* exec_argv, + std::vector* errors); +// TODO(zcbenz): Turn above overloaded version into below's default argument. +NODE_EXTERN int InitializeNodeWithArgs( + std::vector* argv, + std::vector* exec_argv, + std::vector* errors, + ProcessFlags::Flags flags); enum OptionEnvvarSettings { kAllowedInEnvironment, @@ -276,6 +298,12 @@ class NODE_EXTERN ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { NODE_EXTERN ArrayBufferAllocator* CreateArrayBufferAllocator(); NODE_EXTERN void FreeArrayBufferAllocator(ArrayBufferAllocator* allocator); +class NODE_EXTERN IsolatePlatformDelegate { + public: + virtual std::shared_ptr GetForegroundTaskRunner() = 0; + virtual bool IdleTasksEnabled() = 0; +}; + class NODE_EXTERN MultiIsolatePlatform : public v8::Platform { public: ~MultiIsolatePlatform() override = default; @@ -285,11 +313,6 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform { virtual bool FlushForegroundTasks(v8::Isolate* isolate) = 0; virtual void DrainTasks(v8::Isolate* isolate) = 0; - // TODO(addaleax): Remove this, it is unnecessary. - // This would currently be called before `UnregisterIsolate()` but will be - // folded into it in the future. - virtual void CancelPendingDelayedTasks(v8::Isolate* isolate); - // This needs to be called between the calls to `Isolate::Allocate()` and // `Isolate::Initialize()`, so that initialization can already start // using the platform. @@ -297,6 +320,12 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform { // This function may only be called once per `Isolate`. virtual void RegisterIsolate(v8::Isolate* isolate, struct uv_loop_s* loop) = 0; + // This method can be used when an application handles task scheduling on its + // own through `IsolatePlatformDelegate`. Upon registering an isolate with + // this overload any other method in this class with the exception of + // `UnregisterIsolate` *must not* be used on that isolate. + virtual void RegisterIsolate(v8::Isolate* isolate, + IsolatePlatformDelegate* delegate) = 0; // This function may only be called once per `Isolate`, and discard any // pending delayed tasks scheduled for that isolate. @@ -318,7 +347,8 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform { enum IsolateSettingsFlags { MESSAGE_LISTENER_WITH_ERROR_LEVEL = 1 << 0, DETAILED_SOURCE_POSITIONS_FOR_PROFILING = 1 << 1, - SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK = 1 << 2 + SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK = 1 << 2, + SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK = 1 << 3 }; struct IsolateSettings { @@ -336,8 +366,6 @@ struct IsolateSettings { v8::PromiseRejectCallback promise_reject_callback = nullptr; v8::AllowWasmCodeGenerationCallback allow_wasm_code_generation_callback = nullptr; - v8::HostCleanupFinalizationGroupCallback - host_cleanup_finalization_group_callback = nullptr; }; // Overriding IsolateSettings may produce unexpected behavior @@ -353,11 +381,13 @@ NODE_EXTERN void SetIsolateUpForNode(v8::Isolate* isolate); // This is a convenience method equivalent to using SetIsolateCreateParams(), // Isolate::Allocate(), MultiIsolatePlatform::RegisterIsolate(), // Isolate::Initialize(), and SetIsolateUpForNode(). -NODE_EXTERN v8::Isolate* NewIsolate(ArrayBufferAllocator* allocator, - struct uv_loop_s* event_loop); NODE_EXTERN v8::Isolate* NewIsolate(ArrayBufferAllocator* allocator, struct uv_loop_s* event_loop, - MultiIsolatePlatform* platform); + MultiIsolatePlatform* platform = nullptr); +NODE_EXTERN v8::Isolate* NewIsolate( + std::shared_ptr allocator, + struct uv_loop_s* event_loop, + MultiIsolatePlatform* platform); // Creates a new context with Node.js-specific tweaks. NODE_EXTERN v8::Local NewContext( @@ -403,7 +433,27 @@ enum Flags : uint64_t { kNoRegisterESMLoader = 1 << 3, // Set this flag to make Node.js track "raw" file descriptors, i.e. managed // by fs.open() and fs.close(), and close them during FreeEnvironment(). - kTrackUnmanagedFds = 1 << 4 + kTrackUnmanagedFds = 1 << 4, + // Set this flag to force hiding console windows when spawning child + // processes. This is usually used when embedding Node.js in GUI programs on + // Windows. + kHideConsoleWindows = 1 << 5, + // Set this flag to disable loading native addons via `process.dlopen`. + // This environment flag is especially important for worker threads + // so that a worker thread can't load a native addon even if `execArgv` + // is overwritten and `--no-addons` is not specified but was specified + // for this Environment instance. + kNoNativeAddons = 1 << 6, + // Set this flag to disable searching modules from global paths like + // $HOME/.node_modules and $NODE_PATH. This is used by standalone apps that + // do not expect to have their behaviors changed because of globally + // installed modules. + kNoGlobalSearchPaths = 1 << 7, + // Controls whether or not the Environment should call V8Inspector::create(). + // This control is needed by embedders who may not want to initialize the V8 + // inspector in situations where one has already been created, + // e.g. Blink's in Chromium. + kNoCreateInspector = 1 << 9 }; } // namespace EnvironmentFlags @@ -414,13 +464,6 @@ struct InspectorParentHandle { // TODO(addaleax): Maybe move per-Environment options parsing here. // Returns nullptr when the Environment cannot be created e.g. there are // pending JavaScript exceptions. -// It is recommended to use the second variant taking a flags argument. -NODE_EXTERN Environment* CreateEnvironment(IsolateData* isolate_data, - v8::Local context, - int argc, - const char* const* argv, - int exec_argc, - const char* const* exec_argv); NODE_EXTERN Environment* CreateEnvironment( IsolateData* isolate_data, v8::Local context, @@ -450,18 +493,12 @@ struct StartExecutionCallbackInfo { using StartExecutionCallback = std::function(const StartExecutionCallbackInfo&)>; -// TODO(addaleax): Deprecate this in favour of the MaybeLocal<> overload. -NODE_EXTERN void LoadEnvironment(Environment* env); -// The `InspectorParentHandle` arguments here are ignored and not used. -// For passing `InspectorParentHandle`, use `CreateEnvironment()`. NODE_EXTERN v8::MaybeLocal LoadEnvironment( Environment* env, - StartExecutionCallback cb, - std::unique_ptr ignored_donotuse_removeme = {}); + StartExecutionCallback cb); NODE_EXTERN v8::MaybeLocal LoadEnvironment( Environment* env, - const char* main_script_source_utf8, - std::unique_ptr ignored_donotuse_removeme = {}); + const char* main_script_source_utf8); NODE_EXTERN void FreeEnvironment(Environment* env); // Set a callback that is called when process.exit() is called from JS, @@ -469,8 +506,8 @@ NODE_EXTERN void FreeEnvironment(Environment* env); // It receives the Environment* instance and the exit code as arguments. // This could e.g. call Stop(env); in order to terminate execution and stop // the event loop. -// The default handler calls Stop(), disposes of the global V8 platform -// instance, if one is being used, and calls exit(). +// The default handler disposes of the global V8 platform instance, if one is +// being used, and calls exit(). NODE_EXTERN void SetProcessExitHandler( Environment* env, std::function&& handler); @@ -478,26 +515,30 @@ NODE_EXTERN void DefaultProcessExitHandler(Environment* env, int exit_code); // This may return nullptr if context is not associated with a Node instance. NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local context); +NODE_EXTERN IsolateData* GetEnvironmentIsolateData(Environment* env); +NODE_EXTERN ArrayBufferAllocator* GetArrayBufferAllocator(IsolateData* data); + +NODE_EXTERN void OnFatalError(const char* location, const char* message); +NODE_EXTERN void PromiseRejectCallback(v8::PromiseRejectMessage message); +NODE_EXTERN bool AllowWasmCodeGenerationCallback(v8::Local context, + v8::Local); +NODE_EXTERN bool ShouldAbortOnUncaughtException(v8::Isolate* isolate); +NODE_EXTERN v8::MaybeLocal PrepareStackTraceCallback( + v8::Local context, + v8::Local exception, + v8::Local trace); -// This returns the MultiIsolatePlatform used in the main thread of Node.js. -// If NODE_USE_V8_PLATFORM has not been defined when Node.js was built, -// it returns nullptr. -// TODO(addaleax): Deprecate in favour of GetMultiIsolatePlatform(). -NODE_EXTERN MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform(); // This returns the MultiIsolatePlatform used for an Environment or IsolateData // instance, if one exists. NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env); NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env); -// Legacy variants of MultiIsolatePlatform::Create(). -// TODO(addaleax): Deprecate in favour of the v8::TracingController variant. -NODE_EXTERN MultiIsolatePlatform* CreatePlatform( - int thread_pool_size, - node::tracing::TracingController* tracing_controller); -NODE_EXTERN MultiIsolatePlatform* CreatePlatform( - int thread_pool_size, - v8::TracingController* tracing_controller); -NODE_EXTERN void FreePlatform(MultiIsolatePlatform* platform); +NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead", + NODE_EXTERN MultiIsolatePlatform* CreatePlatform( + int thread_pool_size, + v8::TracingController* tracing_controller)); +NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead", + NODE_EXTERN void FreePlatform(MultiIsolatePlatform* platform)); // Get/set the currently active tracing controller. Using CreatePlatform() // will implicitly set this by default. This is global and should be initialized @@ -508,14 +549,92 @@ NODE_EXTERN void FreePlatform(MultiIsolatePlatform* platform); NODE_EXTERN v8::TracingController* GetTracingController(); NODE_EXTERN void SetTracingController(v8::TracingController* controller); -NODE_EXTERN void EmitBeforeExit(Environment* env); -NODE_EXTERN int EmitExit(Environment* env); +// Run `process.emit('beforeExit')` as it would usually happen when Node.js is +// run in standalone mode. +NODE_EXTERN v8::Maybe EmitProcessBeforeExit(Environment* env); +NODE_DEPRECATED("Use Maybe version (EmitProcessBeforeExit) instead", + NODE_EXTERN void EmitBeforeExit(Environment* env)); +// Run `process.emit('exit')` as it would usually happen when Node.js is run +// in standalone mode. The return value corresponds to the exit code. +NODE_EXTERN v8::Maybe EmitProcessExit(Environment* env); +NODE_DEPRECATED("Use Maybe version (EmitProcessExit) instead", + NODE_EXTERN int EmitExit(Environment* env)); + +// Runs hooks added through `AtExit()`. This is part of `FreeEnvironment()`, +// so calling it manually is typically not necessary. NODE_EXTERN void RunAtExit(Environment* env); // This may return nullptr if the current v8::Context is not associated // with a Node instance. NODE_EXTERN struct uv_loop_s* GetCurrentEventLoop(v8::Isolate* isolate); +// Runs the main loop for a given Environment. This roughly performs the +// following steps: +// 1. Call uv_run() on the event loop until it is drained. +// 2. Call platform->DrainTasks() on the associated platform/isolate. +// 3. If the event loop is alive again, go to Step 1. +// 4. Call EmitProcessBeforeExit(). +// 5. If the event loop is alive again, go to Step 1. +// 6. Call EmitProcessExit() and forward the return value. +// If at any point node::Stop() is called, the function will attempt to return +// as soon as possible, returning an empty `Maybe`. +// This function only works if `env` has an associated `MultiIsolatePlatform`. +NODE_EXTERN v8::Maybe SpinEventLoop(Environment* env); + +class NODE_EXTERN CommonEnvironmentSetup { + public: + ~CommonEnvironmentSetup(); + + // Create a new CommonEnvironmentSetup, that is, a group of objects that + // together form the typical setup for a single Node.js Environment instance. + // If any error occurs, `*errors` will be populated and the returned pointer + // will be empty. + // env_args will be passed through as arguments to CreateEnvironment(), after + // `isolate_data` and `context`. + template + static std::unique_ptr Create( + MultiIsolatePlatform* platform, + std::vector* errors, + EnvironmentArgs&&... env_args); + + struct uv_loop_s* event_loop() const; + std::shared_ptr array_buffer_allocator() const; + v8::Isolate* isolate() const; + IsolateData* isolate_data() const; + Environment* env() const; + v8::Local context() const; + + CommonEnvironmentSetup(const CommonEnvironmentSetup&) = delete; + CommonEnvironmentSetup& operator=(const CommonEnvironmentSetup&) = delete; + CommonEnvironmentSetup(CommonEnvironmentSetup&&) = delete; + CommonEnvironmentSetup& operator=(CommonEnvironmentSetup&&) = delete; + + private: + struct Impl; + Impl* impl_; + CommonEnvironmentSetup( + MultiIsolatePlatform*, + std::vector*, + std::function); +}; + +// Implementation for CommonEnvironmentSetup::Create +template +std::unique_ptr CommonEnvironmentSetup::Create( + MultiIsolatePlatform* platform, + std::vector* errors, + EnvironmentArgs&&... env_args) { + auto ret = std::unique_ptr(new CommonEnvironmentSetup( + platform, errors, + [&](const CommonEnvironmentSetup* setup) -> Environment* { + return CreateEnvironment( + setup->isolate_data(), setup->context(), + std::forward(env_args)...); + })); + if (!errors->empty()) ret.reset(); + return ret; +} + /* Converts a unixtime to V8 Date */ NODE_DEPRECATED("Use v8::Date::New() directly", inline v8::Local NODE_UNIXTIME_V8(double time) { @@ -619,7 +738,18 @@ inline void NODE_SET_PROTOTYPE_METHOD(v8::Local recv, #define NODE_SET_PROTOTYPE_METHOD node::NODE_SET_PROTOTYPE_METHOD // BINARY is a deprecated alias of LATIN1. -enum encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER, LATIN1 = BINARY}; +// BASE64URL is not currently exposed to the JavaScript side. +enum encoding { + ASCII, + UTF8, + BASE64, + UCS2, + BINARY, + HEX, + BUFFER, + BASE64URL, + LATIN1 = BINARY +}; NODE_EXTERN enum encoding ParseEncoding( v8::Isolate* isolate, @@ -704,11 +834,13 @@ extern "C" NODE_EXTERN void node_module_register(void* mod); #endif #if defined(_MSC_VER) -#pragma section(".CRT$XCU", read) #define NODE_C_CTOR(fn) \ NODE_CTOR_PREFIX void __cdecl fn(void); \ - __declspec(dllexport, allocate(".CRT$XCU")) \ - void (__cdecl*fn ## _)(void) = fn; \ + namespace { \ + struct fn##_ { \ + fn##_() { fn(); }; \ + } fn##_v_; \ + } \ NODE_CTOR_PREFIX void __cdecl fn(void) #else #define NODE_C_CTOR(fn) \ @@ -805,21 +937,13 @@ extern "C" NODE_EXTERN void node_module_register(void* mod); // In each variant, the registration function needs to be usable at least for // the time during which the Environment exists. NODE_EXTERN void AddLinkedBinding(Environment* env, const node_module& mod); +NODE_EXTERN void AddLinkedBinding(Environment* env, + const struct napi_module& mod); NODE_EXTERN void AddLinkedBinding(Environment* env, const char* name, addon_context_register_func fn, void* priv); -/* Called after the event loop exits but before the VM is disposed. - * Callbacks are run in reverse order of registration, i.e. newest first. - * - * You should always use the three-argument variant (or, for addons, - * AddEnvironmentCleanupHook) in order to avoid relying on global state. - */ -NODE_DEPRECATED( - "Use the three-argument variant of AtExit() or AddEnvironmentCleanupHook()", - NODE_EXTERN void AtExit(void (*cb)(void* arg), void* arg = nullptr)); - /* Registers a callback with the passed-in Environment instance. The callback * is called after the event loop exits, but before the VM is disposed. * Callbacks are run in reverse order of registration, i.e. newest first. @@ -827,12 +951,6 @@ NODE_DEPRECATED( NODE_EXTERN void AtExit(Environment* env, void (*cb)(void* arg), void* arg); -NODE_DEPRECATED( - "Use the three-argument variant of AtExit() or AddEnvironmentCleanupHook()", - inline void AtExit(Environment* env, - void (*cb)(void* arg)) { - AtExit(env, cb, nullptr); - }) typedef double async_id; struct async_context { @@ -860,12 +978,26 @@ struct ACHHandle; struct NODE_EXTERN DeleteACHHandle { void operator()(ACHHandle*) const; }; typedef std::unique_ptr AsyncCleanupHookHandle; -NODE_EXTERN AsyncCleanupHookHandle AddEnvironmentCleanupHook( +/* This function is not intended to be used externally, it exists to aid in + * keeping ABI compatibility between Node and Electron. */ +NODE_EXTERN ACHHandle* AddEnvironmentCleanupHookInternal( v8::Isolate* isolate, void (*fun)(void* arg, void (*cb)(void*), void* cbarg), void* arg); +inline AsyncCleanupHookHandle AddEnvironmentCleanupHook( + v8::Isolate* isolate, + void (*fun)(void* arg, void (*cb)(void*), void* cbarg), + void* arg) { + return AsyncCleanupHookHandle(AddEnvironmentCleanupHookInternal(isolate, fun, + arg)); +} -NODE_EXTERN void RemoveEnvironmentCleanupHook(AsyncCleanupHookHandle holder); +/* This function is not intended to be used externally, it exists to aid in + * keeping ABI compatibility between Node and Electron. */ +NODE_EXTERN void RemoveEnvironmentCleanupHookInternal(ACHHandle* holder); +inline void RemoveEnvironmentCleanupHook(AsyncCleanupHookHandle holder) { + RemoveEnvironmentCleanupHookInternal(holder.get()); +} /* Returns the id of the current execution context. If the return value is * zero then no execution has been set. This will happen if the user handles @@ -925,6 +1057,9 @@ class NODE_EXTERN CallbackScope { CallbackScope(v8::Isolate* isolate, v8::Local resource, async_context asyncContext); + CallbackScope(Environment* env, + v8::Local resource, + async_context asyncContext); ~CallbackScope(); void operator=(const CallbackScope&) = delete; @@ -1015,6 +1150,21 @@ class NODE_EXTERN AsyncResource { async_context async_context_; }; +#ifndef _WIN32 +// Register a signal handler without interrupting any handlers that node +// itself needs. This does override handlers registered through +// process.on('SIG...', function() { ... }). The `reset_handler` flag indicates +// whether the signal handler for the given signal should be reset to its +// default value before executing the handler (i.e. it works like SA_RESETHAND). +// The `reset_handler` flag is invalid when `signal` is SIGSEGV. +NODE_EXTERN +void RegisterSignalHandler(int signal, + void (*handler)(int signal, + siginfo_t* info, + void* ucontext), + bool reset_handler = false); +#endif // _WIN32 + } // namespace node #endif // SRC_NODE_H_ diff --git a/libs/android/libnode/include/node/node_api.h b/libs/android/libnode/include/node/node_api.h index 577a1dcd..982b41ca 100644 --- a/libs/android/libnode/include/node/node_api.h +++ b/libs/android/libnode/include/node/node_api.h @@ -2,12 +2,12 @@ #define SRC_NODE_API_H_ #ifdef BUILDING_NODE_EXTENSION - #ifdef _WIN32 - // Building native module against node - #define NAPI_EXTERN __declspec(dllimport) - #elif defined(__wasm32__) - #define NAPI_EXTERN __attribute__((__import_module__("napi"))) - #endif +#ifdef _WIN32 +// Building native module against node +#define NAPI_EXTERN __declspec(dllimport) +#elif defined(__wasm32__) +#define NAPI_EXTERN __attribute__((__import_module__("napi"))) +#endif #endif #include "js_native_api.h" #include "node_api_types.h" @@ -15,23 +15,23 @@ struct uv_loop_s; // Forward declaration. #ifdef _WIN32 -# define NAPI_MODULE_EXPORT __declspec(dllexport) +#define NAPI_MODULE_EXPORT __declspec(dllexport) #else -# define NAPI_MODULE_EXPORT __attribute__((visibility("default"))) +#define NAPI_MODULE_EXPORT __attribute__((visibility("default"))) #endif #if defined(__GNUC__) -# define NAPI_NO_RETURN __attribute__((noreturn)) +#define NAPI_NO_RETURN __attribute__((noreturn)) #elif defined(_WIN32) -# define NAPI_NO_RETURN __declspec(noreturn) +#define NAPI_NO_RETURN __declspec(noreturn) #else -# define NAPI_NO_RETURN +#define NAPI_NO_RETURN #endif -typedef napi_value (*napi_addon_register_func)(napi_env env, - napi_value exports); +typedef napi_value(NAPI_CDECL* napi_addon_register_func)(napi_env env, + napi_value exports); -typedef struct { +typedef struct napi_module { int nm_version; unsigned int nm_flags; const char* nm_filename; @@ -41,36 +41,50 @@ typedef struct { void* reserved[4]; } napi_module; -#define NAPI_MODULE_VERSION 1 +#define NAPI_MODULE_VERSION 1 #if defined(_MSC_VER) +#if defined(__cplusplus) +#define NAPI_C_CTOR(fn) \ + static void NAPI_CDECL fn(void); \ + namespace { \ + struct fn##_ { \ + fn##_() { fn(); } \ + } fn##_v_; \ + } \ + static void NAPI_CDECL fn(void) +#else // !defined(__cplusplus) #pragma section(".CRT$XCU", read) -#define NAPI_C_CTOR(fn) \ - static void __cdecl fn(void); \ - __declspec(dllexport, allocate(".CRT$XCU")) void(__cdecl * fn##_)(void) = \ - fn; \ - static void __cdecl fn(void) +// The NAPI_C_CTOR macro defines a function fn that is called during CRT +// initialization. +// C does not support dynamic initialization of static variables and this code +// simulates C++ behavior. Exporting the function pointer prevents it from being +// optimized. See for details: +// https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-initialization?view=msvc-170 +#define NAPI_C_CTOR(fn) \ + static void NAPI_CDECL fn(void); \ + __declspec(dllexport, allocate(".CRT$XCU")) void(NAPI_CDECL * fn##_)(void) = \ + fn; \ + static void NAPI_CDECL fn(void) +#endif // defined(__cplusplus) #else -#define NAPI_C_CTOR(fn) \ - static void fn(void) __attribute__((constructor)); \ +#define NAPI_C_CTOR(fn) \ + static void fn(void) __attribute__((constructor)); \ static void fn(void) #endif -#define NAPI_MODULE_X(modname, regfunc, priv, flags) \ - EXTERN_C_START \ - static napi_module _module = \ - { \ - NAPI_MODULE_VERSION, \ - flags, \ - __FILE__, \ - regfunc, \ - #modname, \ - priv, \ - {0}, \ - }; \ - NAPI_C_CTOR(_register_ ## modname) { \ - napi_module_register(&_module); \ - } \ +#define NAPI_MODULE_X(modname, regfunc, priv, flags) \ + EXTERN_C_START \ + static napi_module _module = { \ + NAPI_MODULE_VERSION, \ + flags, \ + __FILE__, \ + regfunc, \ + #modname, \ + priv, \ + {0}, \ + }; \ + NAPI_C_CTOR(_register_##modname) { napi_module_register(&_module); } \ EXTERN_C_END #define NAPI_MODULE_INITIALIZER_X(base, version) \ @@ -88,123 +102,124 @@ typedef struct { } \ EXTERN_C_END #else -#define NAPI_MODULE(modname, regfunc) \ +#define NAPI_MODULE(modname, regfunc) \ NAPI_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) #endif #define NAPI_MODULE_INITIALIZER_BASE napi_register_module_v -#define NAPI_MODULE_INITIALIZER \ - NAPI_MODULE_INITIALIZER_X(NAPI_MODULE_INITIALIZER_BASE, \ - NAPI_MODULE_VERSION) +#define NAPI_MODULE_INITIALIZER \ + NAPI_MODULE_INITIALIZER_X(NAPI_MODULE_INITIALIZER_BASE, NAPI_MODULE_VERSION) -#define NAPI_MODULE_INIT() \ - EXTERN_C_START \ - NAPI_MODULE_EXPORT napi_value \ - NAPI_MODULE_INITIALIZER(napi_env env, napi_value exports); \ - EXTERN_C_END \ - NAPI_MODULE(NODE_GYP_MODULE_NAME, NAPI_MODULE_INITIALIZER) \ - napi_value NAPI_MODULE_INITIALIZER(napi_env env, \ - napi_value exports) +#define NAPI_MODULE_INIT() \ + EXTERN_C_START \ + NAPI_MODULE_EXPORT napi_value NAPI_MODULE_INITIALIZER(napi_env env, \ + napi_value exports); \ + EXTERN_C_END \ + NAPI_MODULE(NODE_GYP_MODULE_NAME, NAPI_MODULE_INITIALIZER) \ + napi_value NAPI_MODULE_INITIALIZER(napi_env env, napi_value exports) EXTERN_C_START -NAPI_EXTERN void napi_module_register(napi_module* mod); +NAPI_EXTERN void NAPI_CDECL napi_module_register(napi_module* mod); -NAPI_EXTERN NAPI_NO_RETURN void napi_fatal_error(const char* location, - size_t location_len, - const char* message, - size_t message_len); +NAPI_EXTERN NAPI_NO_RETURN void NAPI_CDECL +napi_fatal_error(const char* location, + size_t location_len, + const char* message, + size_t message_len); // Methods for custom handling of async operations -NAPI_EXTERN napi_status napi_async_init(napi_env env, - napi_value async_resource, - napi_value async_resource_name, - napi_async_context* result); - -NAPI_EXTERN napi_status napi_async_destroy(napi_env env, - napi_async_context async_context); - -NAPI_EXTERN napi_status napi_make_callback(napi_env env, - napi_async_context async_context, - napi_value recv, - napi_value func, - size_t argc, - const napi_value* argv, - napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_async_init(napi_env env, + napi_value async_resource, + napi_value async_resource_name, + napi_async_context* result); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_async_destroy(napi_env env, napi_async_context async_context); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_make_callback(napi_env env, + napi_async_context async_context, + napi_value recv, + napi_value func, + size_t argc, + const napi_value* argv, + napi_value* result); // Methods to provide node::Buffer functionality with napi types -NAPI_EXTERN napi_status napi_create_buffer(napi_env env, - size_t length, - void** data, - napi_value* result); -NAPI_EXTERN napi_status napi_create_external_buffer(napi_env env, - size_t length, - void* data, - napi_finalize finalize_cb, - void* finalize_hint, - napi_value* result); -NAPI_EXTERN napi_status napi_create_buffer_copy(napi_env env, - size_t length, - const void* data, - void** result_data, - napi_value* result); -NAPI_EXTERN napi_status napi_is_buffer(napi_env env, - napi_value value, - bool* result); -NAPI_EXTERN napi_status napi_get_buffer_info(napi_env env, - napi_value value, - void** data, - size_t* length); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_buffer(napi_env env, + size_t length, + void** data, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_external_buffer(napi_env env, + size_t length, + void* data, + napi_finalize finalize_cb, + void* finalize_hint, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_create_buffer_copy(napi_env env, + size_t length, + const void* data, + void** result_data, + napi_value* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_is_buffer(napi_env env, + napi_value value, + bool* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_buffer_info(napi_env env, + napi_value value, + void** data, + size_t* length); // Methods to manage simple async operations -NAPI_EXTERN -napi_status napi_create_async_work(napi_env env, - napi_value async_resource, - napi_value async_resource_name, - napi_async_execute_callback execute, - napi_async_complete_callback complete, - void* data, - napi_async_work* result); -NAPI_EXTERN napi_status napi_delete_async_work(napi_env env, - napi_async_work work); -NAPI_EXTERN napi_status napi_queue_async_work(napi_env env, - napi_async_work work); -NAPI_EXTERN napi_status napi_cancel_async_work(napi_env env, - napi_async_work work); +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_async_work(napi_env env, + napi_value async_resource, + napi_value async_resource_name, + napi_async_execute_callback execute, + napi_async_complete_callback complete, + void* data, + napi_async_work* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_delete_async_work(napi_env env, + napi_async_work work); +NAPI_EXTERN napi_status NAPI_CDECL napi_queue_async_work(napi_env env, + napi_async_work work); +NAPI_EXTERN napi_status NAPI_CDECL napi_cancel_async_work(napi_env env, + napi_async_work work); // version management -NAPI_EXTERN -napi_status napi_get_node_version(napi_env env, - const napi_node_version** version); +NAPI_EXTERN napi_status NAPI_CDECL +napi_get_node_version(napi_env env, const napi_node_version** version); #if NAPI_VERSION >= 2 // Return the current libuv event loop for a given environment -NAPI_EXTERN napi_status napi_get_uv_event_loop(napi_env env, - struct uv_loop_s** loop); +NAPI_EXTERN napi_status NAPI_CDECL +napi_get_uv_event_loop(napi_env env, struct uv_loop_s** loop); #endif // NAPI_VERSION >= 2 #if NAPI_VERSION >= 3 -NAPI_EXTERN napi_status napi_fatal_exception(napi_env env, napi_value err); +NAPI_EXTERN napi_status NAPI_CDECL napi_fatal_exception(napi_env env, + napi_value err); -NAPI_EXTERN napi_status napi_add_env_cleanup_hook(napi_env env, - void (*fun)(void* arg), - void* arg); +NAPI_EXTERN napi_status NAPI_CDECL napi_add_env_cleanup_hook( + napi_env env, void(NAPI_CDECL* fun)(void* arg), void* arg); -NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(napi_env env, - void (*fun)(void* arg), - void* arg); +NAPI_EXTERN napi_status NAPI_CDECL napi_remove_env_cleanup_hook( + napi_env env, void(NAPI_CDECL* fun)(void* arg), void* arg); -NAPI_EXTERN napi_status napi_open_callback_scope(napi_env env, - napi_value resource_object, - napi_async_context context, - napi_callback_scope* result); +NAPI_EXTERN napi_status NAPI_CDECL +napi_open_callback_scope(napi_env env, + napi_value resource_object, + napi_async_context context, + napi_callback_scope* result); -NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env, - napi_callback_scope scope); +NAPI_EXTERN napi_status NAPI_CDECL +napi_close_callback_scope(napi_env env, napi_callback_scope scope); #endif // NAPI_VERSION >= 3 @@ -212,7 +227,7 @@ NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env, #ifndef __wasm32__ // Calling into JS from other threads -NAPI_EXTERN napi_status +NAPI_EXTERN napi_status NAPI_CDECL napi_create_threadsafe_function(napi_env env, napi_value func, napi_value async_resource, @@ -225,41 +240,46 @@ napi_create_threadsafe_function(napi_env env, napi_threadsafe_function_call_js call_js_cb, napi_threadsafe_function* result); -NAPI_EXTERN napi_status -napi_get_threadsafe_function_context(napi_threadsafe_function func, - void** result); +NAPI_EXTERN napi_status NAPI_CDECL napi_get_threadsafe_function_context( + napi_threadsafe_function func, void** result); -NAPI_EXTERN napi_status +NAPI_EXTERN napi_status NAPI_CDECL napi_call_threadsafe_function(napi_threadsafe_function func, void* data, napi_threadsafe_function_call_mode is_blocking); -NAPI_EXTERN napi_status +NAPI_EXTERN napi_status NAPI_CDECL napi_acquire_threadsafe_function(napi_threadsafe_function func); -NAPI_EXTERN napi_status -napi_release_threadsafe_function(napi_threadsafe_function func, - napi_threadsafe_function_release_mode mode); +NAPI_EXTERN napi_status NAPI_CDECL napi_release_threadsafe_function( + napi_threadsafe_function func, napi_threadsafe_function_release_mode mode); -NAPI_EXTERN napi_status +NAPI_EXTERN napi_status NAPI_CDECL napi_unref_threadsafe_function(napi_env env, napi_threadsafe_function func); -NAPI_EXTERN napi_status +NAPI_EXTERN napi_status NAPI_CDECL napi_ref_threadsafe_function(napi_env env, napi_threadsafe_function func); #endif // __wasm32__ #endif // NAPI_VERSION >= 4 -#ifdef NAPI_EXPERIMENTAL +#if NAPI_VERSION >= 8 + +NAPI_EXTERN napi_status NAPI_CDECL +napi_add_async_cleanup_hook(napi_env env, + napi_async_cleanup_hook hook, + void* arg, + napi_async_cleanup_hook_handle* remove_handle); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_remove_async_cleanup_hook(napi_async_cleanup_hook_handle remove_handle); -NAPI_EXTERN napi_status napi_add_async_cleanup_hook( - napi_env env, - napi_async_cleanup_hook hook, - void* arg, - napi_async_cleanup_hook_handle* remove_handle); +#endif // NAPI_VERSION >= 8 + +#ifdef NAPI_EXPERIMENTAL -NAPI_EXTERN napi_status napi_remove_async_cleanup_hook( - napi_async_cleanup_hook_handle remove_handle); +NAPI_EXTERN napi_status NAPI_CDECL +node_api_get_module_file_name(napi_env env, const char** result); #endif // NAPI_EXPERIMENTAL diff --git a/libs/android/libnode/include/node/node_api_types.h b/libs/android/libnode/include/node/node_api_types.h index 0e400e96..42319947 100644 --- a/libs/android/libnode/include/node/node_api_types.h +++ b/libs/android/libnode/include/node/node_api_types.h @@ -22,16 +22,13 @@ typedef enum { } napi_threadsafe_function_call_mode; #endif // NAPI_VERSION >= 4 -typedef void (*napi_async_execute_callback)(napi_env env, - void* data); -typedef void (*napi_async_complete_callback)(napi_env env, - napi_status status, - void* data); +typedef void(NAPI_CDECL* napi_async_execute_callback)(napi_env env, void* data); +typedef void(NAPI_CDECL* napi_async_complete_callback)(napi_env env, + napi_status status, + void* data); #if NAPI_VERSION >= 4 -typedef void (*napi_threadsafe_function_call_js)(napi_env env, - napi_value js_callback, - void* context, - void* data); +typedef void(NAPI_CDECL* napi_threadsafe_function_call_js)( + napi_env env, napi_value js_callback, void* context, void* data); #endif // NAPI_VERSION >= 4 typedef struct { @@ -41,10 +38,10 @@ typedef struct { const char* release; } napi_node_version; -#ifdef NAPI_EXPERIMENTAL +#if NAPI_VERSION >= 8 typedef struct napi_async_cleanup_hook_handle__* napi_async_cleanup_hook_handle; -typedef void (*napi_async_cleanup_hook)(napi_async_cleanup_hook_handle handle, - void* data); -#endif // NAPI_EXPERIMENTAL +typedef void(NAPI_CDECL* napi_async_cleanup_hook)( + napi_async_cleanup_hook_handle handle, void* data); +#endif // NAPI_VERSION >= 8 #endif // SRC_NODE_API_TYPES_H_ diff --git a/libs/android/libnode/include/node/node_buffer.h b/libs/android/libnode/include/node/node_buffer.h index 11010017..606a6f5c 100644 --- a/libs/android/libnode/include/node/node_buffer.h +++ b/libs/android/libnode/include/node/node_buffer.h @@ -29,7 +29,7 @@ namespace node { namespace Buffer { -static const unsigned int kMaxLength = v8::TypedArray::kMaxLength; +static const size_t kMaxLength = v8::TypedArray::kMaxLength; typedef void (*FreeCallback)(char* data, void* hint); diff --git a/libs/android/libnode/include/node/node_version.h b/libs/android/libnode/include/node/node_version.h index b4f1409d..d95df749 100644 --- a/libs/android/libnode/include/node/node_version.h +++ b/libs/android/libnode/include/node/node_version.h @@ -22,14 +22,14 @@ #ifndef SRC_NODE_VERSION_H_ #define SRC_NODE_VERSION_H_ -#define NODE_MAJOR_VERSION 12 -#define NODE_MINOR_VERSION 19 -#define NODE_PATCH_VERSION 0 +#define NODE_MAJOR_VERSION 16 +#define NODE_MINOR_VERSION 17 +#define NODE_PATCH_VERSION 1 #define NODE_VERSION_IS_LTS 1 -#define NODE_VERSION_LTS_CODENAME "Erbium" +#define NODE_VERSION_LTS_CODENAME "Gallium" -#define NODE_VERSION_IS_RELEASE 1 +#define NODE_VERSION_IS_RELEASE 0 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n) @@ -84,15 +84,15 @@ * if it can be made ABI compatible with the previous version. * * The registry of used NODE_MODULE_VERSION numbers is located at - * https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json + * https://github.com/nodejs/node/blob/HEAD/doc/abi_version_registry.json * Extenders, embedders and other consumers of Node.js that require ABI * version matching should open a pull request to reserve a number in this * registry. */ -#define NODE_MODULE_VERSION 72 +#define NODE_MODULE_VERSION 93 // The NAPI_VERSION provided by this version of the runtime. This is the version // which the Node binary being built supports. -#define NAPI_VERSION 7 +#define NAPI_VERSION 8 #endif // SRC_NODE_VERSION_H_ diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/crypto/buildinf.h index 8906bbcd..aab8081e 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86" -#define DATE "built on: Tue Apr 21 13:28:30 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:24 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/include/openssl/opensslconf.h index febd51ac..a3c7db33 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -114,6 +114,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/crypto/buildinf.h index 9ae71b20..5f1cc211 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86" -#define DATE "built on: Tue Apr 21 13:28:32 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:26 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/opensslconf.h index febd51ac..a3c7db33 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -114,6 +114,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/crypto/buildinf.h index 0617bee2..4301e571 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86" -#define DATE "built on: Tue Apr 21 13:28:34 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:28 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/opensslconf.h index 435e0e58..150ac715 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/crypto/buildinf.h index 4fa13f78..f9062b52 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86_64" -#define DATE "built on: Tue Apr 21 13:28:35 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:29 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/include/openssl/opensslconf.h index 80bda2b8..3e1ee8c3 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -114,6 +114,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h index e3d1b2ac..fa6112af 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86_64" -#define DATE "built on: Tue Apr 21 13:28:40 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:34 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/openssl/opensslconf.h index 80bda2b8..3e1ee8c3 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -114,6 +114,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/crypto/buildinf.h index 21c7eb8a..f16ca398 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86_64" -#define DATE "built on: Tue Apr 21 13:28:45 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:38 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/include/openssl/opensslconf.h index ecb2a2aa..23aa159e 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/BSD-x86_64/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/crypto/buildinf.h index ce39e289..b5d47612 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 21 13:30:38 2020 UTC" +#define DATE "built on: Tue Jul 5 15:04:18 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/include/openssl/opensslconf.h index 8fb66737..160de858 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/crypto/buildinf.h index 91ea9162..90b66705 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 21 13:30:40 2020 UTC" +#define DATE "built on: Tue Jul 5 15:04:20 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/include/openssl/opensslconf.h index 8fb66737..160de858 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/crypto/buildinf.h index 13dfc801..017ac0eb 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 21 13:30:42 2020 UTC" +#define DATE "built on: Tue Jul 5 15:04:22 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/include/openssl/opensslconf.h index 24a8c497..34088d5c 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -123,6 +123,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN32/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h index c10c09b4..a928f71c 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: VC-WIN64-ARM" -#define DATE "built on: Tue Apr 21 13:30:43 2020 UTC" +#define DATE "built on: Tue Jul 5 15:04:23 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslconf.h index edc97aba..6a1cceb1 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/crypto/buildinf.h index af137fba..21d9fc78 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 21 13:30:25 2020 UTC" +#define DATE "built on: Tue Jul 5 15:04:08 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/include/openssl/opensslconf.h index de662de1..f7d0c0ed 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h index bf077856..c2f7b39d 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 21 13:30:31 2020 UTC" +#define DATE "built on: Tue Jul 5 15:04:13 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/openssl/opensslconf.h index de662de1..f7d0c0ed 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/crypto/buildinf.h index f7d39297..33381dd7 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 21 13:30:37 2020 UTC" +#define DATE "built on: Tue Jul 5 15:04:17 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/include/openssl/opensslconf.h index 0122f2c3..4d1a3594 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -123,6 +123,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/VC-WIN64A/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/crypto/buildinf.h index 667b3ca4..b37b9e6c 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: aix-gcc" -#define DATE "built on: Tue Apr 21 13:28:20 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:14 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/include/openssl/opensslconf.h index 9028305b..4577f8dd 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/crypto/buildinf.h index 58ce87eb..8fb93270 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: aix-gcc" -#define DATE "built on: Tue Apr 21 13:28:22 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:16 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/include/openssl/opensslconf.h index 9028305b..4577f8dd 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/aix-gcc/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/crypto/buildinf.h index 52e81669..8c3cd2b0 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: aix-gcc" -#define DATE "built on: Tue Apr 21 13:28:23 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:17 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/include/openssl/opensslconf.h index 5b383170..34c7ab85 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -123,6 +123,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/aix-gcc/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/crypto/buildinf.h index 643ee46d..0c2d814c 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: aix64-gcc" -#define DATE "built on: Tue Apr 21 13:28:25 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:19 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/include/openssl/opensslconf.h index 2ab0cdb9..2adac16b 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/crypto/buildinf.h index 8a869517..00e835ea 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: aix64-gcc" -#define DATE "built on: Tue Apr 21 13:28:27 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:21 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/include/openssl/opensslconf.h index 2ab0cdb9..2adac16b 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/crypto/buildinf.h index bf9bd49b..287cebb1 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: aix64-gcc" -#define DATE "built on: Tue Apr 21 13:28:28 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:23 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/include/openssl/opensslconf.h index 267f47f5..fd3104ce 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -123,6 +123,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/aix64-gcc/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/crypto/buildinf.h index 0e279fa0..ebef8a89 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin-i386-cc" -#define DATE "built on: Tue Apr 21 13:28:57 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:49 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/include/openssl/opensslconf.h index 7602fb81..9dcdf529 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h index 48b19f2a..06d04a8b 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin-i386-cc" -#define DATE "built on: Tue Apr 21 13:28:59 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:52 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslconf.h index 7602fb81..9dcdf529 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/crypto/buildinf.h index e3fca239..d3c78158 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin-i386-cc" -#define DATE "built on: Tue Apr 21 13:29:02 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:54 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/include/openssl/opensslconf.h index 9dd40e7e..f004ce2f 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -123,6 +123,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin-i386-cc/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/crypto/buildinf.h index 92608c6c..a5c3cf9e 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-arm64-cc" -#define DATE "built on: Tue Aug 25 13:55:31 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:55 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/include/openssl/opensslconf.h index 25a4ebf7..3937d1b3 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h index b19f86d5..5ca24f29 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-arm64-cc" -#define DATE "built on: Tue Aug 25 13:55:56 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:57 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslconf.h index 25a4ebf7..3937d1b3 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h index 4615ab54..28a8d9e8 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-arm64-cc" -#define DATE "built on: Tue Aug 25 13:56:20 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:59 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslconf.h index 30e08538..55dbd5d4 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -123,6 +123,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h index ef775454..8fe544a3 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-x86_64-cc" -#define DATE "built on: Tue Apr 21 13:28:47 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:39 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/openssl/opensslconf.h index 25a4ebf7..3937d1b3 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h index e51b17fc..e3c57a39 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-x86_64-cc" -#define DATE "built on: Tue Apr 21 13:28:51 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:44 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslconf.h index 25a4ebf7..3937d1b3 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h index 8219a109..beedba41 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-x86_64-cc" -#define DATE "built on: Tue Apr 21 13:28:56 2020 UTC" +#define DATE "built on: Tue Jul 5 15:02:48 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslconf.h index 30e08538..55dbd5d4 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -123,6 +123,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/crypto/buildinf.h index 6479d9cf..494f72bf 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-aarch64" -#define DATE "built on: Tue Apr 21 13:29:03 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:00 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/include/openssl/opensslconf.h index 937531fe..43d12dc1 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/crypto/buildinf.h index b8787fef..843eaecb 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-aarch64" -#define DATE "built on: Tue Apr 21 13:29:05 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:02 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/include/openssl/opensslconf.h index 937531fe..43d12dc1 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/crypto/buildinf.h index c592d53e..c3fbbdff 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-aarch64" -#define DATE "built on: Tue Apr 21 13:29:07 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:04 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/include/openssl/opensslconf.h index 781ef739..cc8d71d0 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-aarch64/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/crypto/buildinf.h index f899ea4f..c6b9d193 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-armv4" -#define DATE "built on: Tue Apr 21 13:29:08 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:05 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/include/openssl/opensslconf.h index 71c4fecc..4334150f 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/crypto/buildinf.h index 2a707b15..904107ab 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-armv4" -#define DATE "built on: Tue Apr 21 13:29:10 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:07 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/include/openssl/opensslconf.h index 71c4fecc..4334150f 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-armv4/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/crypto/buildinf.h index c40dc3bc..37366e97 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-armv4" -#define DATE "built on: Tue Apr 21 13:29:12 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:09 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/include/openssl/opensslconf.h index 4cbafb77..953beae9 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-armv4/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/crypto/buildinf.h index c471b16f..129fe79f 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-elf" -#define DATE "built on: Tue Apr 21 13:29:13 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:10 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/include/openssl/opensslconf.h index da0b080c..8e618a5b 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/crypto/buildinf.h index 57ad9b8f..9e849177 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-elf" -#define DATE "built on: Tue Apr 21 13:29:15 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:12 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/include/openssl/opensslconf.h index da0b080c..8e618a5b 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-elf/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/crypto/buildinf.h index 23a45083..9d63de54 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-elf" -#define DATE "built on: Tue Apr 21 13:29:17 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:14 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/include/openssl/opensslconf.h index 6db191cd..8b97d88c 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-elf/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/crypto/buildinf.h index cb44914d..cbdc0330 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc" -#define DATE "built on: Tue Apr 21 13:29:40 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:26 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a @@ -24,13 +24,14 @@ static const char compiler_flags[] = { ',','-','-','n','o','e','x','e','c','s','t','a','c','k',' ','-', 'W','a','l','l',' ','-','O','3',' ','-','D','O','P','E','N','S', 'S','L','_','U','S','E','_','N','O','D','E','L','E','T','E',' ', - '-','D','O','P','E','N','S','S','L','_','P','I','C',' ','-','D', - 'O','P','E','N','S','S','L','_','C','P','U','I','D','_','O','B', - 'J',' ','-','D','O','P','E','N','S','S','L','_','B','N','_','A', - 'S','M','_','M','O','N','T',' ','-','D','S','H','A','1','_','A', - 'S','M',' ','-','D','S','H','A','2','5','6','_','A','S','M',' ', - '-','D','S','H','A','5','1','2','_','A','S','M',' ','-','D','A', - 'E','S','_','A','S','M',' ','-','D','V','P','A','E','S','_','A', - 'S','M',' ','-','D','P','O','L','Y','1','3','0','5','_','A','S', - 'M',' ','-','D','N','D','E','B','U','G','\0' + '-','D','B','_','E','N','D','I','A','N',' ','-','D','O','P','E', + 'N','S','S','L','_','P','I','C',' ','-','D','O','P','E','N','S', + 'S','L','_','C','P','U','I','D','_','O','B','J',' ','-','D','O', + 'P','E','N','S','S','L','_','B','N','_','A','S','M','_','M','O', + 'N','T',' ','-','D','S','H','A','1','_','A','S','M',' ','-','D', + 'S','H','A','2','5','6','_','A','S','M',' ','-','D','S','H','A', + '5','1','2','_','A','S','M',' ','-','D','A','E','S','_','A','S', + 'M',' ','-','D','V','P','A','E','S','_','A','S','M',' ','-','D', + 'P','O','L','Y','1','3','0','5','_','A','S','M',' ','-','D','N', + 'D','E','B','U','G','\0' }; diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/include/openssl/opensslconf.h index 71c4fecc..4334150f 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/crypto/buildinf.h index b06edc3d..64434c55 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc" -#define DATE "built on: Tue Apr 21 13:29:42 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:27 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a @@ -25,13 +25,14 @@ static const char compiler_flags[] = { 'W','a',',','-','-','n','o','e','x','e','c','s','t','a','c','k', ' ','-','W','a','l','l',' ','-','O','3',' ','-','D','O','P','E', 'N','S','S','L','_','U','S','E','_','N','O','D','E','L','E','T', - 'E',' ','-','D','O','P','E','N','S','S','L','_','P','I','C',' ', - '-','D','O','P','E','N','S','S','L','_','C','P','U','I','D','_', - 'O','B','J',' ','-','D','O','P','E','N','S','S','L','_','B','N', - '_','A','S','M','_','M','O','N','T',' ','-','D','S','H','A','1', - '_','A','S','M',' ','-','D','S','H','A','2','5','6','_','A','S', - 'M',' ','-','D','S','H','A','5','1','2','_','A','S','M',' ','-', - 'D','A','E','S','_','A','S','M',' ','-','D','V','P','A','E','S', - '_','A','S','M',' ','-','D','P','O','L','Y','1','3','0','5','_', - 'A','S','M',' ','-','D','N','D','E','B','U','G','\0' + 'E',' ','-','D','B','_','E','N','D','I','A','N',' ','-','D','O', + 'P','E','N','S','S','L','_','P','I','C',' ','-','D','O','P','E', + 'N','S','S','L','_','C','P','U','I','D','_','O','B','J',' ','-', + 'D','O','P','E','N','S','S','L','_','B','N','_','A','S','M','_', + 'M','O','N','T',' ','-','D','S','H','A','1','_','A','S','M',' ', + '-','D','S','H','A','2','5','6','_','A','S','M',' ','-','D','S', + 'H','A','5','1','2','_','A','S','M',' ','-','D','A','E','S','_', + 'A','S','M',' ','-','D','V','P','A','E','S','_','A','S','M',' ', + '-','D','P','O','L','Y','1','3','0','5','_','A','S','M',' ','-', + 'D','N','D','E','B','U','G','\0' }; diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/include/openssl/opensslconf.h index 71c4fecc..4334150f 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/crypto/buildinf.h index 002eddcb..93876129 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc" -#define DATE "built on: Tue Apr 21 13:29:44 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:29 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a @@ -23,6 +23,6 @@ static const char compiler_flags[] = { 'P','I','C',' ','-','p','t','h','r','e','a','d',' ','-','W','a', 'l','l',' ','-','O','3',' ','-','D','O','P','E','N','S','S','L', '_','U','S','E','_','N','O','D','E','L','E','T','E',' ','-','D', - 'O','P','E','N','S','S','L','_','P','I','C',' ','-','D','N','D', - 'E','B','U','G','\0' + 'B','_','E','N','D','I','A','N',' ','-','D','O','P','E','N','S', + 'S','L','_','P','I','C',' ','-','D','N','D','E','B','U','G','\0' }; diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/include/openssl/opensslconf.h index 4cbafb77..953beae9 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/crypto/buildinf.h index 3d95753b..342ef59f 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc64" -#define DATE "built on: Tue Apr 21 13:29:45 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:30 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/include/openssl/opensslconf.h index 937531fe..43d12dc1 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/crypto/buildinf.h index 1ce61a43..27336c9c 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc64" -#define DATE "built on: Tue Apr 21 13:29:47 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:32 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/include/openssl/opensslconf.h index 937531fe..43d12dc1 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/crypto/buildinf.h index a07f6603..ee77d223 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc64" -#define DATE "built on: Tue Apr 21 13:29:49 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:34 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/include/openssl/opensslconf.h index 781ef739..cc8d71d0 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/crypto/buildinf.h index 13abf9fd..b8c4d419 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc64le" -#define DATE "built on: Tue Apr 21 13:29:50 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:35 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/opensslconf.h index 937531fe..43d12dc1 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h index 06be7372..6f294d1e 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc64le" -#define DATE "built on: Tue Apr 21 13:29:52 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:38 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/openssl/opensslconf.h index 937531fe..43d12dc1 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/crypto/buildinf.h index 4363c139..d4c43203 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc64le" -#define DATE "built on: Tue Apr 21 13:29:54 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:39 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/include/openssl/opensslconf.h index 781ef739..cc8d71d0 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-ppc64le/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/crypto/buildinf.h index c234a16b..86abfaa1 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-x32" -#define DATE "built on: Tue Apr 21 13:29:19 2020 UTC" +#define DATE "built on: Tue Mar 15 19:23:08 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/crypto/include/internal/bn_conf.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/crypto/include/internal/bn_conf.h deleted file mode 100644 index 93f75e2e..00000000 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/crypto/include/internal/bn_conf.h +++ /dev/null @@ -1,28 +0,0 @@ -/* WARNING: do not edit! */ -/* Generated by Makefile from include/crypto/bn_conf.h.in */ -/* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#ifndef OSSL_CRYPTO_BN_CONF_H -# define OSSL_CRYPTO_BN_CONF_H - -/* - * The contents of this file are not used in the UEFI build, as - * both 32-bit and 64-bit builds are supported from a single run - * of the Configure script. - */ - -/* Should we define BN_DIV2W here? */ - -/* Only one for the following should be defined */ -#undef SIXTY_FOUR_BIT_LONG -#define SIXTY_FOUR_BIT -#undef THIRTY_TWO_BIT - -#endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/include/openssl/opensslconf.h deleted file mode 100644 index 99247394..00000000 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/include/openssl/opensslconf.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * WARNING: do not edit! - * Generated by Makefile from include/openssl/opensslconf.h.in - * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_ALGORITHM_DEFINES -# error OPENSSL_ALGORITHM_DEFINES no longer supported -#endif - -/* - * OpenSSL was configured with the following options: - */ - -#ifndef OPENSSL_NO_COMP -# define OPENSSL_NO_COMP -#endif -#ifndef OPENSSL_NO_MD2 -# define OPENSSL_NO_MD2 -#endif -#ifndef OPENSSL_NO_RC5 -# define OPENSSL_NO_RC5 -#endif -#ifndef OPENSSL_THREADS -# define OPENSSL_THREADS -#endif -#ifndef OPENSSL_RAND_SEED_OS -# define OPENSSL_RAND_SEED_OS -#endif -#ifndef OPENSSL_NO_AFALGENG -# define OPENSSL_NO_AFALGENG -#endif -#ifndef OPENSSL_NO_ASAN -# define OPENSSL_NO_ASAN -#endif -#ifndef OPENSSL_NO_CRYPTO_MDEBUG -# define OPENSSL_NO_CRYPTO_MDEBUG -#endif -#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE -# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE -#endif -#ifndef OPENSSL_NO_DEVCRYPTOENG -# define OPENSSL_NO_DEVCRYPTOENG -#endif -#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 -# define OPENSSL_NO_EC_NISTP_64_GCC_128 -#endif -#ifndef OPENSSL_NO_EGD -# define OPENSSL_NO_EGD -#endif -#ifndef OPENSSL_NO_EXTERNAL_TESTS -# define OPENSSL_NO_EXTERNAL_TESTS -#endif -#ifndef OPENSSL_NO_FUZZ_AFL -# define OPENSSL_NO_FUZZ_AFL -#endif -#ifndef OPENSSL_NO_FUZZ_LIBFUZZER -# define OPENSSL_NO_FUZZ_LIBFUZZER -#endif -#ifndef OPENSSL_NO_HEARTBEATS -# define OPENSSL_NO_HEARTBEATS -#endif -#ifndef OPENSSL_NO_MSAN -# define OPENSSL_NO_MSAN -#endif -#ifndef OPENSSL_NO_SCTP -# define OPENSSL_NO_SCTP -#endif -#ifndef OPENSSL_NO_SSL3 -# define OPENSSL_NO_SSL3 -#endif -#ifndef OPENSSL_NO_SSL3_METHOD -# define OPENSSL_NO_SSL3_METHOD -#endif -#ifndef OPENSSL_NO_UBSAN -# define OPENSSL_NO_UBSAN -#endif -#ifndef OPENSSL_NO_UNIT_TEST -# define OPENSSL_NO_UNIT_TEST -#endif -#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS -# define OPENSSL_NO_WEAK_SSL_CIPHERS -#endif -#ifndef OPENSSL_NO_DYNAMIC_ENGINE -# define OPENSSL_NO_DYNAMIC_ENGINE -#endif - - -/* - * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers - * don't like that. This will hopefully silence them. - */ -#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; - -/* - * Applications should use -DOPENSSL_API_COMPAT= to suppress the - * declarations of functions deprecated in or before . Otherwise, they - * still won't see them if the library has been built to disable deprecated - * functions. - */ -#ifndef DECLARE_DEPRECATED -# define DECLARE_DEPRECATED(f) f; -# ifdef __GNUC__ -# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# undef DECLARE_DEPRECATED -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -# endif -# endif -#endif - -#ifndef OPENSSL_FILE -# ifdef OPENSSL_NO_FILENAMES -# define OPENSSL_FILE "" -# define OPENSSL_LINE 0 -# else -# define OPENSSL_FILE __FILE__ -# define OPENSSL_LINE __LINE__ -# endif -#endif - -#ifndef OPENSSL_MIN_API -# define OPENSSL_MIN_API 0 -#endif - -#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API -# undef OPENSSL_API_COMPAT -# define OPENSSL_API_COMPAT OPENSSL_MIN_API -#endif - -/* - * Do not deprecate things to be deprecated in version 1.2.0 before the - * OpenSSL version number matches. - */ -#if OPENSSL_VERSION_NUMBER < 0x10200000L -# define DEPRECATEDIN_1_2_0(f) f; -#elif OPENSSL_API_COMPAT < 0x10200000L -# define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_2_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x10100000L -# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_1_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x10000000L -# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_0_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x00908000L -# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_0_9_8(f) -#endif - -/* Generate 80386 code? */ -#undef I386_ONLY - -#undef OPENSSL_UNISTD -#define OPENSSL_UNISTD - -#undef OPENSSL_EXPORT_VAR_AS_FUNCTION - -/* - * The following are cipher-specific, but are part of the public API. - */ -#if !defined(OPENSSL_SYS_UEFI) -# undef BN_LLONG -/* Only one for the following should be defined */ -# undef SIXTY_FOUR_BIT_LONG -# define SIXTY_FOUR_BIT -# undef THIRTY_TWO_BIT -#endif - -#define RC4_INT unsigned int - -#ifdef __cplusplus -} -#endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/crypto/buildinf.h index b89bda86..0a13f165 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-x32" -#define DATE "built on: Tue Apr 21 13:29:24 2020 UTC" +#define DATE "built on: Tue Mar 15 19:23:15 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/crypto/include/internal/bn_conf.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/crypto/include/internal/bn_conf.h deleted file mode 100644 index 93f75e2e..00000000 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/crypto/include/internal/bn_conf.h +++ /dev/null @@ -1,28 +0,0 @@ -/* WARNING: do not edit! */ -/* Generated by Makefile from include/crypto/bn_conf.h.in */ -/* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#ifndef OSSL_CRYPTO_BN_CONF_H -# define OSSL_CRYPTO_BN_CONF_H - -/* - * The contents of this file are not used in the UEFI build, as - * both 32-bit and 64-bit builds are supported from a single run - * of the Configure script. - */ - -/* Should we define BN_DIV2W here? */ - -/* Only one for the following should be defined */ -#undef SIXTY_FOUR_BIT_LONG -#define SIXTY_FOUR_BIT -#undef THIRTY_TWO_BIT - -#endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/crypto/include/internal/dso_conf.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/crypto/include/internal/dso_conf.h deleted file mode 100644 index 4b1167c3..00000000 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/crypto/include/internal/dso_conf.h +++ /dev/null @@ -1,17 +0,0 @@ -/* WARNING: do not edit! */ -/* Generated by Makefile from include/crypto/dso_conf.h.in */ -/* - * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#ifndef OSSL_CRYPTO_DSO_CONF_H -# define OSSL_CRYPTO_DSO_CONF_H -# define DSO_DLFCN -# define HAVE_DLFCN_H -# define DSO_EXTENSION ".so" -#endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/include/openssl/opensslconf.h deleted file mode 100644 index 99247394..00000000 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/include/openssl/opensslconf.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * WARNING: do not edit! - * Generated by Makefile from include/openssl/opensslconf.h.in - * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_ALGORITHM_DEFINES -# error OPENSSL_ALGORITHM_DEFINES no longer supported -#endif - -/* - * OpenSSL was configured with the following options: - */ - -#ifndef OPENSSL_NO_COMP -# define OPENSSL_NO_COMP -#endif -#ifndef OPENSSL_NO_MD2 -# define OPENSSL_NO_MD2 -#endif -#ifndef OPENSSL_NO_RC5 -# define OPENSSL_NO_RC5 -#endif -#ifndef OPENSSL_THREADS -# define OPENSSL_THREADS -#endif -#ifndef OPENSSL_RAND_SEED_OS -# define OPENSSL_RAND_SEED_OS -#endif -#ifndef OPENSSL_NO_AFALGENG -# define OPENSSL_NO_AFALGENG -#endif -#ifndef OPENSSL_NO_ASAN -# define OPENSSL_NO_ASAN -#endif -#ifndef OPENSSL_NO_CRYPTO_MDEBUG -# define OPENSSL_NO_CRYPTO_MDEBUG -#endif -#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE -# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE -#endif -#ifndef OPENSSL_NO_DEVCRYPTOENG -# define OPENSSL_NO_DEVCRYPTOENG -#endif -#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 -# define OPENSSL_NO_EC_NISTP_64_GCC_128 -#endif -#ifndef OPENSSL_NO_EGD -# define OPENSSL_NO_EGD -#endif -#ifndef OPENSSL_NO_EXTERNAL_TESTS -# define OPENSSL_NO_EXTERNAL_TESTS -#endif -#ifndef OPENSSL_NO_FUZZ_AFL -# define OPENSSL_NO_FUZZ_AFL -#endif -#ifndef OPENSSL_NO_FUZZ_LIBFUZZER -# define OPENSSL_NO_FUZZ_LIBFUZZER -#endif -#ifndef OPENSSL_NO_HEARTBEATS -# define OPENSSL_NO_HEARTBEATS -#endif -#ifndef OPENSSL_NO_MSAN -# define OPENSSL_NO_MSAN -#endif -#ifndef OPENSSL_NO_SCTP -# define OPENSSL_NO_SCTP -#endif -#ifndef OPENSSL_NO_SSL3 -# define OPENSSL_NO_SSL3 -#endif -#ifndef OPENSSL_NO_SSL3_METHOD -# define OPENSSL_NO_SSL3_METHOD -#endif -#ifndef OPENSSL_NO_UBSAN -# define OPENSSL_NO_UBSAN -#endif -#ifndef OPENSSL_NO_UNIT_TEST -# define OPENSSL_NO_UNIT_TEST -#endif -#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS -# define OPENSSL_NO_WEAK_SSL_CIPHERS -#endif -#ifndef OPENSSL_NO_DYNAMIC_ENGINE -# define OPENSSL_NO_DYNAMIC_ENGINE -#endif - - -/* - * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers - * don't like that. This will hopefully silence them. - */ -#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; - -/* - * Applications should use -DOPENSSL_API_COMPAT= to suppress the - * declarations of functions deprecated in or before . Otherwise, they - * still won't see them if the library has been built to disable deprecated - * functions. - */ -#ifndef DECLARE_DEPRECATED -# define DECLARE_DEPRECATED(f) f; -# ifdef __GNUC__ -# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# undef DECLARE_DEPRECATED -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -# endif -# endif -#endif - -#ifndef OPENSSL_FILE -# ifdef OPENSSL_NO_FILENAMES -# define OPENSSL_FILE "" -# define OPENSSL_LINE 0 -# else -# define OPENSSL_FILE __FILE__ -# define OPENSSL_LINE __LINE__ -# endif -#endif - -#ifndef OPENSSL_MIN_API -# define OPENSSL_MIN_API 0 -#endif - -#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API -# undef OPENSSL_API_COMPAT -# define OPENSSL_API_COMPAT OPENSSL_MIN_API -#endif - -/* - * Do not deprecate things to be deprecated in version 1.2.0 before the - * OpenSSL version number matches. - */ -#if OPENSSL_VERSION_NUMBER < 0x10200000L -# define DEPRECATEDIN_1_2_0(f) f; -#elif OPENSSL_API_COMPAT < 0x10200000L -# define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_2_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x10100000L -# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_1_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x10000000L -# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_0_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x00908000L -# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_0_9_8(f) -#endif - -/* Generate 80386 code? */ -#undef I386_ONLY - -#undef OPENSSL_UNISTD -#define OPENSSL_UNISTD - -#undef OPENSSL_EXPORT_VAR_AS_FUNCTION - -/* - * The following are cipher-specific, but are part of the public API. - */ -#if !defined(OPENSSL_SYS_UEFI) -# undef BN_LLONG -/* Only one for the following should be defined */ -# undef SIXTY_FOUR_BIT_LONG -# define SIXTY_FOUR_BIT -# undef THIRTY_TWO_BIT -#endif - -#define RC4_INT unsigned int - -#ifdef __cplusplus -} -#endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x32/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/crypto/buildinf.h index f4c2dce6..d379115f 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-x32" -#define DATE "built on: Tue Apr 21 13:29:28 2020 UTC" +#define DATE "built on: Tue Mar 15 19:23:22 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/crypto/include/internal/dso_conf.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/crypto/include/internal/dso_conf.h deleted file mode 100644 index 4b1167c3..00000000 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/crypto/include/internal/dso_conf.h +++ /dev/null @@ -1,17 +0,0 @@ -/* WARNING: do not edit! */ -/* Generated by Makefile from include/crypto/dso_conf.h.in */ -/* - * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#ifndef OSSL_CRYPTO_DSO_CONF_H -# define OSSL_CRYPTO_DSO_CONF_H -# define DSO_DLFCN -# define HAVE_DLFCN_H -# define DSO_EXTENSION ".so" -#endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/crypto/buildinf.h index 919af33b..36bbb495 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-x86_64" -#define DATE "built on: Tue Apr 21 13:29:29 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:16 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/include/openssl/opensslconf.h index 14050a45..b21064d7 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/crypto/buildinf.h index ae4d9357..0c5a403f 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-x86_64" -#define DATE "built on: Tue Apr 21 13:29:34 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:20 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/include/openssl/opensslconf.h index 14050a45..b21064d7 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/crypto/buildinf.h index adf411b4..89397898 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-x86_64" -#define DATE "built on: Tue Apr 21 13:29:39 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:24 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/include/openssl/opensslconf.h index 31bdb87d..9f891c82 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux-x86_64/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/crypto/buildinf.h index ec1ee2ef..11fc73dd 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux32-s390x" -#define DATE "built on: Tue Apr 21 13:29:56 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:41 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/include/openssl/opensslconf.h index 71c4fecc..4334150f 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/crypto/buildinf.h index 4beac3e2..a9345d1a 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux32-s390x" -#define DATE "built on: Tue Apr 21 13:29:57 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:42 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/include/openssl/opensslconf.h index 71c4fecc..4334150f 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/crypto/buildinf.h index 80c3ebb9..f96b9c0c 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux32-s390x" -#define DATE "built on: Tue Apr 21 13:29:58 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:44 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/include/openssl/opensslconf.h index 4cbafb77..953beae9 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux32-s390x/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/crypto/buildinf.h index 4aaf2f71..8beb0fa4 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-mips64" -#define DATE "built on: Tue Apr 21 13:30:04 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:49 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/include/openssl/opensslconf.h index 937531fe..43d12dc1 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/crypto/buildinf.h index b1ca7bea..74f5405b 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-mips64" -#define DATE "built on: Tue Apr 21 13:30:05 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:50 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/include/openssl/opensslconf.h index 937531fe..43d12dc1 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/crypto/buildinf.h index a3592bdf..92a66095 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-mips64" -#define DATE "built on: Tue Apr 21 13:30:07 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:52 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/include/openssl/opensslconf.h index 781ef739..cc8d71d0 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-mips64/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/buildinf.h new file mode 100644 index 00000000..351be58a --- /dev/null +++ b/libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/buildinf.h @@ -0,0 +1,28 @@ +/* + * WARNING: do not edit! + * Generated by util/mkbuildinf.pl + * + * Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#define PLATFORM "platform: linux64-riscv64" +#define DATE "built on: Tue Jul 5 15:04:24 2022 UTC" + +/* + * Generate compiler_flags as an array of individual characters. This is a + * workaround for the situation where CFLAGS gets too long for a C90 string + * literal + */ +static const char compiler_flags[] = { + 'c','o','m','p','i','l','e','r',':',' ','g','c','c',' ','-','f', + 'P','I','C',' ','-','p','t','h','r','e','a','d',' ','-','W','a', + 'l','l',' ','-','O','3',' ','-','D','O','P','E','N','S','S','L', + '_','U','S','E','_','N','O','D','E','L','E','T','E',' ','-','D', + 'O','P','E','N','S','S','L','_','P','I','C',' ','-','D','N','D', + 'E','B','U','G','\0' +}; diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/crypto/include/internal/bn_conf.h b/libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/include/internal/bn_conf.h similarity index 93% rename from libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/crypto/include/internal/bn_conf.h rename to libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/include/internal/bn_conf.h index 93f75e2e..5312ef5a 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/crypto/include/internal/bn_conf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/include/internal/bn_conf.h @@ -21,8 +21,8 @@ /* Should we define BN_DIV2W here? */ /* Only one for the following should be defined */ -#undef SIXTY_FOUR_BIT_LONG -#define SIXTY_FOUR_BIT +#define SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT #undef THIRTY_TWO_BIT #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/asm/crypto/include/internal/dso_conf.h b/libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/include/internal/dso_conf.h similarity index 100% rename from libs/android/libnode/include/node/openssl/archs/linux-x32/asm/crypto/include/internal/dso_conf.h rename to libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/include/internal/dso_conf.h diff --git a/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/include/openssl/opensslconf.h similarity index 93% rename from libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/include/openssl/opensslconf.h rename to libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/include/openssl/opensslconf.h index 3d853659..cc8d71d0 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux-x32/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif @@ -186,12 +191,12 @@ extern "C" { #if !defined(OPENSSL_SYS_UEFI) # undef BN_LLONG /* Only one for the following should be defined */ -# undef SIXTY_FOUR_BIT_LONG -# define SIXTY_FOUR_BIT +# define SIXTY_FOUR_BIT_LONG +# undef SIXTY_FOUR_BIT # undef THIRTY_TWO_BIT #endif -#define RC4_INT unsigned int +#define RC4_INT unsigned char #ifdef __cplusplus } diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/include/progs.h new file mode 100644 index 00000000..de5a91f5 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/archs/linux64-riscv64/no-asm/include/progs.h @@ -0,0 +1,507 @@ +/* + * WARNING: do not edit! + * Generated by apps/progs.pl + * + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +typedef enum FUNC_TYPE { + FT_none, FT_general, FT_md, FT_cipher, FT_pkey, + FT_md_alg, FT_cipher_alg +} FUNC_TYPE; + +typedef struct function_st { + FUNC_TYPE type; + const char *name; + int (*func)(int argc, char *argv[]); + const OPTIONS *help; +} FUNCTION; + +DEFINE_LHASH_OF(FUNCTION); + +extern int asn1parse_main(int argc, char *argv[]); +extern int ca_main(int argc, char *argv[]); +extern int ciphers_main(int argc, char *argv[]); +extern int cms_main(int argc, char *argv[]); +extern int crl_main(int argc, char *argv[]); +extern int crl2pkcs7_main(int argc, char *argv[]); +extern int dgst_main(int argc, char *argv[]); +extern int dhparam_main(int argc, char *argv[]); +extern int dsa_main(int argc, char *argv[]); +extern int dsaparam_main(int argc, char *argv[]); +extern int ec_main(int argc, char *argv[]); +extern int ecparam_main(int argc, char *argv[]); +extern int enc_main(int argc, char *argv[]); +extern int engine_main(int argc, char *argv[]); +extern int errstr_main(int argc, char *argv[]); +extern int gendsa_main(int argc, char *argv[]); +extern int genpkey_main(int argc, char *argv[]); +extern int genrsa_main(int argc, char *argv[]); +extern int help_main(int argc, char *argv[]); +extern int list_main(int argc, char *argv[]); +extern int nseq_main(int argc, char *argv[]); +extern int ocsp_main(int argc, char *argv[]); +extern int passwd_main(int argc, char *argv[]); +extern int pkcs12_main(int argc, char *argv[]); +extern int pkcs7_main(int argc, char *argv[]); +extern int pkcs8_main(int argc, char *argv[]); +extern int pkey_main(int argc, char *argv[]); +extern int pkeyparam_main(int argc, char *argv[]); +extern int pkeyutl_main(int argc, char *argv[]); +extern int prime_main(int argc, char *argv[]); +extern int rand_main(int argc, char *argv[]); +extern int rehash_main(int argc, char *argv[]); +extern int req_main(int argc, char *argv[]); +extern int rsa_main(int argc, char *argv[]); +extern int rsautl_main(int argc, char *argv[]); +extern int s_client_main(int argc, char *argv[]); +extern int s_server_main(int argc, char *argv[]); +extern int s_time_main(int argc, char *argv[]); +extern int sess_id_main(int argc, char *argv[]); +extern int smime_main(int argc, char *argv[]); +extern int speed_main(int argc, char *argv[]); +extern int spkac_main(int argc, char *argv[]); +extern int srp_main(int argc, char *argv[]); +extern int storeutl_main(int argc, char *argv[]); +extern int ts_main(int argc, char *argv[]); +extern int verify_main(int argc, char *argv[]); +extern int version_main(int argc, char *argv[]); +extern int x509_main(int argc, char *argv[]); + +extern const OPTIONS asn1parse_options[]; +extern const OPTIONS ca_options[]; +extern const OPTIONS ciphers_options[]; +extern const OPTIONS cms_options[]; +extern const OPTIONS crl_options[]; +extern const OPTIONS crl2pkcs7_options[]; +extern const OPTIONS dgst_options[]; +extern const OPTIONS dhparam_options[]; +extern const OPTIONS dsa_options[]; +extern const OPTIONS dsaparam_options[]; +extern const OPTIONS ec_options[]; +extern const OPTIONS ecparam_options[]; +extern const OPTIONS enc_options[]; +extern const OPTIONS engine_options[]; +extern const OPTIONS errstr_options[]; +extern const OPTIONS gendsa_options[]; +extern const OPTIONS genpkey_options[]; +extern const OPTIONS genrsa_options[]; +extern const OPTIONS help_options[]; +extern const OPTIONS list_options[]; +extern const OPTIONS nseq_options[]; +extern const OPTIONS ocsp_options[]; +extern const OPTIONS passwd_options[]; +extern const OPTIONS pkcs12_options[]; +extern const OPTIONS pkcs7_options[]; +extern const OPTIONS pkcs8_options[]; +extern const OPTIONS pkey_options[]; +extern const OPTIONS pkeyparam_options[]; +extern const OPTIONS pkeyutl_options[]; +extern const OPTIONS prime_options[]; +extern const OPTIONS rand_options[]; +extern const OPTIONS rehash_options[]; +extern const OPTIONS req_options[]; +extern const OPTIONS rsa_options[]; +extern const OPTIONS rsautl_options[]; +extern const OPTIONS s_client_options[]; +extern const OPTIONS s_server_options[]; +extern const OPTIONS s_time_options[]; +extern const OPTIONS sess_id_options[]; +extern const OPTIONS smime_options[]; +extern const OPTIONS speed_options[]; +extern const OPTIONS spkac_options[]; +extern const OPTIONS srp_options[]; +extern const OPTIONS storeutl_options[]; +extern const OPTIONS ts_options[]; +extern const OPTIONS verify_options[]; +extern const OPTIONS version_options[]; +extern const OPTIONS x509_options[]; + +#ifdef INCLUDE_FUNCTION_TABLE +static FUNCTION functions[] = { + {FT_general, "asn1parse", asn1parse_main, asn1parse_options}, + {FT_general, "ca", ca_main, ca_options}, +#ifndef OPENSSL_NO_SOCK + {FT_general, "ciphers", ciphers_main, ciphers_options}, +#endif +#ifndef OPENSSL_NO_CMS + {FT_general, "cms", cms_main, cms_options}, +#endif + {FT_general, "crl", crl_main, crl_options}, + {FT_general, "crl2pkcs7", crl2pkcs7_main, crl2pkcs7_options}, + {FT_general, "dgst", dgst_main, dgst_options}, +#ifndef OPENSSL_NO_DH + {FT_general, "dhparam", dhparam_main, dhparam_options}, +#endif +#ifndef OPENSSL_NO_DSA + {FT_general, "dsa", dsa_main, dsa_options}, +#endif +#ifndef OPENSSL_NO_DSA + {FT_general, "dsaparam", dsaparam_main, dsaparam_options}, +#endif +#ifndef OPENSSL_NO_EC + {FT_general, "ec", ec_main, ec_options}, +#endif +#ifndef OPENSSL_NO_EC + {FT_general, "ecparam", ecparam_main, ecparam_options}, +#endif + {FT_general, "enc", enc_main, enc_options}, +#ifndef OPENSSL_NO_ENGINE + {FT_general, "engine", engine_main, engine_options}, +#endif + {FT_general, "errstr", errstr_main, errstr_options}, +#ifndef OPENSSL_NO_DSA + {FT_general, "gendsa", gendsa_main, gendsa_options}, +#endif + {FT_general, "genpkey", genpkey_main, genpkey_options}, +#ifndef OPENSSL_NO_RSA + {FT_general, "genrsa", genrsa_main, genrsa_options}, +#endif + {FT_general, "help", help_main, help_options}, + {FT_general, "list", list_main, list_options}, + {FT_general, "nseq", nseq_main, nseq_options}, +#ifndef OPENSSL_NO_OCSP + {FT_general, "ocsp", ocsp_main, ocsp_options}, +#endif + {FT_general, "passwd", passwd_main, passwd_options}, +#ifndef OPENSSL_NO_DES + {FT_general, "pkcs12", pkcs12_main, pkcs12_options}, +#endif + {FT_general, "pkcs7", pkcs7_main, pkcs7_options}, + {FT_general, "pkcs8", pkcs8_main, pkcs8_options}, + {FT_general, "pkey", pkey_main, pkey_options}, + {FT_general, "pkeyparam", pkeyparam_main, pkeyparam_options}, + {FT_general, "pkeyutl", pkeyutl_main, pkeyutl_options}, + {FT_general, "prime", prime_main, prime_options}, + {FT_general, "rand", rand_main, rand_options}, + {FT_general, "rehash", rehash_main, rehash_options}, + {FT_general, "req", req_main, req_options}, + {FT_general, "rsa", rsa_main, rsa_options}, +#ifndef OPENSSL_NO_RSA + {FT_general, "rsautl", rsautl_main, rsautl_options}, +#endif +#ifndef OPENSSL_NO_SOCK + {FT_general, "s_client", s_client_main, s_client_options}, +#endif +#ifndef OPENSSL_NO_SOCK + {FT_general, "s_server", s_server_main, s_server_options}, +#endif +#ifndef OPENSSL_NO_SOCK + {FT_general, "s_time", s_time_main, s_time_options}, +#endif + {FT_general, "sess_id", sess_id_main, sess_id_options}, + {FT_general, "smime", smime_main, smime_options}, + {FT_general, "speed", speed_main, speed_options}, + {FT_general, "spkac", spkac_main, spkac_options}, +#ifndef OPENSSL_NO_SRP + {FT_general, "srp", srp_main, srp_options}, +#endif + {FT_general, "storeutl", storeutl_main, storeutl_options}, +#ifndef OPENSSL_NO_TS + {FT_general, "ts", ts_main, ts_options}, +#endif + {FT_general, "verify", verify_main, verify_options}, + {FT_general, "version", version_main, version_options}, + {FT_general, "x509", x509_main, x509_options}, +#ifndef OPENSSL_NO_MD2 + {FT_md, "md2", dgst_main}, +#endif +#ifndef OPENSSL_NO_MD4 + {FT_md, "md4", dgst_main}, +#endif + {FT_md, "md5", dgst_main}, +#ifndef OPENSSL_NO_GOST + {FT_md, "gost", dgst_main}, +#endif + {FT_md, "sha1", dgst_main}, + {FT_md, "sha224", dgst_main}, + {FT_md, "sha256", dgst_main}, + {FT_md, "sha384", dgst_main}, + {FT_md, "sha512", dgst_main}, + {FT_md, "sha512-224", dgst_main}, + {FT_md, "sha512-256", dgst_main}, + {FT_md, "sha3-224", dgst_main}, + {FT_md, "sha3-256", dgst_main}, + {FT_md, "sha3-384", dgst_main}, + {FT_md, "sha3-512", dgst_main}, + {FT_md, "shake128", dgst_main}, + {FT_md, "shake256", dgst_main}, +#ifndef OPENSSL_NO_MDC2 + {FT_md, "mdc2", dgst_main}, +#endif +#ifndef OPENSSL_NO_RMD160 + {FT_md, "rmd160", dgst_main}, +#endif +#ifndef OPENSSL_NO_BLAKE2 + {FT_md, "blake2b512", dgst_main}, +#endif +#ifndef OPENSSL_NO_BLAKE2 + {FT_md, "blake2s256", dgst_main}, +#endif +#ifndef OPENSSL_NO_SM3 + {FT_md, "sm3", dgst_main}, +#endif + {FT_cipher, "aes-128-cbc", enc_main, enc_options}, + {FT_cipher, "aes-128-ecb", enc_main, enc_options}, + {FT_cipher, "aes-192-cbc", enc_main, enc_options}, + {FT_cipher, "aes-192-ecb", enc_main, enc_options}, + {FT_cipher, "aes-256-cbc", enc_main, enc_options}, + {FT_cipher, "aes-256-ecb", enc_main, enc_options}, +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-128-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-128-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-128-ctr", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-128-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-128-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-128-cfb1", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-128-cfb8", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-192-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-192-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-192-ctr", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-192-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-192-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-192-cfb1", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-192-cfb8", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-256-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-256-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-256-ctr", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-256-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-256-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-256-cfb1", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_ARIA + {FT_cipher, "aria-256-cfb8", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAMELLIA + {FT_cipher, "camellia-128-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAMELLIA + {FT_cipher, "camellia-128-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAMELLIA + {FT_cipher, "camellia-192-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAMELLIA + {FT_cipher, "camellia-192-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAMELLIA + {FT_cipher, "camellia-256-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAMELLIA + {FT_cipher, "camellia-256-ecb", enc_main, enc_options}, +#endif + {FT_cipher, "base64", enc_main, enc_options}, +#ifdef ZLIB + {FT_cipher, "zlib", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des3", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "desx", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_IDEA + {FT_cipher, "idea", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_SEED + {FT_cipher, "seed", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC4 + {FT_cipher, "rc4", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC4 + {FT_cipher, "rc4-40", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC2 + {FT_cipher, "rc2", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_BF + {FT_cipher, "bf", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAST + {FT_cipher, "cast", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC5 + {FT_cipher, "rc5", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-ede", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-ede3", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-ede-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-ede3-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-ede-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-ede3-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-ede-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_DES + {FT_cipher, "des-ede3-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_IDEA + {FT_cipher, "idea-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_IDEA + {FT_cipher, "idea-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_IDEA + {FT_cipher, "idea-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_IDEA + {FT_cipher, "idea-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_SEED + {FT_cipher, "seed-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_SEED + {FT_cipher, "seed-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_SEED + {FT_cipher, "seed-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_SEED + {FT_cipher, "seed-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC2 + {FT_cipher, "rc2-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC2 + {FT_cipher, "rc2-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC2 + {FT_cipher, "rc2-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC2 + {FT_cipher, "rc2-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC2 + {FT_cipher, "rc2-64-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC2 + {FT_cipher, "rc2-40-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_BF + {FT_cipher, "bf-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_BF + {FT_cipher, "bf-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_BF + {FT_cipher, "bf-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_BF + {FT_cipher, "bf-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAST + {FT_cipher, "cast5-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAST + {FT_cipher, "cast5-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAST + {FT_cipher, "cast5-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAST + {FT_cipher, "cast5-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_CAST + {FT_cipher, "cast-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC5 + {FT_cipher, "rc5-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC5 + {FT_cipher, "rc5-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC5 + {FT_cipher, "rc5-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_RC5 + {FT_cipher, "rc5-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_SM4 + {FT_cipher, "sm4-cbc", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_SM4 + {FT_cipher, "sm4-ecb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_SM4 + {FT_cipher, "sm4-cfb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_SM4 + {FT_cipher, "sm4-ofb", enc_main, enc_options}, +#endif +#ifndef OPENSSL_NO_SM4 + {FT_cipher, "sm4-ctr", enc_main, enc_options}, +#endif + {0, NULL, NULL} +}; +#endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/crypto/buildinf.h index 0a88ba38..c6f102c7 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-s390x" -#define DATE "built on: Tue Apr 21 13:30:00 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:45 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/include/openssl/opensslconf.h index 937531fe..43d12dc1 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/crypto/buildinf.h index e6c0d974..78722e7f 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-s390x" -#define DATE "built on: Tue Apr 21 13:30:01 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:46 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/include/openssl/opensslconf.h index 937531fe..43d12dc1 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/crypto/buildinf.h index 36544bc5..cfff6dfb 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-s390x" -#define DATE "built on: Tue Apr 21 13:30:03 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:48 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/include/openssl/opensslconf.h index 781ef739..cc8d71d0 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/linux64-s390x/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/crypto/buildinf.h index 36ae42ae..3086661f 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris-x86-gcc" -#define DATE "built on: Tue Apr 21 13:30:08 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:53 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/include/openssl/opensslconf.h index da0b080c..8e618a5b 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h index 028f93b6..0b32f9b1 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris-x86-gcc" -#define DATE "built on: Tue Apr 21 13:30:10 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:55 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslconf.h index da0b080c..8e618a5b 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h index bb103454..ddf5be1c 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris-x86-gcc" -#define DATE "built on: Tue Apr 21 13:30:13 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:57 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/openssl/opensslconf.h index 6db191cd..8b97d88c 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h index a0b629e4..889eaeb4 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris64-x86_64-gcc" -#define DATE "built on: Tue Apr 21 13:30:14 2020 UTC" +#define DATE "built on: Tue Jul 5 15:03:58 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslconf.h index 14050a45..b21064d7 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h index d4965b40..761e974c 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris64-x86_64-gcc" -#define DATE "built on: Tue Apr 21 13:30:19 2020 UTC" +#define DATE "built on: Tue Jul 5 15:04:03 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslconf.h index 14050a45..b21064d7 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/progs.h b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h index b88ad42b..b5742d32 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris64-x86_64-gcc" -#define DATE "built on: Tue Apr 21 13:30:24 2020 UTC" +#define DATE "built on: Tue Jul 5 15:04:07 2022 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslconf.h b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslconf.h index 31bdb87d..9f891c82 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslconf.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -120,6 +120,11 @@ extern "C" { # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif +# elif defined(__SUNPRO_C) +# if (__SUNPRO_C >= 0x5130) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif # endif #endif diff --git a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/progs.h b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/progs.h index 308c6560..de5a91f5 100644 --- a/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/progs.h +++ b/libs/android/libnode/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/progs.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by apps/progs.pl * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/libs/android/libnode/include/node/openssl/asn1_asm.h b/libs/android/libnode/include/node/openssl/asn1_asm.h new file mode 100644 index 00000000..4d368244 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/asn1_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/asn1.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/asn1.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/asn1.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/asn1.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/asn1.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/asn1.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/asn1.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/asn1.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/asn1.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/asn1.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/asn1.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/asn1.h" +#else +# include "./archs/linux-elf/asm/include/openssl/asn1.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/asn1_no-asm.h b/libs/android/libnode/include/node/openssl/asn1_no-asm.h new file mode 100644 index 00000000..24781238 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/asn1_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/asn1.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/asn1.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/asn1.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/asn1.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/asn1.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/asn1.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/asn1.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/asn1.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/asn1.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/asn1.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/asn1.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/asn1.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/asn1.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/asn1.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/asn1.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/asn1err.h b/libs/android/libnode/include/node/openssl/asn1err.h index faed5a55..e1ad1fef 100644 --- a/libs/android/libnode/include/node/openssl/asn1err.h +++ b/libs/android/libnode/include/node/openssl/asn1err.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -11,9 +11,7 @@ #ifndef HEADER_ASN1ERR_H # define HEADER_ASN1ERR_H -# ifndef HEADER_SYMHACKS_H -# include -# endif +# include # ifdef __cplusplus extern "C" @@ -53,6 +51,7 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_ASN1_ITEM_DUP 191 # define ASN1_F_ASN1_ITEM_EMBED_D2I 120 # define ASN1_F_ASN1_ITEM_EMBED_NEW 121 +# define ASN1_F_ASN1_ITEM_EX_I2D 144 # define ASN1_F_ASN1_ITEM_FLAGS_I2D 118 # define ASN1_F_ASN1_ITEM_I2D_BIO 192 # define ASN1_F_ASN1_ITEM_I2D_FP 193 @@ -145,6 +144,7 @@ int ERR_load_ASN1_strings(void); # define ASN1_R_ASN1_SIG_PARSE_ERROR 204 # define ASN1_R_AUX_ERROR 100 # define ASN1_R_BAD_OBJECT_HEADER 102 +# define ASN1_R_BAD_TEMPLATE 230 # define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214 # define ASN1_R_BN_LIB 105 # define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106 diff --git a/libs/android/libnode/include/node/openssl/asn1t_asm.h b/libs/android/libnode/include/node/openssl/asn1t_asm.h new file mode 100644 index 00000000..fbd767cb --- /dev/null +++ b/libs/android/libnode/include/node/openssl/asn1t_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/asn1t.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/asn1t.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/asn1t.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/asn1t.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/asn1t.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/asn1t.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/asn1t.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/asn1t.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/asn1t.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/asn1t.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/asn1t.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/asn1t.h" +#else +# include "./archs/linux-elf/asm/include/openssl/asn1t.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/asn1t_no-asm.h b/libs/android/libnode/include/node/openssl/asn1t_no-asm.h new file mode 100644 index 00000000..67c1791e --- /dev/null +++ b/libs/android/libnode/include/node/openssl/asn1t_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/asn1t.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/asn1t.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/asn1t.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/asn1t.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/asn1t.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/asn1t.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/asn1t.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/asn1t.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/asn1t.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/asn1t.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/asn1t.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/asn1t.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/asn1t.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/asn1t.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/asn1t.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/bio_asm.h b/libs/android/libnode/include/node/openssl/bio_asm.h new file mode 100644 index 00000000..202e9eb2 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/bio_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/bio.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/bio.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/bio.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/bio.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/bio.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/bio.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/bio.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/bio.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/bio.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/bio.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/bio.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/bio.h" +#else +# include "./archs/linux-elf/asm/include/openssl/bio.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/bio_no-asm.h b/libs/android/libnode/include/node/openssl/bio_no-asm.h new file mode 100644 index 00000000..93288698 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/bio_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/bio.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/bio.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/bio.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/bio.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/bio.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/bio.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/bio.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/bio.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/bio.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/bio.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/bio.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/bio.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/bio.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/bio.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/bio.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/bn.h b/libs/android/libnode/include/node/openssl/bn.h index 8af05d00..d8776604 100644 --- a/libs/android/libnode/include/node/openssl/bn.h +++ b/libs/android/libnode/include/node/openssl/bn.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * * Licensed under the OpenSSL license (the "License"). You may not use @@ -56,7 +56,7 @@ extern "C" { * avoid leaking exponent information through timing, * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime, * BN_div() will call BN_div_no_branch, - * BN_mod_inverse() will call BN_mod_inverse_no_branch. + * BN_mod_inverse() will call bn_mod_inverse_no_branch. */ # define BN_FLG_CONSTTIME 0x04 # define BN_FLG_SECURE 0x08 diff --git a/libs/android/libnode/include/node/openssl/bn_conf_asm.h b/libs/android/libnode/include/node/openssl/bn_conf_asm.h index 7f296048..800aad79 100644 --- a/libs/android/libnode/include/node/openssl/bn_conf_asm.h +++ b/libs/android/libnode/include/node/openssl/bn_conf_asm.h @@ -5,8 +5,6 @@ #if defined(OPENSSL_LINUX) && defined(__i386__) # include "./archs/linux-elf/asm/crypto/include/internal/bn_conf.h" -#elif defined(OPENSSL_LINUX) && defined(__ILP32__) -# include "./archs/linux-x32/asm/crypto/include/internal/bn_conf.h" #elif defined(OPENSSL_LINUX) && defined(__x86_64__) # include "./archs/linux-x86_64/asm/crypto/include/internal/bn_conf.h" #elif defined(OPENSSL_LINUX) && defined(__arm__) diff --git a/libs/android/libnode/include/node/openssl/bn_conf_no-asm.h b/libs/android/libnode/include/node/openssl/bn_conf_no-asm.h index a95130e3..cc860485 100644 --- a/libs/android/libnode/include/node/openssl/bn_conf_no-asm.h +++ b/libs/android/libnode/include/node/openssl/bn_conf_no-asm.h @@ -5,8 +5,6 @@ #if defined(OPENSSL_LINUX) && defined(__i386__) # include "./archs/linux-elf/no-asm/crypto/include/internal/bn_conf.h" -#elif defined(OPENSSL_LINUX) && defined(__ILP32__) -# include "./archs/linux-x32/no-asm/crypto/include/internal/bn_conf.h" #elif defined(OPENSSL_LINUX) && defined(__x86_64__) # include "./archs/linux-x86_64/no-asm/crypto/include/internal/bn_conf.h" #elif defined(OPENSSL_LINUX) && defined(__arm__) diff --git a/libs/android/libnode/include/node/openssl/cmp_asm.h b/libs/android/libnode/include/node/openssl/cmp_asm.h new file mode 100644 index 00000000..160d3caa --- /dev/null +++ b/libs/android/libnode/include/node/openssl/cmp_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/cmp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/cmp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/cmp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/cmp.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/cmp.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/cmp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/cmp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/cmp.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/cmp.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/cmp.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/cmp.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/cmp.h" +#else +# include "./archs/linux-elf/asm/include/openssl/cmp.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/cmp_no-asm.h b/libs/android/libnode/include/node/openssl/cmp_no-asm.h new file mode 100644 index 00000000..1221649e --- /dev/null +++ b/libs/android/libnode/include/node/openssl/cmp_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/cmp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/cmp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/cmp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/cmp.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/cmp.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/cmp.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/cmp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/cmp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/cmp.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/cmp.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/cmp.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/cmp.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/cmp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/cmp.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/cmp.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/cms_asm.h b/libs/android/libnode/include/node/openssl/cms_asm.h new file mode 100644 index 00000000..886b77ad --- /dev/null +++ b/libs/android/libnode/include/node/openssl/cms_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/cms.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/cms.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/cms.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/cms.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/cms.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/cms.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/cms.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/cms.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/cms.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/cms.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/cms.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/cms.h" +#else +# include "./archs/linux-elf/asm/include/openssl/cms.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/cms_no-asm.h b/libs/android/libnode/include/node/openssl/cms_no-asm.h new file mode 100644 index 00000000..ac89ec8a --- /dev/null +++ b/libs/android/libnode/include/node/openssl/cms_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/cms.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/cms.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/cms.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/cms.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/cms.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/cms.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/cms.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/cms.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/cms.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/cms.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/cms.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/cms.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/cms.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/cms.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/cms.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/conf_asm.h b/libs/android/libnode/include/node/openssl/conf_asm.h new file mode 100644 index 00000000..60a4d475 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/conf_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/conf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/conf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/conf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/conf.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/conf.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/conf.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/conf.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/conf.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/conf.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/conf.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/conf.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/conf.h" +#else +# include "./archs/linux-elf/asm/include/openssl/conf.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/conf_no-asm.h b/libs/android/libnode/include/node/openssl/conf_no-asm.h new file mode 100644 index 00000000..0bf0c97e --- /dev/null +++ b/libs/android/libnode/include/node/openssl/conf_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/conf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/conf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/conf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/conf.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/conf.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/conf.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/conf.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/conf.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/conf.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/conf.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/conf.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/conf.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/conf.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/conf.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/conf.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/configuration_asm.h b/libs/android/libnode/include/node/openssl/configuration_asm.h new file mode 100644 index 00000000..badc4dab --- /dev/null +++ b/libs/android/libnode/include/node/openssl/configuration_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/configuration.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/configuration.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/configuration.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/configuration.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/configuration.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/configuration.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/configuration.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/configuration.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/configuration.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/configuration.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/configuration.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/configuration.h" +#else +# include "./archs/linux-elf/asm/include/openssl/configuration.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/configuration_no-asm.h b/libs/android/libnode/include/node/openssl/configuration_no-asm.h new file mode 100644 index 00000000..ab505499 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/configuration_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/configuration.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/configuration.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/configuration.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/configuration.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/configuration.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/configuration.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/configuration.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/configuration.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/configuration.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/configuration.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/configuration.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/configuration.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/configuration.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/configuration.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/configuration.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/crmf_asm.h b/libs/android/libnode/include/node/openssl/crmf_asm.h new file mode 100644 index 00000000..1378bd79 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/crmf_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/crmf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/crmf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/crmf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/crmf.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/crmf.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/crmf.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/crmf.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/crmf.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/crmf.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/crmf.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/crmf.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/crmf.h" +#else +# include "./archs/linux-elf/asm/include/openssl/crmf.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/crmf_no-asm.h b/libs/android/libnode/include/node/openssl/crmf_no-asm.h new file mode 100644 index 00000000..0a14cc86 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/crmf_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/crmf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/crmf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/crmf.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/crmf.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/crmf.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/crmf.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/crmf.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/crmf.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/crmf.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/crmf.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/crmf.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/crmf.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/crmf.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/crmf.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/crmf.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/crypto.h b/libs/android/libnode/include/node/openssl/crypto.h index 7d0b5262..5fdd7c3d 100644 --- a/libs/android/libnode/include/node/openssl/crypto.h +++ b/libs/android/libnode/include/node/openssl/crypto.h @@ -161,6 +161,10 @@ const char *OpenSSL_version(int type); # define OPENSSL_DIR 4 # define OPENSSL_ENGINES_DIR 5 +# ifndef OPENSSL_NO_QUIC +# define OPENSSL_INFO_QUIC 2000 +# endif + int OPENSSL_issetugid(void); typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad, diff --git a/libs/android/libnode/include/node/openssl/crypto_asm.h b/libs/android/libnode/include/node/openssl/crypto_asm.h new file mode 100644 index 00000000..23643c96 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/crypto_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/crypto.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/crypto.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/crypto.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/crypto.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/crypto.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/crypto.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/crypto.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/crypto.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/crypto.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/crypto.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/crypto.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/crypto.h" +#else +# include "./archs/linux-elf/asm/include/openssl/crypto.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/crypto_no-asm.h b/libs/android/libnode/include/node/openssl/crypto_no-asm.h new file mode 100644 index 00000000..9b63cb3b --- /dev/null +++ b/libs/android/libnode/include/node/openssl/crypto_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/crypto.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/crypto.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/crypto.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/crypto.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/crypto.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/crypto.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/crypto.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/crypto.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/crypto.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/crypto.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/crypto.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/crypto.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/crypto.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/crypto.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/crypto.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/ct_asm.h b/libs/android/libnode/include/node/openssl/ct_asm.h new file mode 100644 index 00000000..01484b07 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/ct_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/ct.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/ct.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/ct.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/ct.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/ct.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/ct.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/ct.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/ct.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/ct.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/ct.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/ct.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/ct.h" +#else +# include "./archs/linux-elf/asm/include/openssl/ct.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/ct_no-asm.h b/libs/android/libnode/include/node/openssl/ct_no-asm.h new file mode 100644 index 00000000..f4b0d8da --- /dev/null +++ b/libs/android/libnode/include/node/openssl/ct_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/ct.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/ct.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/ct.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/ct.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/ct.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/ct.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/ct.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/ct.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/ct.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/ct.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/ct.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/ct.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/ct.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/ct.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/ct.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/dso_conf_asm.h b/libs/android/libnode/include/node/openssl/dso_conf_asm.h index 510c3328..c4c9d574 100644 --- a/libs/android/libnode/include/node/openssl/dso_conf_asm.h +++ b/libs/android/libnode/include/node/openssl/dso_conf_asm.h @@ -5,8 +5,6 @@ #if defined(OPENSSL_LINUX) && defined(__i386__) # include "./archs/linux-elf/asm/crypto/include/internal/dso_conf.h" -#elif defined(OPENSSL_LINUX) && defined(__ILP32__) -# include "./archs/linux-x32/asm/crypto/include/internal/dso_conf.h" #elif defined(OPENSSL_LINUX) && defined(__x86_64__) # include "./archs/linux-x86_64/asm/crypto/include/internal/dso_conf.h" #elif defined(OPENSSL_LINUX) && defined(__arm__) diff --git a/libs/android/libnode/include/node/openssl/dso_conf_no-asm.h b/libs/android/libnode/include/node/openssl/dso_conf_no-asm.h index 833e4341..1c4a2ca3 100644 --- a/libs/android/libnode/include/node/openssl/dso_conf_no-asm.h +++ b/libs/android/libnode/include/node/openssl/dso_conf_no-asm.h @@ -5,8 +5,6 @@ #if defined(OPENSSL_LINUX) && defined(__i386__) # include "./archs/linux-elf/no-asm/crypto/include/internal/dso_conf.h" -#elif defined(OPENSSL_LINUX) && defined(__ILP32__) -# include "./archs/linux-x32/no-asm/crypto/include/internal/dso_conf.h" #elif defined(OPENSSL_LINUX) && defined(__x86_64__) # include "./archs/linux-x86_64/no-asm/crypto/include/internal/dso_conf.h" #elif defined(OPENSSL_LINUX) && defined(__arm__) diff --git a/libs/android/libnode/include/node/openssl/e_os2.h b/libs/android/libnode/include/node/openssl/e_os2.h index 97a776cd..5c88e519 100644 --- a/libs/android/libnode/include/node/openssl/e_os2.h +++ b/libs/android/libnode/include/node/openssl/e_os2.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -241,7 +241,7 @@ typedef UINT64 uint64_t; defined(__osf__) || defined(__sgi) || defined(__hpux) || \ defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__) # include -# elif defined(_MSC_VER) && _MSC_VER<=1500 +# elif defined(_MSC_VER) && _MSC_VER<1600 /* * minimally required typdefs for systems not supporting inttypes.h or * stdint.h: currently just older VC++ @@ -279,7 +279,8 @@ typedef unsigned __int64 uint64_t; # define ossl_inline inline # endif -# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && \ + !defined(__cplusplus) # define ossl_noreturn _Noreturn # elif defined(__GNUC__) && __GNUC__ >= 2 # define ossl_noreturn __attribute__((noreturn)) diff --git a/libs/android/libnode/include/node/openssl/ec.h b/libs/android/libnode/include/node/openssl/ec.h index 5af9ebdc..24baf53c 100644 --- a/libs/android/libnode/include/node/openssl/ec.h +++ b/libs/android/libnode/include/node/openssl/ec.h @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2021 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * * Licensed under the OpenSSL license (the "License"). You may not use @@ -793,12 +793,15 @@ int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1, EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len); int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out); -# define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x) -# define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x) -# define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \ - (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x)) -# define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \ - (unsigned char *)(x)) +# define d2i_ECPKParameters_bio(bp,x) \ + ASN1_d2i_bio_of(EC_GROUP, NULL, d2i_ECPKParameters, bp, x) +# define i2d_ECPKParameters_bio(bp,x) \ + ASN1_i2d_bio_of_const(EC_GROUP, i2d_ECPKParameters, bp, x) +# define d2i_ECPKParameters_fp(fp,x) \ + (EC_GROUP *)ASN1_d2i_fp(NULL, (d2i_of_void *)d2i_ECPKParameters, (fp), \ + (void **)(x)) +# define i2d_ECPKParameters_fp(fp,x) \ + ASN1_i2d_fp((i2d_of_void *)i2d_ECPKParameters, (fp), (void *)(x)) int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off); # ifndef OPENSSL_NO_STDIO @@ -829,6 +832,8 @@ void EC_KEY_set_flags(EC_KEY *key, int flags); void EC_KEY_clear_flags(EC_KEY *key, int flags); +int EC_KEY_decoded_from_explicit_params(const EC_KEY *key); + /** Creates a new EC_KEY object using a named curve as underlying * EC_GROUP object. * \param nid NID of the named curve. diff --git a/libs/android/libnode/include/node/openssl/ecerr.h b/libs/android/libnode/include/node/openssl/ecerr.h index f7b91834..51738113 100644 --- a/libs/android/libnode/include/node/openssl/ecerr.h +++ b/libs/android/libnode/include/node/openssl/ecerr.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -243,6 +243,7 @@ int ERR_load_EC_strings(void); # define EC_R_LADDER_POST_FAILURE 136 # define EC_R_LADDER_PRE_FAILURE 153 # define EC_R_LADDER_STEP_FAILURE 162 +# define EC_R_MISSING_OID 167 # define EC_R_MISSING_PARAMETERS 124 # define EC_R_MISSING_PRIVATE_KEY 125 # define EC_R_NEED_NEW_SETUP_VALUES 157 diff --git a/libs/android/libnode/include/node/openssl/engine.h b/libs/android/libnode/include/node/openssl/engine.h index 0780f0fb..d707eaeb 100644 --- a/libs/android/libnode/include/node/openssl/engine.h +++ b/libs/android/libnode/include/node/openssl/engine.h @@ -1,5 +1,5 @@ /* - * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * * Licensed under the OpenSSL license (the "License"). You may not use @@ -722,6 +722,7 @@ typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id, CRYPTO_set_mem_functions(fns->mem_fns.malloc_fn, \ fns->mem_fns.realloc_fn, \ fns->mem_fns.free_fn); \ + OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT, NULL); \ skip_cbs: \ if (!fn(e, id)) return 0; \ return 1; } diff --git a/libs/android/libnode/include/node/openssl/err_asm.h b/libs/android/libnode/include/node/openssl/err_asm.h new file mode 100644 index 00000000..d03d4603 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/err_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/err.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/err.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/err.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/err.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/err.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/err.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/err.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/err.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/err.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/err.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/err.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/err.h" +#else +# include "./archs/linux-elf/asm/include/openssl/err.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/err_no-asm.h b/libs/android/libnode/include/node/openssl/err_no-asm.h new file mode 100644 index 00000000..ea4ef7a0 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/err_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/err.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/err.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/err.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/err.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/err.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/err.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/err.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/err.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/err.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/err.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/err.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/err.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/err.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/err.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/err.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/ess_asm.h b/libs/android/libnode/include/node/openssl/ess_asm.h new file mode 100644 index 00000000..02f973e0 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/ess_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/ess.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/ess.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/ess.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/ess.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/ess.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/ess.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/ess.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/ess.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/ess.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/ess.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/ess.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/ess.h" +#else +# include "./archs/linux-elf/asm/include/openssl/ess.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/ess_no-asm.h b/libs/android/libnode/include/node/openssl/ess_no-asm.h new file mode 100644 index 00000000..e906bafe --- /dev/null +++ b/libs/android/libnode/include/node/openssl/ess_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/ess.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/ess.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/ess.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/ess.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/ess.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/ess.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/ess.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/ess.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/ess.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/ess.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/ess.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/ess.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/ess.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/ess.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/ess.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/evp.h b/libs/android/libnode/include/node/openssl/evp.h index a411f3f2..275b7a4a 100644 --- a/libs/android/libnode/include/node/openssl/evp.h +++ b/libs/android/libnode/include/node/openssl/evp.h @@ -1324,6 +1324,10 @@ void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth, */ # define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4 +/* Used by Chromium/QUIC */ +# define X25519_PRIVATE_KEY_LEN 32 +# define X25519_PUBLIC_VALUE_LEN 32 + const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type); EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags); void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags, diff --git a/libs/android/libnode/include/node/openssl/evperr.h b/libs/android/libnode/include/node/openssl/evperr.h index d2b26ea5..b4ea90ae 100644 --- a/libs/android/libnode/include/node/openssl/evperr.h +++ b/libs/android/libnode/include/node/openssl/evperr.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -11,9 +11,7 @@ #ifndef HEADER_EVPERR_H # define HEADER_EVPERR_H -# ifndef HEADER_SYMHACKS_H -# include -# endif +# include # ifdef __cplusplus extern "C" @@ -179,6 +177,7 @@ int ERR_load_EVP_strings(void); # define EVP_R_ONLY_ONESHOT_SUPPORTED 177 # define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150 # define EVP_R_OPERATON_NOT_INITIALIZED 151 +# define EVP_R_OUTPUT_WOULD_OVERFLOW 184 # define EVP_R_PARTIALLY_OVERLAPPING 162 # define EVP_R_PBKDF2_ERROR 181 # define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 179 diff --git a/libs/android/libnode/include/node/openssl/fipskey_asm.h b/libs/android/libnode/include/node/openssl/fipskey_asm.h new file mode 100644 index 00000000..9e4ddbd4 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/fipskey_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/fipskey.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/fipskey.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/fipskey.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/fipskey.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/fipskey.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/fipskey.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/fipskey.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/fipskey.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/fipskey.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/fipskey.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/fipskey.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/fipskey.h" +#else +# include "./archs/linux-elf/asm/include/openssl/fipskey.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/fipskey_no-asm.h b/libs/android/libnode/include/node/openssl/fipskey_no-asm.h new file mode 100644 index 00000000..a760a02b --- /dev/null +++ b/libs/android/libnode/include/node/openssl/fipskey_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/fipskey.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/fipskey.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/fipskey.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/fipskey.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/fipskey.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/fipskey.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/fipskey.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/fipskey.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/fipskey.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/fipskey.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/fipskey.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/fipskey.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/fipskey.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/fipskey.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/fipskey.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/lhash_asm.h b/libs/android/libnode/include/node/openssl/lhash_asm.h new file mode 100644 index 00000000..13025550 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/lhash_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/lhash.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/lhash.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/lhash.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/lhash.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/lhash.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/lhash.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/lhash.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/lhash.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/lhash.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/lhash.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/lhash.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/lhash.h" +#else +# include "./archs/linux-elf/asm/include/openssl/lhash.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/lhash_no-asm.h b/libs/android/libnode/include/node/openssl/lhash_no-asm.h new file mode 100644 index 00000000..62953f76 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/lhash_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/lhash.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/lhash.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/lhash.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/lhash.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/lhash.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/lhash.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/lhash.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/lhash.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/lhash.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/lhash.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/lhash.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/lhash.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/lhash.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/lhash.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/lhash.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/obj_mac.h b/libs/android/libnode/include/node/openssl/obj_mac.h index 483fc050..53516a06 100644 --- a/libs/android/libnode/include/node/openssl/obj_mac.h +++ b/libs/android/libnode/include/node/openssl/obj_mac.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by crypto/objects/objects.pl * - * Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved. * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at diff --git a/libs/android/libnode/include/node/openssl/ocsp_asm.h b/libs/android/libnode/include/node/openssl/ocsp_asm.h new file mode 100644 index 00000000..4483fff2 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/ocsp_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/ocsp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/ocsp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/ocsp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/ocsp.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/ocsp.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/ocsp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/ocsp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/ocsp.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/ocsp.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/ocsp.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/ocsp.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/ocsp.h" +#else +# include "./archs/linux-elf/asm/include/openssl/ocsp.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/ocsp_no-asm.h b/libs/android/libnode/include/node/openssl/ocsp_no-asm.h new file mode 100644 index 00000000..0bf55945 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/ocsp_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/ocsp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/ocsp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/ocsp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/ocsp.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/ocsp.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/ocsp.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/ocsp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/ocsp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/ocsp.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/ocsp.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/ocsp.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/ocsp.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/ocsp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/ocsp.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/ocsp.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/opensslconf_asm.h b/libs/android/libnode/include/node/openssl/opensslconf_asm.h index ad47b2e7..8c2dbd40 100644 --- a/libs/android/libnode/include/node/openssl/opensslconf_asm.h +++ b/libs/android/libnode/include/node/openssl/opensslconf_asm.h @@ -93,8 +93,6 @@ #if defined(OPENSSL_LINUX) && defined(__i386__) # include "./archs/linux-elf/asm/include/openssl/opensslconf.h" -#elif defined(OPENSSL_LINUX) && defined(__ILP32__) -# include "./archs/linux-x32/asm/include/openssl/opensslconf.h" #elif defined(OPENSSL_LINUX) && defined(__x86_64__) # include "./archs/linux-x86_64/asm/include/openssl/opensslconf.h" #elif defined(OPENSSL_LINUX) && defined(__arm__) diff --git a/libs/android/libnode/include/node/openssl/opensslconf_no-asm.h b/libs/android/libnode/include/node/openssl/opensslconf_no-asm.h index efd8ff84..ee9d5e95 100644 --- a/libs/android/libnode/include/node/openssl/opensslconf_no-asm.h +++ b/libs/android/libnode/include/node/openssl/opensslconf_no-asm.h @@ -1,7 +1,5 @@ #if defined(OPENSSL_LINUX) && defined(__i386__) # include "./archs/linux-elf/no-asm/include/openssl/opensslconf.h" -#elif defined(OPENSSL_LINUX) && defined(__ILP32__) -# include "./archs/linux-x32/no-asm/include/openssl/opensslconf.h" #elif defined(OPENSSL_LINUX) && defined(__x86_64__) # include "./archs/linux-x86_64/no-asm/include/openssl/opensslconf.h" #elif defined(OPENSSL_LINUX) && defined(__arm__) diff --git a/libs/android/libnode/include/node/openssl/opensslv.h b/libs/android/libnode/include/node/openssl/opensslv.h index 17d271f5..dafc0410 100644 --- a/libs/android/libnode/include/node/openssl/opensslv.h +++ b/libs/android/libnode/include/node/openssl/opensslv.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -39,8 +39,8 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1010107fL -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.1g 21 Apr 2020" +# define OPENSSL_VERSION_NUMBER 0x1010111fL +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.1q+quic 5 Jul 2022" /*- * The macros below are to be used for shared library (.so, .dll, ...) @@ -92,7 +92,7 @@ extern "C" { * should only keep the versions that are binary compatible with the current. */ # define SHLIB_VERSION_HISTORY "" -# define SHLIB_VERSION_NUMBER "1.1" +# define SHLIB_VERSION_NUMBER "81.1.1" #ifdef __cplusplus diff --git a/libs/android/libnode/include/node/openssl/opensslv_asm.h b/libs/android/libnode/include/node/openssl/opensslv_asm.h new file mode 100644 index 00000000..29879561 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/opensslv_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/opensslv.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/opensslv.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/opensslv.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/opensslv.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/opensslv.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/opensslv.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/opensslv.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/opensslv.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/opensslv.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/opensslv.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/opensslv.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/opensslv.h" +#else +# include "./archs/linux-elf/asm/include/openssl/opensslv.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/opensslv_no-asm.h b/libs/android/libnode/include/node/openssl/opensslv_no-asm.h new file mode 100644 index 00000000..dee43fec --- /dev/null +++ b/libs/android/libnode/include/node/openssl/opensslv_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/opensslv.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/opensslv.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslv.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/opensslv.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/opensslv.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/opensslv.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/opensslv.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/opensslv.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/opensslv.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/opensslv.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/opensslv.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/opensslv.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/opensslv.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/opensslv.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/opensslv.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/ossl_typ.h b/libs/android/libnode/include/node/openssl/ossl_typ.h index e0edfaaf..d2fdce8f 100644 --- a/libs/android/libnode/include/node/openssl/ossl_typ.h +++ b/libs/android/libnode/include/node/openssl/ossl_typ.h @@ -176,6 +176,8 @@ typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX; typedef struct ossl_store_info_st OSSL_STORE_INFO; typedef struct ossl_store_search_st OSSL_STORE_SEARCH; +typedef struct ssl_quic_method_st SSL_QUIC_METHOD; + #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \ defined(INTMAX_MAX) && defined(UINTMAX_MAX) typedef intmax_t ossl_intmax_t; diff --git a/libs/android/libnode/include/node/openssl/pemerr.h b/libs/android/libnode/include/node/openssl/pemerr.h index 0c45918f..4f7e3574 100644 --- a/libs/android/libnode/include/node/openssl/pemerr.h +++ b/libs/android/libnode/include/node/openssl/pemerr.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -61,6 +61,7 @@ int ERR_load_PEM_strings(void); # define PEM_F_PEM_SIGNFINAL 112 # define PEM_F_PEM_WRITE 113 # define PEM_F_PEM_WRITE_BIO 114 +# define PEM_F_PEM_WRITE_BIO_PRIVATEKEY_TRADITIONAL 147 # define PEM_F_PEM_WRITE_PRIVATEKEY 139 # define PEM_F_PEM_X509_INFO_READ 115 # define PEM_F_PEM_X509_INFO_READ_BIO 116 @@ -99,5 +100,6 @@ int ERR_load_PEM_strings(void); # define PEM_R_UNSUPPORTED_CIPHER 113 # define PEM_R_UNSUPPORTED_ENCRYPTION 114 # define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126 +# define PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE 110 #endif diff --git a/libs/android/libnode/include/node/openssl/pkcs12_asm.h b/libs/android/libnode/include/node/openssl/pkcs12_asm.h new file mode 100644 index 00000000..54ad973b --- /dev/null +++ b/libs/android/libnode/include/node/openssl/pkcs12_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/pkcs12.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/pkcs12.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/pkcs12.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/pkcs12.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/pkcs12.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/pkcs12.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/pkcs12.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/pkcs12.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/pkcs12.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/pkcs12.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/pkcs12.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/pkcs12.h" +#else +# include "./archs/linux-elf/asm/include/openssl/pkcs12.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/pkcs12_no-asm.h b/libs/android/libnode/include/node/openssl/pkcs12_no-asm.h new file mode 100644 index 00000000..359e4fb9 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/pkcs12_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/pkcs12.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/pkcs12.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/pkcs12.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/pkcs12.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/pkcs12.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/pkcs12.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/pkcs12.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/pkcs12.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/pkcs12.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/pkcs12.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/pkcs12.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/pkcs12.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/pkcs12.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/pkcs12.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/pkcs12.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/pkcs7_asm.h b/libs/android/libnode/include/node/openssl/pkcs7_asm.h new file mode 100644 index 00000000..b31241b9 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/pkcs7_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/pkcs7.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/pkcs7.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/pkcs7.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/pkcs7.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/pkcs7.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/pkcs7.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/pkcs7.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/pkcs7.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/pkcs7.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/pkcs7.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/pkcs7.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/pkcs7.h" +#else +# include "./archs/linux-elf/asm/include/openssl/pkcs7.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/pkcs7_no-asm.h b/libs/android/libnode/include/node/openssl/pkcs7_no-asm.h new file mode 100644 index 00000000..1f4cc511 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/pkcs7_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/pkcs7.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/pkcs7.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/pkcs7.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/pkcs7.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/pkcs7.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/pkcs7.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/pkcs7.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/pkcs7.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/pkcs7.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/pkcs7.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/pkcs7.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/pkcs7.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/pkcs7.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/pkcs7.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/pkcs7.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/safestack_asm.h b/libs/android/libnode/include/node/openssl/safestack_asm.h new file mode 100644 index 00000000..dea44527 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/safestack_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/safestack.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/safestack.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/safestack.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/safestack.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/safestack.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/safestack.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/safestack.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/safestack.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/safestack.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/safestack.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/safestack.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/safestack.h" +#else +# include "./archs/linux-elf/asm/include/openssl/safestack.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/safestack_no-asm.h b/libs/android/libnode/include/node/openssl/safestack_no-asm.h new file mode 100644 index 00000000..eb13776b --- /dev/null +++ b/libs/android/libnode/include/node/openssl/safestack_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/safestack.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/safestack.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/safestack.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/safestack.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/safestack.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/safestack.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/safestack.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/safestack.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/safestack.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/safestack.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/safestack.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/safestack.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/safestack.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/safestack.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/safestack.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/srp_asm.h b/libs/android/libnode/include/node/openssl/srp_asm.h new file mode 100644 index 00000000..2d7aa655 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/srp_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/srp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/srp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/srp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/srp.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/srp.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/srp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/srp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/srp.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/srp.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/srp.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/srp.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/srp.h" +#else +# include "./archs/linux-elf/asm/include/openssl/srp.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/srp_no-asm.h b/libs/android/libnode/include/node/openssl/srp_no-asm.h new file mode 100644 index 00000000..ffb42b92 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/srp_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/srp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/srp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/srp.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/srp.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/srp.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/srp.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/srp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/srp.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/srp.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/srp.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/srp.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/srp.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/srp.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/srp.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/srp.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/ssl.h b/libs/android/libnode/include/node/openssl/ssl.h index 6724ccf2..63ee3baa 100644 --- a/libs/android/libnode/include/node/openssl/ssl.h +++ b/libs/android/libnode/include/node/openssl/ssl.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * Copyright 2005 Nokia. All rights reserved. * @@ -1305,6 +1305,8 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTRL_GET_MAX_PROTO_VERSION 131 # define SSL_CTRL_GET_SIGNATURE_NID 132 # define SSL_CTRL_GET_TMP_KEY 133 +# define SSL_CTRL_GET_VERIFY_CERT_STORE 137 +# define SSL_CTRL_GET_CHAIN_CERT_STORE 138 # define SSL_CERT_SET_FIRST 1 # define SSL_CERT_SET_NEXT 2 # define SSL_CERT_SET_SERVER 3 @@ -1360,10 +1362,14 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)(st)) # define SSL_CTX_set1_verify_cert_store(ctx,st) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)(st)) +# define SSL_CTX_get0_verify_cert_store(ctx,st) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_GET_VERIFY_CERT_STORE,0,(char *)(st)) # define SSL_CTX_set0_chain_cert_store(ctx,st) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)(st)) # define SSL_CTX_set1_chain_cert_store(ctx,st) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)(st)) +# define SSL_CTX_get0_chain_cert_store(ctx,st) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERT_STORE,0,(char *)(st)) # define SSL_set0_chain(s,sk) \ SSL_ctrl(s,SSL_CTRL_CHAIN,0,(char *)(sk)) # define SSL_set1_chain(s,sk) \ @@ -1386,14 +1392,18 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)(st)) # define SSL_set1_verify_cert_store(s,st) \ SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)(st)) +#define SSL_get0_verify_cert_store(s,st) \ + SSL_ctrl(s,SSL_CTRL_GET_VERIFY_CERT_STORE,0,(char *)(st)) # define SSL_set0_chain_cert_store(s,st) \ SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)(st)) # define SSL_set1_chain_cert_store(s,st) \ SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)(st)) +#define SSL_get0_chain_cert_store(s,st) \ + SSL_ctrl(s,SSL_CTRL_GET_CHAIN_CERT_STORE,0,(char *)(st)) # define SSL_get1_groups(s, glist) \ SSL_ctrl(s,SSL_CTRL_GET_GROUPS,0,(int*)(glist)) # define SSL_CTX_set1_groups(ctx, glist, glistlen) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS,glistlen,(char *)(glist)) + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS,glistlen,(int *)(glist)) # define SSL_CTX_set1_groups_list(ctx, s) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS_LIST,0,(char *)(s)) # define SSL_set1_groups(s, glist, glistlen) \ @@ -1921,6 +1931,7 @@ int SSL_get_key_update_type(const SSL *s); int SSL_renegotiate(SSL *s); int SSL_renegotiate_abbreviated(SSL *s); __owur int SSL_renegotiate_pending(const SSL *s); +int SSL_new_session_ticket(SSL *s); int SSL_shutdown(SSL *s); __owur int SSL_verify_client_post_handshake(SSL *s); void SSL_CTX_set_post_handshake_auth(SSL_CTX *ctx, int val); @@ -2432,6 +2443,66 @@ void SSL_set_allow_early_data_cb(SSL *s, SSL_allow_early_data_cb_fn cb, void *arg); +# ifndef OPENSSL_NO_QUIC +/* + * QUIC integration - The QUIC interface matches BoringSSL + * + * ssl_encryption_level_t represents a specific QUIC encryption level used to + * transmit handshake messages. BoringSSL has this as an 'enum'. + */ +typedef enum ssl_encryption_level_t { + ssl_encryption_initial = 0, + ssl_encryption_early_data, + ssl_encryption_handshake, + ssl_encryption_application +} OSSL_ENCRYPTION_LEVEL; + +struct ssl_quic_method_st { + int (*set_encryption_secrets)(SSL *ssl, OSSL_ENCRYPTION_LEVEL level, + const uint8_t *read_secret, + const uint8_t *write_secret, size_t secret_len); + int (*add_handshake_data)(SSL *ssl, OSSL_ENCRYPTION_LEVEL level, + const uint8_t *data, size_t len); + int (*flush_flight)(SSL *ssl); + int (*send_alert)(SSL *ssl, enum ssl_encryption_level_t level, uint8_t alert); +}; + +__owur int SSL_CTX_set_quic_method(SSL_CTX *ctx, const SSL_QUIC_METHOD *quic_method); +__owur int SSL_set_quic_method(SSL *ssl, const SSL_QUIC_METHOD *quic_method); +__owur int SSL_set_quic_transport_params(SSL *ssl, + const uint8_t *params, + size_t params_len); +void SSL_get_peer_quic_transport_params(const SSL *ssl, + const uint8_t **out_params, + size_t *out_params_len); +__owur size_t SSL_quic_max_handshake_flight_len(const SSL *ssl, OSSL_ENCRYPTION_LEVEL level); +__owur OSSL_ENCRYPTION_LEVEL SSL_quic_read_level(const SSL *ssl); +__owur OSSL_ENCRYPTION_LEVEL SSL_quic_write_level(const SSL *ssl); +__owur int SSL_provide_quic_data(SSL *ssl, OSSL_ENCRYPTION_LEVEL level, + const uint8_t *data, size_t len); +__owur int SSL_process_quic_post_handshake(SSL *ssl); + +__owur int SSL_is_quic(SSL *ssl); + +/* BoringSSL API */ +void SSL_set_quic_use_legacy_codepoint(SSL *ssl, int use_legacy); + +/* + * Set an explicit value that you want to use + * If 0 (default) the server will use the highest extenstion the client sent + * If 0 (default) the client will send both extensions + */ +void SSL_set_quic_transport_version(SSL *ssl, int version); +__owur int SSL_get_quic_transport_version(const SSL *ssl); +/* Returns the negotiated version, or -1 on error */ +__owur int SSL_get_peer_quic_transport_version(const SSL *ssl); + +int SSL_CIPHER_get_prf_nid(const SSL_CIPHER *c); + +void SSL_set_quic_early_data_enabled(SSL *ssl, int enabled); + +# endif + # ifdef __cplusplus } # endif diff --git a/libs/android/libnode/include/node/openssl/ssl3.h b/libs/android/libnode/include/node/openssl/ssl3.h index 8d01fcc4..07effba2 100644 --- a/libs/android/libnode/include/node/openssl/ssl3.h +++ b/libs/android/libnode/include/node/openssl/ssl3.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * * Licensed under the OpenSSL license (the "License"). You may not use @@ -292,6 +292,9 @@ extern "C" { # define TLS1_FLAGS_STATELESS 0x0800 +/* Set if extended master secret extension required on renegotiation */ +# define TLS1_FLAGS_REQUIRED_EXTMS 0x1000 + # define SSL3_MT_HELLO_REQUEST 0 # define SSL3_MT_CLIENT_HELLO 1 # define SSL3_MT_SERVER_HELLO 2 diff --git a/libs/android/libnode/include/node/openssl/ssl_asm.h b/libs/android/libnode/include/node/openssl/ssl_asm.h new file mode 100644 index 00000000..2fb2e122 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/ssl_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/ssl.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/ssl.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/ssl.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/ssl.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/ssl.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/ssl.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/ssl.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/ssl.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/ssl.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/ssl.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/ssl.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/ssl.h" +#else +# include "./archs/linux-elf/asm/include/openssl/ssl.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/ssl_no-asm.h b/libs/android/libnode/include/node/openssl/ssl_no-asm.h new file mode 100644 index 00000000..c64d4370 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/ssl_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/ssl.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/ssl.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/ssl.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/ssl.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/ssl.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/ssl.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/ssl.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/ssl.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/ssl.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/ssl.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/ssl.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/ssl.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/ssl.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/ssl.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/ssl.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/sslerr.h b/libs/android/libnode/include/node/openssl/sslerr.h index 82983d3c..64e152cc 100644 --- a/libs/android/libnode/include/node/openssl/sslerr.h +++ b/libs/android/libnode/include/node/openssl/sslerr.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -70,6 +70,8 @@ int ERR_load_SSL_strings(void); # define SSL_F_FINAL_EMS 486 # define SSL_F_FINAL_KEY_SHARE 503 # define SSL_F_FINAL_MAXFRAGMENTLEN 557 +# define SSL_F_FINAL_PSK 639 +# define SSL_F_FINAL_QUIC_TRANSPORT_PARAMS 3012 # define SSL_F_FINAL_RENEGOTIATE 483 # define SSL_F_FINAL_SERVER_NAME 558 # define SSL_F_FINAL_SIG_ALGS 497 @@ -96,6 +98,9 @@ int ERR_load_SSL_strings(void); # define SSL_F_PITEM_NEW 624 # define SSL_F_PQUEUE_NEW 625 # define SSL_F_PROCESS_KEY_SHARE_EXT 439 +# define SSL_F_QUIC_CHANGE_CIPHER_STATE 3000 +# define SSL_F_QUIC_GET_MESSAGE 3001 +# define SSL_F_QUIC_SET_ENCRYPTION_SECRETS 3002 # define SSL_F_READ_STATE_MACHINE 352 # define SSL_F_SET_CLIENT_CIPHERSUITE 540 # define SSL_F_SRP_GENERATE_CLIENT_MASTER_SECRET 595 @@ -106,7 +111,9 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL3_CTRL 213 # define SSL_F_SSL3_CTX_CTRL 133 # define SSL_F_SSL3_DIGEST_CACHED_RECORDS 293 +# define SSL_F_SSL3_DISPATCH_ALERT 3003 # define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 292 +# define SSL_F_SSL3_DO_WRITE 3004 # define SSL_F_SSL3_ENC 608 # define SSL_F_SSL3_FINAL_FINISH_MAC 285 # define SSL_F_SSL3_FINISH_MAC 587 @@ -211,6 +218,8 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL_PEEK 270 # define SSL_F_SSL_PEEK_EX 432 # define SSL_F_SSL_PEEK_INTERNAL 522 +# define SSL_F_SSL_PROCESS_QUIC_POST_HANDSHAKE 3005 +# define SSL_F_SSL_PROVIDE_QUIC_DATA 3006 # define SSL_F_SSL_READ 223 # define SSL_F_SSL_READ_EARLY_DATA 529 # define SSL_F_SSL_READ_EX 434 @@ -260,6 +269,7 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL_WRITE_EARLY_FINISH 527 # define SSL_F_SSL_WRITE_EX 433 # define SSL_F_SSL_WRITE_INTERNAL 524 +# define SSL_F_STATEM_FLUSH 3007 # define SSL_F_STATE_MACHINE 353 # define SSL_F_TLS12_CHECK_PEER_SIGALG 333 # define SSL_F_TLS12_COPY_SIGALGS 533 @@ -319,6 +329,8 @@ int ERR_load_SSL_strings(void); # define SSL_F_TLS_CONSTRUCT_CTOS_POST_HANDSHAKE_AUTH 619 # define SSL_F_TLS_CONSTRUCT_CTOS_PSK 501 # define SSL_F_TLS_CONSTRUCT_CTOS_PSK_KEX_MODES 509 +# define SSL_F_TLS_CONSTRUCT_CTOS_QUIC_TRANSPORT_PARAMS 3008 +# define SSL_F_TLS_CONSTRUCT_CTOS_QUIC_TRANSPORT_PARAMS_DRAFT 3013 # define SSL_F_TLS_CONSTRUCT_CTOS_RENEGOTIATE 473 # define SSL_F_TLS_CONSTRUCT_CTOS_SCT 474 # define SSL_F_TLS_CONSTRUCT_CTOS_SERVER_NAME 475 @@ -358,6 +370,8 @@ int ERR_load_SSL_strings(void); # define SSL_F_TLS_CONSTRUCT_STOC_MAXFRAGMENTLEN 548 # define SSL_F_TLS_CONSTRUCT_STOC_NEXT_PROTO_NEG 457 # define SSL_F_TLS_CONSTRUCT_STOC_PSK 504 +# define SSL_F_TLS_CONSTRUCT_STOC_QUIC_TRANSPORT_PARAMS 3009 +# define SSL_F_TLS_CONSTRUCT_STOC_QUIC_TRANSPORT_PARAMS_DRAFT 3014 # define SSL_F_TLS_CONSTRUCT_STOC_RENEGOTIATE 458 # define SSL_F_TLS_CONSTRUCT_STOC_SERVER_NAME 459 # define SSL_F_TLS_CONSTRUCT_STOC_SESSION_TICKET 460 @@ -383,6 +397,8 @@ int ERR_load_SSL_strings(void); # define SSL_F_TLS_PARSE_CTOS_POST_HANDSHAKE_AUTH 620 # define SSL_F_TLS_PARSE_CTOS_PSK 505 # define SSL_F_TLS_PARSE_CTOS_PSK_KEX_MODES 572 +# define SSL_F_TLS_PARSE_CTOS_QUIC_TRANSPORT_PARAMS 3010 +# define SSL_F_TLS_PARSE_CTOS_QUIC_TRANSPORT_PARAMS_DRAFT 3015 # define SSL_F_TLS_PARSE_CTOS_RENEGOTIATE 464 # define SSL_F_TLS_PARSE_CTOS_SERVER_NAME 573 # define SSL_F_TLS_PARSE_CTOS_SESSION_TICKET 574 @@ -401,6 +417,8 @@ int ERR_load_SSL_strings(void); # define SSL_F_TLS_PARSE_STOC_MAXFRAGMENTLEN 581 # define SSL_F_TLS_PARSE_STOC_NPN 582 # define SSL_F_TLS_PARSE_STOC_PSK 502 +# define SSL_F_TLS_PARSE_STOC_QUIC_TRANSPORT_PARAMS 3011 +# define SSL_F_TLS_PARSE_STOC_QUIC_TRANSPORT_PARAMS_DRAFT 3016 # define SSL_F_TLS_PARSE_STOC_RENEGOTIATE 448 # define SSL_F_TLS_PARSE_STOC_SCT 564 # define SSL_F_TLS_PARSE_STOC_SERVER_NAME 583 @@ -592,6 +610,8 @@ int ERR_load_SSL_strings(void); # define SSL_R_MISSING_ECDSA_SIGNING_CERT 381 # define SSL_R_MISSING_FATAL 256 # define SSL_R_MISSING_PARAMETERS 290 +# define SSL_R_MISSING_PSK_KEX_MODES_EXTENSION 310 +# define SSL_R_MISSING_QUIC_TRANSPORT_PARAMETERS_EXTENSION 801 # define SSL_R_MISSING_RSA_CERTIFICATE 168 # define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169 # define SSL_R_MISSING_RSA_SIGNING_CERT 170 @@ -633,6 +653,7 @@ int ERR_load_SSL_strings(void); # define SSL_R_NO_VERIFY_COOKIE_CALLBACK 403 # define SSL_R_NULL_SSL_CTX 195 # define SSL_R_NULL_SSL_METHOD_PASSED 196 +# define SSL_R_OCSP_CALLBACK_FAILURE 294 # define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197 # define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344 # define SSL_R_OVERFLOW_ERROR 237 @@ -762,6 +783,7 @@ int ERR_load_SSL_strings(void); # define SSL_R_WRONG_CERTIFICATE_TYPE 383 # define SSL_R_WRONG_CIPHER_RETURNED 261 # define SSL_R_WRONG_CURVE 378 +# define SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED 800 # define SSL_R_WRONG_SIGNATURE_LENGTH 264 # define SSL_R_WRONG_SIGNATURE_SIZE 265 # define SSL_R_WRONG_SIGNATURE_TYPE 370 diff --git a/libs/android/libnode/include/node/openssl/tls1.h b/libs/android/libnode/include/node/openssl/tls1.h index 76d9fda4..2cbf5326 100644 --- a/libs/android/libnode/include/node/openssl/tls1.h +++ b/libs/android/libnode/include/node/openssl/tls1.h @@ -148,6 +148,10 @@ extern "C" { /* Temporary extension type */ # define TLSEXT_TYPE_renegotiate 0xff01 +/* ExtensionType value from draft-ietf-quic-tls-27 */ +# define TLSEXT_TYPE_quic_transport_parameters_draft 0xffa5 +# define TLSEXT_TYPE_quic_transport_parameters 0x0039 + # ifndef OPENSSL_NO_NEXTPROTONEG /* This is not an IANA defined extension number */ # define TLSEXT_TYPE_next_proto_neg 13172 diff --git a/libs/android/libnode/include/node/openssl/ui_asm.h b/libs/android/libnode/include/node/openssl/ui_asm.h new file mode 100644 index 00000000..14b60900 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/ui_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/ui.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/ui.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/ui.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/ui.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/ui.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/ui.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/ui.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/ui.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/ui.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/ui.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/ui.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/ui.h" +#else +# include "./archs/linux-elf/asm/include/openssl/ui.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/ui_no-asm.h b/libs/android/libnode/include/node/openssl/ui_no-asm.h new file mode 100644 index 00000000..fd248b2b --- /dev/null +++ b/libs/android/libnode/include/node/openssl/ui_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/ui.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/ui.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/ui.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/ui.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/ui.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/ui.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/ui.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/ui.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/ui.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/ui.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/ui.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/ui.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/ui.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/ui.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/ui.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/x509.h b/libs/android/libnode/include/node/openssl/x509.h index 39ca0ba5..3ff86ec7 100644 --- a/libs/android/libnode/include/node/openssl/x509.h +++ b/libs/android/libnode/include/node/openssl/x509.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * * Licensed under the OpenSSL license (the "License"). You may not use @@ -478,6 +478,7 @@ void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval, const X509_ALGOR *algor); void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md); int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b); +int X509_ALGOR_copy(X509_ALGOR *dest, const X509_ALGOR *src); X509_NAME *X509_NAME_dup(X509_NAME *xn); X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); @@ -679,6 +680,8 @@ X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req); int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name); void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, const X509_ALGOR **palg); +void X509_REQ_set0_signature(X509_REQ *req, ASN1_BIT_STRING *psig); +int X509_REQ_set1_signature_algo(X509_REQ *req, X509_ALGOR *palg); int X509_REQ_get_signature_nid(const X509_REQ *req); int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp); int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); @@ -930,7 +933,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) int type, const unsigned char *bytes, int len); -void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, +void *X509at_get0_data_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *x, const ASN1_OBJECT *obj, int lastpos, int type); X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, int atrtype, const void *data, diff --git a/libs/android/libnode/include/node/openssl/x509_asm.h b/libs/android/libnode/include/node/openssl/x509_asm.h new file mode 100644 index 00000000..2f5d611d --- /dev/null +++ b/libs/android/libnode/include/node/openssl/x509_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/x509.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/x509.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/x509.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/x509.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/x509.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/x509.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/x509.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/x509.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/x509.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/x509.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/x509.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/x509.h" +#else +# include "./archs/linux-elf/asm/include/openssl/x509.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/x509_no-asm.h b/libs/android/libnode/include/node/openssl/x509_no-asm.h new file mode 100644 index 00000000..155f2993 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/x509_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/x509.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/x509.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/x509.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/x509.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/x509.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/x509.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/x509.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/x509.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/x509.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/x509.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/x509.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/x509.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/x509.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/x509.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/x509.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/x509_vfy.h b/libs/android/libnode/include/node/openssl/x509_vfy.h index adb8bce7..25c79f1b 100644 --- a/libs/android/libnode/include/node/openssl/x509_vfy.h +++ b/libs/android/libnode/include/node/openssl/x509_vfy.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -184,6 +184,10 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); # define X509_V_ERR_OCSP_VERIFY_NEEDED 73 /* Need OCSP verification */ # define X509_V_ERR_OCSP_VERIFY_FAILED 74 /* Couldn't verify cert through OCSP */ # define X509_V_ERR_OCSP_CERT_UNKNOWN 75 /* Certificate wasn't recognized by the OCSP responder */ +# define X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH 76 +# define X509_V_ERR_NO_ISSUER_PUBLIC_KEY 77 +# define X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM 78 +# define X509_V_ERR_EC_KEY_EXPLICIT_PARAMS 79 /* Certificate verify flags */ diff --git a/libs/android/libnode/include/node/openssl/x509_vfy_asm.h b/libs/android/libnode/include/node/openssl/x509_vfy_asm.h new file mode 100644 index 00000000..7358b595 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/x509_vfy_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/x509_vfy.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/x509_vfy.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/x509_vfy.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/x509_vfy.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/x509_vfy.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/x509_vfy.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/x509_vfy.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/x509_vfy.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/x509_vfy.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/x509_vfy.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/x509_vfy.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/x509_vfy.h" +#else +# include "./archs/linux-elf/asm/include/openssl/x509_vfy.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/x509_vfy_no-asm.h b/libs/android/libnode/include/node/openssl/x509_vfy_no-asm.h new file mode 100644 index 00000000..7c742506 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/x509_vfy_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/x509_vfy.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/x509_vfy.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/x509_vfy.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/x509_vfy.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/x509_vfy.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/x509_vfy.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/x509_vfy.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/x509_vfy.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/x509_vfy.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/x509_vfy.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/x509_vfy.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/x509_vfy.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/x509_vfy.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/x509_vfy.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/x509_vfy.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/x509err.h b/libs/android/libnode/include/node/openssl/x509err.h index 02738531..cd08673f 100644 --- a/libs/android/libnode/include/node/openssl/x509err.h +++ b/libs/android/libnode/include/node/openssl/x509err.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -11,9 +11,7 @@ #ifndef HEADER_X509ERR_H # define HEADER_X509ERR_H -# ifndef HEADER_SYMHACKS_H -# include -# endif +# include # ifdef __cplusplus extern "C" @@ -65,6 +63,7 @@ int ERR_load_X509_strings(void); # define X509_F_X509_OBJECT_NEW 150 # define X509_F_X509_PRINT_EX_FP 118 # define X509_F_X509_PUBKEY_DECODE 148 +# define X509_F_X509_PUBKEY_GET 161 # define X509_F_X509_PUBKEY_GET0 119 # define X509_F_X509_PUBKEY_SET 120 # define X509_F_X509_REQ_CHECK_PRIVATE_KEY 144 diff --git a/libs/android/libnode/include/node/openssl/x509v3.h b/libs/android/libnode/include/node/openssl/x509v3.h index 6c6eca38..90fa3592 100644 --- a/libs/android/libnode/include/node/openssl/x509v3.h +++ b/libs/android/libnode/include/node/openssl/x509v3.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -364,8 +364,9 @@ struct ISSUING_DIST_POINT_st { # define EXFLAG_INVALID_POLICY 0x800 # define EXFLAG_FRESHEST 0x1000 -/* Self signed */ -# define EXFLAG_SS 0x2000 +# define EXFLAG_SS 0x2000 /* cert is apparently self-signed */ + +# define EXFLAG_NO_FINGERPRINT 0x100000 # define KU_DIGITAL_SIGNATURE 0x0080 # define KU_NON_REPUDIATION 0x0040 diff --git a/libs/android/libnode/include/node/openssl/x509v3_asm.h b/libs/android/libnode/include/node/openssl/x509v3_asm.h new file mode 100644 index 00000000..40102307 --- /dev/null +++ b/libs/android/libnode/include/node/openssl/x509v3_asm.h @@ -0,0 +1,57 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/asm/include/openssl/x509v3.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/asm/include/openssl/x509v3.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/asm/include/openssl/x509v3.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/asm/include/openssl/x509v3.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/asm/include/openssl/x509v3.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/asm/include/openssl/x509v3.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/asm/include/openssl/x509v3.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/asm/include/openssl/x509v3.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/asm/include/openssl/x509v3.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/asm/include/openssl/x509v3.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/asm/include/openssl/x509v3.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/asm/include/openssl/x509v3.h" +#else +# include "./archs/linux-elf/asm/include/openssl/x509v3.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/x509v3_no-asm.h b/libs/android/libnode/include/node/openssl/x509v3_no-asm.h new file mode 100644 index 00000000..ce9001ac --- /dev/null +++ b/libs/android/libnode/include/node/openssl/x509v3_no-asm.h @@ -0,0 +1,59 @@ +#undef OPENSSL_LINUX +#if defined(__linux) && !defined(__ANDROID__) +# define OPENSSL_LINUX 1 +#endif + +#if defined(OPENSSL_LINUX) && defined(__i386__) +# include "./archs/linux-elf/no-asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__x86_64__) +# include "./archs/linux-x86_64/no-asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__arm__) +# include "./archs/linux-armv4/no-asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__aarch64__) +# include "./archs/linux-aarch64/no-asm/include/openssl/x509v3.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) +# include "./archs/darwin-i386-cc/no-asm/include/openssl/x509v3.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) +# include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/x509v3.h" +#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) +# include "./archs/darwin64-arm64-cc/no-asm/include/openssl/x509v3.h" +#elif defined(_WIN32) && defined(_M_IX86) +# include "./archs/VC-WIN32/no-asm/include/openssl/x509v3.h" +#elif defined(_WIN32) && defined(_M_X64) +# include "./archs/VC-WIN64A/no-asm/include/openssl/x509v3.h" +#elif defined(_WIN32) && defined(_M_ARM64) +# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/x509v3.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +# include "./archs/BSD-x86/no-asm/include/openssl/x509v3.h" +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +# include "./archs/BSD-x86_64/no-asm/include/openssl/x509v3.h" +#elif defined(__sun) && defined(__i386__) +# include "./archs/solaris-x86-gcc/no-asm/include/openssl/x509v3.h" +#elif defined(__sun) && defined(__x86_64__) +# include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) +# include "./archs/linux-ppc64le/no-asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__PPC64__) +# include "./archs/linux-ppc64/no-asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) +# include "./archs/linux-ppc/no-asm/include/openssl/x509v3.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc-as/no-asm/include/openssl/x509v3.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/no-asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/no-asm/include/openssl/x509v3.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/no-asm/include/openssl/x509v3.h" +#else +# include "./archs/linux-elf/no-asm/include/openssl/x509v3.h" +#endif + +/* GOST is not included in all platform */ +#ifndef OPENSSL_NO_GOST +# define OPENSSL_NO_GOST +#endif +/* HW_PADLOCK is not included in all platform */ +#ifndef OPENSSL_NO_HW_PADLOCK +# define OPENSSL_NO_HW_PADLOCK +#endif diff --git a/libs/android/libnode/include/node/openssl/x509v3err.h b/libs/android/libnode/include/node/openssl/x509v3err.h index 5f25442f..3b9f7139 100644 --- a/libs/android/libnode/include/node/openssl/x509v3err.h +++ b/libs/android/libnode/include/node/openssl/x509v3err.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -38,6 +38,7 @@ int ERR_load_X509V3_strings(void); # define X509V3_F_I2S_ASN1_IA5STRING 149 # define X509V3_F_I2S_ASN1_INTEGER 120 # define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 138 +# define X509V3_F_I2V_AUTHORITY_KEYID 173 # define X509V3_F_LEVEL_ADD_NODE 168 # define X509V3_F_NOTICE_SECTION 132 # define X509V3_F_NREF_NOS 133 @@ -78,6 +79,7 @@ int ERR_load_X509V3_strings(void); # define X509V3_F_V2I_TLS_FEATURE 165 # define X509V3_F_V3_GENERIC_EXTENSION 116 # define X509V3_F_X509V3_ADD1_I2D 140 +# define X509V3_F_X509V3_ADD_LEN_VALUE 174 # define X509V3_F_X509V3_ADD_VALUE 105 # define X509V3_F_X509V3_EXT_ADD 104 # define X509V3_F_X509V3_EXT_ADD_ALIAS 106 diff --git a/libs/android/libnode/include/node/uv.h b/libs/android/libnode/include/node/uv.h index 06b6d001..606083c8 100644 --- a/libs/android/libnode/include/node/uv.h +++ b/libs/android/libnode/include/node/uv.h @@ -45,6 +45,8 @@ extern "C" { # endif #elif __GNUC__ >= 4 # define UV_EXTERN __attribute__((visibility("default"))) +#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) /* Sun Studio >= 8 */ +# define UV_EXTERN __global #else # define UV_EXTERN /* nothing */ #endif @@ -126,6 +128,7 @@ extern "C" { XX(ENOTEMPTY, "directory not empty") \ XX(ENOTSOCK, "socket operation on non-socket") \ XX(ENOTSUP, "operation not supported on socket") \ + XX(EOVERFLOW, "value too large for defined data type") \ XX(EPERM, "operation not permitted") \ XX(EPIPE, "broken pipe") \ XX(EPROTO, "protocol error") \ @@ -148,6 +151,7 @@ extern "C" { XX(ENOTTY, "inappropriate ioctl for device") \ XX(EFTYPE, "inappropriate file type or format") \ XX(EILSEQ, "illegal byte sequence") \ + XX(ESOCKTNOSUPPORT, "socket type not supported") \ #define UV_HANDLE_TYPE_MAP(XX) \ XX(ASYNC, async) \ @@ -475,6 +479,12 @@ UV_EXTERN int uv_fileno(const uv_handle_t* handle, uv_os_fd_t* fd); UV_EXTERN uv_buf_t uv_buf_init(char* base, unsigned int len); +UV_EXTERN int uv_pipe(uv_file fds[2], int read_flags, int write_flags); +UV_EXTERN int uv_socketpair(int type, + int protocol, + uv_os_sock_t socket_vector[2], + int flags0, + int flags1); #define UV_STREAM_FIELDS \ /* number of bytes queued for writing */ \ @@ -520,6 +530,10 @@ UV_EXTERN int uv_write2(uv_write_t* req, UV_EXTERN int uv_try_write(uv_stream_t* handle, const uv_buf_t bufs[], unsigned int nbufs); +UV_EXTERN int uv_try_write2(uv_stream_t* handle, + const uv_buf_t bufs[], + unsigned int nbufs, + uv_stream_t* send_handle); /* uv_write_t is a subclass of uv_req_t. */ struct uv_write_s { @@ -614,7 +628,20 @@ enum uv_udp_flags { * must not be freed by the recv_cb callback. */ UV_UDP_MMSG_CHUNK = 8, - + /* + * Indicates that the buffer provided has been fully utilized by recvmmsg and + * that it should now be freed by the recv_cb callback. When this flag is set + * in uv_udp_recv_cb, nread will always be 0 and addr will always be NULL. + */ + UV_UDP_MMSG_FREE = 16, + /* + * Indicates if IP_RECVERR/IPV6_RECVERR will be set when binding the handle. + * This sets IP_RECVERR for IPv4 and IPV6_RECVERR for IPv6 UDP sockets on + * Linux. This stops the Linux kernel from suppressing some ICMP error + * messages and enables full ICMP error reporting for faster failover. + * This flag is no-op on platforms other than Linux. + */ + UV_UDP_LINUX_RECVERR = 32, /* * Indicates that recvmmsg should be used, if available. */ @@ -865,6 +892,7 @@ UV_EXTERN int uv_timer_stop(uv_timer_t* handle); UV_EXTERN int uv_timer_again(uv_timer_t* handle); UV_EXTERN void uv_timer_set_repeat(uv_timer_t* handle, uint64_t repeat); UV_EXTERN uint64_t uv_timer_get_repeat(const uv_timer_t* handle); +UV_EXTERN uint64_t uv_timer_get_due_in(const uv_timer_t* handle); /* @@ -926,10 +954,13 @@ typedef enum { UV_WRITABLE_PIPE = 0x20, /* - * Open the child pipe handle in overlapped mode on Windows. - * On Unix it is silently ignored. + * When UV_CREATE_PIPE is specified, specifying UV_NONBLOCK_PIPE opens the + * handle in non-blocking mode in the child. This may cause loss of data, + * if the child is not designed to handle to encounter this mode, + * but can also be significantly more efficient. */ - UV_OVERLAPPED_PIPE = 0x40 + UV_NONBLOCK_PIPE = 0x40, + UV_OVERLAPPED_PIPE = 0x40 /* old name, for compatibility */ } uv_stdio_flags; typedef struct uv_stdio_container_s { @@ -1629,6 +1660,7 @@ UV_EXTERN int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr); UV_EXTERN int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size); UV_EXTERN int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size); +UV_EXTERN int uv_ip_name(const struct sockaddr* src, char* dst, size_t size); UV_EXTERN int uv_inet_ntop(int af, const void* src, char* dst, size_t size); UV_EXTERN int uv_inet_pton(int af, const char* src, void* dst); diff --git a/libs/android/libnode/include/node/uv/errno.h b/libs/android/libnode/include/node/uv/errno.h index 165fd11c..71906b3f 100644 --- a/libs/android/libnode/include/node/uv/errno.h +++ b/libs/android/libnode/include/node/uv/errno.h @@ -317,7 +317,7 @@ #if defined(EPROTO) && !defined(_WIN32) # define UV__EPROTO UV__ERR(EPROTO) #else -# define UV__EPROTO UV__ERR(4046) +# define UV__EPROTO (-4046) #endif #if defined(EPROTONOSUPPORT) && !defined(_WIN32) @@ -445,4 +445,16 @@ # define UV__EILSEQ (-4027) #endif +#if defined(EOVERFLOW) && !defined(_WIN32) +# define UV__EOVERFLOW UV__ERR(EOVERFLOW) +#else +# define UV__EOVERFLOW (-4026) +#endif + +#if defined(ESOCKTNOSUPPORT) && !defined(_WIN32) +# define UV__ESOCKTNOSUPPORT UV__ERR(ESOCKTNOSUPPORT) +#else +# define UV__ESOCKTNOSUPPORT (-4025) +#endif + #endif /* UV_ERRNO_H_ */ diff --git a/libs/android/libnode/include/node/uv/tree.h b/libs/android/libnode/include/node/uv/tree.h index f936416e..2b28835f 100644 --- a/libs/android/libnode/include/node/uv/tree.h +++ b/libs/android/libnode/include/node/uv/tree.h @@ -251,7 +251,7 @@ void name##_SPLAY_MINMAX(struct name *head, int __comp) \ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL; \ __left = __right = &__node; \ \ - while (1) { \ + for (;;) { \ if (__comp < 0) { \ __tmp = SPLAY_LEFT((head)->sph_root, field); \ if (__tmp == NULL) \ diff --git a/libs/android/libnode/include/node/uv/unix.h b/libs/android/libnode/include/node/uv/unix.h index 3a131638..ea37d787 100644 --- a/libs/android/libnode/include/node/uv/unix.h +++ b/libs/android/libnode/include/node/uv/unix.h @@ -65,10 +65,10 @@ # include "uv/bsd.h" #elif defined(__CYGWIN__) || \ defined(__MSYS__) || \ + defined(__HAIKU__) || \ + defined(__QNX__) || \ defined(__GNU__) # include "uv/posix.h" -#elif defined(__HAIKU__) -# include "uv/posix.h" #endif #ifndef NI_MAXHOST diff --git a/libs/android/libnode/include/node/uv/version.h b/libs/android/libnode/include/node/uv/version.h index 3219e963..46f46929 100644 --- a/libs/android/libnode/include/node/uv/version.h +++ b/libs/android/libnode/include/node/uv/version.h @@ -31,7 +31,7 @@ */ #define UV_VERSION_MAJOR 1 -#define UV_VERSION_MINOR 39 +#define UV_VERSION_MINOR 43 #define UV_VERSION_PATCH 0 #define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_SUFFIX "" diff --git a/libs/android/libnode/include/node/uv/win.h b/libs/android/libnode/include/node/uv/win.h index f5f1d3a3..5fecf4bf 100644 --- a/libs/android/libnode/include/node/uv/win.h +++ b/libs/android/libnode/include/node/uv/win.h @@ -45,7 +45,14 @@ typedef struct pollfd { #endif #include +// Disable the typedef in mstcpip.h of MinGW. +#define _TCP_INITIAL_RTO_PARAMETERS _TCP_INITIAL_RTO_PARAMETERS__AVOID +#define TCP_INITIAL_RTO_PARAMETERS TCP_INITIAL_RTO_PARAMETERS__AVOID +#define PTCP_INITIAL_RTO_PARAMETERS PTCP_INITIAL_RTO_PARAMETERS__AVOID #include +#undef _TCP_INITIAL_RTO_PARAMETERS +#undef TCP_INITIAL_RTO_PARAMETERS +#undef PTCP_INITIAL_RTO_PARAMETERS #include #include diff --git a/libs/android/libnode/include/node/v8-cppgc.h b/libs/android/libnode/include/node/v8-cppgc.h new file mode 100644 index 00000000..745fb043 --- /dev/null +++ b/libs/android/libnode/include/node/v8-cppgc.h @@ -0,0 +1,325 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_V8_CPPGC_H_ +#define INCLUDE_V8_CPPGC_H_ + +#include +#include +#include + +#include "cppgc/common.h" +#include "cppgc/custom-space.h" +#include "cppgc/heap-statistics.h" +#include "cppgc/internal/write-barrier.h" +#include "cppgc/visitor.h" +#include "v8-internal.h" // NOLINT(build/include_directory) +#include "v8.h" // NOLINT(build/include_directory) + +namespace cppgc { +class AllocationHandle; +class HeapHandle; +} // namespace cppgc + +namespace v8 { + +namespace internal { +class CppHeap; +} // namespace internal + +class CustomSpaceStatisticsReceiver; + +/** + * Describes how V8 wrapper objects maintain references to garbage-collected C++ + * objects. + */ +struct WrapperDescriptor final { + /** + * The index used on `v8::Ojbect::SetAlignedPointerFromInternalField()` and + * related APIs to add additional data to an object which is used to identify + * JS->C++ references. + */ + using InternalFieldIndex = int; + + /** + * Unknown embedder id. The value is reserved for internal usages and must not + * be used with `CppHeap`. + */ + static constexpr uint16_t kUnknownEmbedderId = UINT16_MAX; + + constexpr WrapperDescriptor(InternalFieldIndex wrappable_type_index, + InternalFieldIndex wrappable_instance_index, + uint16_t embedder_id_for_garbage_collected) + : wrappable_type_index(wrappable_type_index), + wrappable_instance_index(wrappable_instance_index), + embedder_id_for_garbage_collected(embedder_id_for_garbage_collected) {} + + /** + * Index of the wrappable type. + */ + InternalFieldIndex wrappable_type_index; + + /** + * Index of the wrappable instance. + */ + InternalFieldIndex wrappable_instance_index; + + /** + * Embedder id identifying instances of garbage-collected objects. It is + * expected that the first field of the wrappable type is a uint16_t holding + * the id. Only references to instances of wrappables types with an id of + * `embedder_id_for_garbage_collected` will be considered by CppHeap. + */ + uint16_t embedder_id_for_garbage_collected; +}; + +struct V8_EXPORT CppHeapCreateParams { + CppHeapCreateParams(const CppHeapCreateParams&) = delete; + CppHeapCreateParams& operator=(const CppHeapCreateParams&) = delete; + + std::vector> custom_spaces; + WrapperDescriptor wrapper_descriptor; +}; + +/** + * A heap for allocating managed C++ objects. + */ +class V8_EXPORT CppHeap { + public: + static std::unique_ptr Create(v8::Platform* platform, + const CppHeapCreateParams& params); + + virtual ~CppHeap() = default; + + /** + * \returns the opaque handle for allocating objects using + * `MakeGarbageCollected()`. + */ + cppgc::AllocationHandle& GetAllocationHandle(); + + /** + * \returns the opaque heap handle which may be used to refer to this heap in + * other APIs. Valid as long as the underlying `CppHeap` is alive. + */ + cppgc::HeapHandle& GetHeapHandle(); + + /** + * Terminate clears all roots and performs multiple garbage collections to + * reclaim potentially newly created objects in destructors. + * + * After this call, object allocation is prohibited. + */ + void Terminate(); + + /** + * \param detail_level specifies whether should return detailed + * statistics or only brief summary statistics. + * \returns current CppHeap statistics regarding memory consumption + * and utilization. + */ + cppgc::HeapStatistics CollectStatistics( + cppgc::HeapStatistics::DetailLevel detail_level); + + /** + * Collects statistics for the given spaces and reports them to the receiver. + * + * \param custom_spaces a collection of custom space indicies. + * \param receiver an object that gets the results. + */ + void CollectCustomSpaceStatisticsAtLastGC( + std::vector custom_spaces, + std::unique_ptr receiver); + + /** + * Enables a detached mode that allows testing garbage collection using + * `cppgc::testing` APIs. Once used, the heap cannot be attached to an + * `Isolate` anymore. + */ + void EnableDetachedGarbageCollectionsForTesting(); + + /** + * Performs a stop-the-world garbage collection for testing purposes. + * + * \param stack_state The stack state to assume for the garbage collection. + */ + void CollectGarbageForTesting(cppgc::EmbedderStackState stack_state); + + private: + CppHeap() = default; + + friend class internal::CppHeap; +}; + +class JSVisitor : public cppgc::Visitor { + public: + explicit JSVisitor(cppgc::Visitor::Key key) : cppgc::Visitor(key) {} + + void Trace(const TracedReferenceBase& ref) { + if (ref.IsEmptyThreadSafe()) return; + Visit(ref); + } + + protected: + using cppgc::Visitor::Visit; + + virtual void Visit(const TracedReferenceBase& ref) {} +}; + +/** + * **DO NOT USE: Use the appropriate managed types.** + * + * Consistency helpers that aid in maintaining a consistent internal state of + * the garbage collector. + */ +class V8_EXPORT JSHeapConsistency final { + public: + using WriteBarrierParams = cppgc::internal::WriteBarrier::Params; + using WriteBarrierType = cppgc::internal::WriteBarrier::Type; + + /** + * Gets the required write barrier type for a specific write. + * + * Note: Handling for C++ to JS references. + * + * \param ref The reference being written to. + * \param params Parameters that may be used for actual write barrier calls. + * Only filled if return value indicates that a write barrier is needed. The + * contents of the `params` are an implementation detail. + * \param callback Callback returning the corresponding heap handle. The + * callback is only invoked if the heap cannot otherwise be figured out. The + * callback must not allocate. + * \returns whether a write barrier is needed and which barrier to invoke. + */ + template + static V8_INLINE WriteBarrierType + GetWriteBarrierType(const TracedReferenceBase& ref, + WriteBarrierParams& params, HeapHandleCallback callback) { + if (ref.IsEmpty()) return WriteBarrierType::kNone; + + if (V8_LIKELY(!cppgc::internal::WriteBarrier:: + IsAnyIncrementalOrConcurrentMarking())) { + return cppgc::internal::WriteBarrier::Type::kNone; + } + cppgc::HeapHandle& handle = callback(); + if (!cppgc::subtle::HeapState::IsMarking(handle)) { + return cppgc::internal::WriteBarrier::Type::kNone; + } + params.heap = &handle; +#if V8_ENABLE_CHECKS + params.type = cppgc::internal::WriteBarrier::Type::kMarking; +#endif // !V8_ENABLE_CHECKS + return cppgc::internal::WriteBarrier::Type::kMarking; + } + + /** + * Gets the required write barrier type for a specific write. + * + * Note: Handling for JS to C++ references. + * + * \param wrapper The wrapper that has been written into. + * \param wrapper_index The wrapper index in `wrapper` that has been written + * into. + * \param wrappable The value that was written. + * \param params Parameters that may be used for actual write barrier calls. + * Only filled if return value indicates that a write barrier is needed. The + * contents of the `params` are an implementation detail. + * \param callback Callback returning the corresponding heap handle. The + * callback is only invoked if the heap cannot otherwise be figured out. The + * callback must not allocate. + * \returns whether a write barrier is needed and which barrier to invoke. + */ + template + static V8_INLINE WriteBarrierType GetWriteBarrierType( + v8::Local& wrapper, int wrapper_index, const void* wrappable, + WriteBarrierParams& params, HeapHandleCallback callback) { +#if V8_ENABLE_CHECKS + CheckWrapper(wrapper, wrapper_index, wrappable); +#endif // V8_ENABLE_CHECKS + return cppgc::internal::WriteBarrier:: + GetWriteBarrierTypeForExternallyReferencedObject(wrappable, params, + callback); + } + + /** + * Conservative Dijkstra-style write barrier that processes an object if it + * has not yet been processed. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param ref The reference being written to. + */ + static V8_INLINE void DijkstraMarkingBarrier(const WriteBarrierParams& params, + cppgc::HeapHandle& heap_handle, + const TracedReferenceBase& ref) { + cppgc::internal::WriteBarrier::CheckParams(WriteBarrierType::kMarking, + params); + DijkstraMarkingBarrierSlow(heap_handle, ref); + } + + /** + * Conservative Dijkstra-style write barrier that processes an object if it + * has not yet been processed. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param object The pointer to the object. May be an interior pointer to a + * an interface of the actual object. + */ + static V8_INLINE void DijkstraMarkingBarrier(const WriteBarrierParams& params, + cppgc::HeapHandle& heap_handle, + const void* object) { + cppgc::internal::WriteBarrier::DijkstraMarkingBarrier(params, object); + } + + /** + * Generational barrier for maintaining consistency when running with multiple + * generations. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param ref The reference being written to. + */ + static V8_INLINE void GenerationalBarrier(const WriteBarrierParams& params, + const TracedReferenceBase& ref) {} + + private: + JSHeapConsistency() = delete; + + static void CheckWrapper(v8::Local&, int, const void*); + + static void DijkstraMarkingBarrierSlow(cppgc::HeapHandle&, + const TracedReferenceBase& ref); +}; + +/** + * Provided as input to `CppHeap::CollectCustomSpaceStatisticsAtLastGC()`. + * + * Its method is invoked with the results of the statistic collection. + */ +class CustomSpaceStatisticsReceiver { + public: + virtual ~CustomSpaceStatisticsReceiver() = default; + /** + * Reports the size of a space at the last GC. It is called for each space + * that was requested in `CollectCustomSpaceStatisticsAtLastGC()`. + * + * \param space_index The index of the space. + * \param bytes The total size of live objects in the space at the last GC. + * It is zero if there was no GC yet. + */ + virtual void AllocatedBytes(cppgc::CustomSpaceIndex space_index, + size_t bytes) = 0; +}; + +} // namespace v8 + +namespace cppgc { + +template +struct TraceTrait> { + static void Trace(Visitor* visitor, const v8::TracedReference* self) { + static_cast(visitor)->Trace(*self); + } +}; + +} // namespace cppgc + +#endif // INCLUDE_V8_CPPGC_H_ diff --git a/libs/android/libnode/include/node/v8-fast-api-calls.h b/libs/android/libnode/include/node/v8-fast-api-calls.h new file mode 100644 index 00000000..5dc7473e --- /dev/null +++ b/libs/android/libnode/include/node/v8-fast-api-calls.h @@ -0,0 +1,836 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * This file provides additional API on top of the default one for making + * API calls, which come from embedder C++ functions. The functions are being + * called directly from optimized code, doing all the necessary typechecks + * in the compiler itself, instead of on the embedder side. Hence the "fast" + * in the name. Example usage might look like: + * + * \code + * void FastMethod(int param, bool another_param); + * + * v8::FunctionTemplate::New(isolate, SlowCallback, data, + * signature, length, constructor_behavior + * side_effect_type, + * &v8::CFunction::Make(FastMethod)); + * \endcode + * + * By design, fast calls are limited by the following requirements, which + * the embedder should enforce themselves: + * - they should not allocate on the JS heap; + * - they should not trigger JS execution. + * To enforce them, the embedder could use the existing + * v8::Isolate::DisallowJavascriptExecutionScope and a utility similar to + * Blink's NoAllocationScope: + * https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/platform/heap/thread_state_scopes.h;l=16 + * + * Due to these limitations, it's not directly possible to report errors by + * throwing a JS exception or to otherwise do an allocation. There is an + * alternative way of creating fast calls that supports falling back to the + * slow call and then performing the necessary allocation. When one creates + * the fast method by using CFunction::MakeWithFallbackSupport instead of + * CFunction::Make, the fast callback gets as last parameter an output variable, + * through which it can request falling back to the slow call. So one might + * declare their method like: + * + * \code + * void FastMethodWithFallback(int param, FastApiCallbackOptions& options); + * \endcode + * + * If the callback wants to signal an error condition or to perform an + * allocation, it must set options.fallback to true and do an early return from + * the fast method. Then V8 checks the value of options.fallback and if it's + * true, falls back to executing the SlowCallback, which is capable of reporting + * the error (either by throwing a JS exception or logging to the console) or + * doing the allocation. It's the embedder's responsibility to ensure that the + * fast callback is idempotent up to the point where error and fallback + * conditions are checked, because otherwise executing the slow callback might + * produce visible side-effects twice. + * + * An example for custom embedder type support might employ a way to wrap/ + * unwrap various C++ types in JSObject instances, e.g: + * + * \code + * + * // Helper method with a check for field count. + * template + * inline T* GetInternalField(v8::Local wrapper) { + * assert(offset < wrapper->InternalFieldCount()); + * return reinterpret_cast( + * wrapper->GetAlignedPointerFromInternalField(offset)); + * } + * + * class CustomEmbedderType { + * public: + * // Returns the raw C object from a wrapper JS object. + * static CustomEmbedderType* Unwrap(v8::Local wrapper) { + * return GetInternalField(wrapper); + * } + * static void FastMethod(v8::Local receiver_obj, int param) { + * CustomEmbedderType* receiver = static_cast( + * receiver_obj->GetAlignedPointerFromInternalField( + * kV8EmbedderWrapperObjectIndex)); + * + * // Type checks are already done by the optimized code. + * // Then call some performance-critical method like: + * // receiver->Method(param); + * } + * + * static void SlowMethod( + * const v8::FunctionCallbackInfo& info) { + * v8::Local instance = + * v8::Local::Cast(info.Holder()); + * CustomEmbedderType* receiver = Unwrap(instance); + * // TODO: Do type checks and extract {param}. + * receiver->Method(param); + * } + * }; + * + * // TODO(mslekova): Clean-up these constants + * // The constants kV8EmbedderWrapperTypeIndex and + * // kV8EmbedderWrapperObjectIndex describe the offsets for the type info + * // struct and the native object, when expressed as internal field indices + * // within a JSObject. The existance of this helper function assumes that + * // all embedder objects have their JSObject-side type info at the same + * // offset, but this is not a limitation of the API itself. For a detailed + * // use case, see the third example. + * static constexpr int kV8EmbedderWrapperTypeIndex = 0; + * static constexpr int kV8EmbedderWrapperObjectIndex = 1; + * + * // The following setup function can be templatized based on + * // the {embedder_object} argument. + * void SetupCustomEmbedderObject(v8::Isolate* isolate, + * v8::Local context, + * CustomEmbedderType* embedder_object) { + * isolate->set_embedder_wrapper_type_index( + * kV8EmbedderWrapperTypeIndex); + * isolate->set_embedder_wrapper_object_index( + * kV8EmbedderWrapperObjectIndex); + * + * v8::CFunction c_func = + * MakeV8CFunction(CustomEmbedderType::FastMethod); + * + * Local method_template = + * v8::FunctionTemplate::New( + * isolate, CustomEmbedderType::SlowMethod, v8::Local(), + * v8::Local(), 1, v8::ConstructorBehavior::kAllow, + * v8::SideEffectType::kHasSideEffect, &c_func); + * + * v8::Local object_template = + * v8::ObjectTemplate::New(isolate); + * object_template->SetInternalFieldCount( + * kV8EmbedderWrapperObjectIndex + 1); + * object_template->Set(isolate, "method", method_template); + * + * // Instantiate the wrapper JS object. + * v8::Local object = + * object_template->NewInstance(context).ToLocalChecked(); + * object->SetAlignedPointerInInternalField( + * kV8EmbedderWrapperObjectIndex, + * reinterpret_cast(embedder_object)); + * + * // TODO: Expose {object} where it's necessary. + * } + * \endcode + * + * For instance if {object} is exposed via a global "obj" variable, + * one could write in JS: + * function hot_func() { + * obj.method(42); + * } + * and once {hot_func} gets optimized, CustomEmbedderType::FastMethod + * will be called instead of the slow version, with the following arguments: + * receiver := the {embedder_object} from above + * param := 42 + * + * Currently supported return types: + * - void + * - bool + * - int32_t + * - uint32_t + * - float32_t + * - float64_t + * Currently supported argument types: + * - pointer to an embedder type + * - JavaScript array of primitive types + * - bool + * - int32_t + * - uint32_t + * - int64_t + * - uint64_t + * - float32_t + * - float64_t + * + * The 64-bit integer types currently have the IDL (unsigned) long long + * semantics: https://heycam.github.io/webidl/#abstract-opdef-converttoint + * In the future we'll extend the API to also provide conversions from/to + * BigInt to preserve full precision. + * The floating point types currently have the IDL (unrestricted) semantics, + * which is the only one used by WebGL. We plan to add support also for + * restricted floats/doubles, similarly to the BigInt conversion policies. + * We also differ from the specific NaN bit pattern that WebIDL prescribes + * (https://heycam.github.io/webidl/#es-unrestricted-float) in that Blink + * passes NaN values as-is, i.e. doesn't normalize them. + * + * To be supported types: + * - TypedArrays and ArrayBuffers + * - arrays of embedder types + * + * + * The API offers a limited support for function overloads: + * + * \code + * void FastMethod_2Args(int param, bool another_param); + * void FastMethod_3Args(int param, bool another_param, int third_param); + * + * v8::CFunction fast_method_2args_c_func = + * MakeV8CFunction(FastMethod_2Args); + * v8::CFunction fast_method_3args_c_func = + * MakeV8CFunction(FastMethod_3Args); + * const v8::CFunction fast_method_overloads[] = {fast_method_2args_c_func, + * fast_method_3args_c_func}; + * Local method_template = + * v8::FunctionTemplate::NewWithCFunctionOverloads( + * isolate, SlowCallback, data, signature, length, + * constructor_behavior, side_effect_type, + * {fast_method_overloads, 2}); + * \endcode + * + * In this example a single FunctionTemplate is associated to multiple C++ + * functions. The overload resolution is currently only based on the number of + * arguments passed in a call. For example, if this method_template is + * registered with a wrapper JS object as described above, a call with two + * arguments: + * obj.method(42, true); + * will result in a fast call to FastMethod_2Args, while a call with three or + * more arguments: + * obj.method(42, true, 11); + * will result in a fast call to FastMethod_3Args. Instead a call with less than + * two arguments, like: + * obj.method(42); + * would not result in a fast call but would fall back to executing the + * associated SlowCallback. + */ + +#ifndef INCLUDE_V8_FAST_API_CALLS_H_ +#define INCLUDE_V8_FAST_API_CALLS_H_ + +#include +#include + +#include +#include + +#include "v8-internal.h" // NOLINT(build/include_directory) +#include "v8.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) + +namespace v8 { + +class Isolate; + +class CTypeInfo { + public: + enum class Type : uint8_t { + kVoid, + kBool, + kInt32, + kUint32, + kInt64, + kUint64, + kFloat32, + kFloat64, + kV8Value, + kApiObject, // This will be deprecated once all users have + // migrated from v8::ApiObject to v8::Local. + }; + + // kCallbackOptionsType is not part of the Type enum + // because it is only used internally. Use value 255 that is larger + // than any valid Type enum. + static constexpr Type kCallbackOptionsType = Type(255); + + enum class SequenceType : uint8_t { + kScalar, + kIsSequence, // sequence + kIsTypedArray, // TypedArray of T or any ArrayBufferView if T + // is void + kIsArrayBuffer // ArrayBuffer + }; + + enum class Flags : uint8_t { + kNone = 0, + kAllowSharedBit = 1 << 0, // Must be an ArrayBuffer or TypedArray + kEnforceRangeBit = 1 << 1, // T must be integral + kClampBit = 1 << 2, // T must be integral + kIsRestrictedBit = 1 << 3, // T must be float or double + }; + + explicit constexpr CTypeInfo( + Type type, SequenceType sequence_type = SequenceType::kScalar, + Flags flags = Flags::kNone) + : type_(type), sequence_type_(sequence_type), flags_(flags) {} + + constexpr Type GetType() const { return type_; } + constexpr SequenceType GetSequenceType() const { return sequence_type_; } + constexpr Flags GetFlags() const { return flags_; } + + static constexpr bool IsIntegralType(Type type) { + return type == Type::kInt32 || type == Type::kUint32 || + type == Type::kInt64 || type == Type::kUint64; + } + + static constexpr bool IsFloatingPointType(Type type) { + return type == Type::kFloat32 || type == Type::kFloat64; + } + + static constexpr bool IsPrimitive(Type type) { + return IsIntegralType(type) || IsFloatingPointType(type) || + type == Type::kBool; + } + + private: + Type type_; + SequenceType sequence_type_; + Flags flags_; +}; + +struct FastApiTypedArrayBase { + public: + // Returns the length in number of elements. + size_t V8_EXPORT length() const { return length_; } + // Checks whether the given index is within the bounds of the collection. + void V8_EXPORT ValidateIndex(size_t index) const; + + protected: + size_t length_ = 0; +}; + +template +struct FastApiTypedArray : public FastApiTypedArrayBase { + public: + V8_INLINE T get(size_t index) const { +#ifdef DEBUG + ValidateIndex(index); +#endif // DEBUG + T tmp; + memcpy(&tmp, reinterpret_cast(data_) + index, sizeof(T)); + return tmp; + } + + private: + // This pointer should include the typed array offset applied. + // It's not guaranteed that it's aligned to sizeof(T), it's only + // guaranteed that it's 4-byte aligned, so for 8-byte types we need to + // provide a special implementation for reading from it, which hides + // the possibly unaligned read in the `get` method. + void* data_; +}; + +// Any TypedArray. It uses kTypedArrayBit with base type void +// Overloaded args of ArrayBufferView and TypedArray are not supported +// (for now) because the generic “any” ArrayBufferView doesn’t have its +// own instance type. It could be supported if we specify that +// TypedArray always has precedence over the generic ArrayBufferView, +// but this complicates overload resolution. +struct FastApiArrayBufferView { + void* data; + size_t byte_length; +}; + +struct FastApiArrayBuffer { + void* data; + size_t byte_length; +}; + +class V8_EXPORT CFunctionInfo { + public: + // Construct a struct to hold a CFunction's type information. + // |return_info| describes the function's return type. + // |arg_info| is an array of |arg_count| CTypeInfos describing the + // arguments. Only the last argument may be of the special type + // CTypeInfo::kCallbackOptionsType. + CFunctionInfo(const CTypeInfo& return_info, unsigned int arg_count, + const CTypeInfo* arg_info); + + const CTypeInfo& ReturnInfo() const { return return_info_; } + + // The argument count, not including the v8::FastApiCallbackOptions + // if present. + unsigned int ArgumentCount() const { + return HasOptions() ? arg_count_ - 1 : arg_count_; + } + + // |index| must be less than ArgumentCount(). + // Note: if the last argument passed on construction of CFunctionInfo + // has type CTypeInfo::kCallbackOptionsType, it is not included in + // ArgumentCount(). + const CTypeInfo& ArgumentInfo(unsigned int index) const; + + bool HasOptions() const { + // The options arg is always the last one. + return arg_count_ > 0 && arg_info_[arg_count_ - 1].GetType() == + CTypeInfo::kCallbackOptionsType; + } + + private: + const CTypeInfo return_info_; + const unsigned int arg_count_; + const CTypeInfo* arg_info_; +}; + +class V8_EXPORT CFunction { + public: + constexpr CFunction() : address_(nullptr), type_info_(nullptr) {} + + const CTypeInfo& ReturnInfo() const { return type_info_->ReturnInfo(); } + + const CTypeInfo& ArgumentInfo(unsigned int index) const { + return type_info_->ArgumentInfo(index); + } + + unsigned int ArgumentCount() const { return type_info_->ArgumentCount(); } + + const void* GetAddress() const { return address_; } + const CFunctionInfo* GetTypeInfo() const { return type_info_; } + + enum class OverloadResolution { kImpossible, kAtRuntime, kAtCompileTime }; + + // Returns whether an overload between this and the given CFunction can + // be resolved at runtime by the RTTI available for the arguments or at + // compile time for functions with different number of arguments. + OverloadResolution GetOverloadResolution(const CFunction* other) { + // Runtime overload resolution can only deal with functions with the + // same number of arguments. Functions with different arity are handled + // by compile time overload resolution though. + if (ArgumentCount() != other->ArgumentCount()) { + return OverloadResolution::kAtCompileTime; + } + + // The functions can only differ by a single argument position. + int diff_index = -1; + for (unsigned int i = 0; i < ArgumentCount(); ++i) { + if (ArgumentInfo(i).GetSequenceType() != + other->ArgumentInfo(i).GetSequenceType()) { + if (diff_index >= 0) { + return OverloadResolution::kImpossible; + } + diff_index = i; + + // We only support overload resolution between sequence types. + if (ArgumentInfo(i).GetSequenceType() == + CTypeInfo::SequenceType::kScalar || + other->ArgumentInfo(i).GetSequenceType() == + CTypeInfo::SequenceType::kScalar) { + return OverloadResolution::kImpossible; + } + } + } + + return OverloadResolution::kAtRuntime; + } + + template + static CFunction Make(F* func) { + return ArgUnwrap::Make(func); + } + + template + V8_DEPRECATED("Use CFunctionBuilder instead.") + static CFunction MakeWithFallbackSupport(F* func) { + return ArgUnwrap::Make(func); + } + + CFunction(const void* address, const CFunctionInfo* type_info); + + private: + const void* address_; + const CFunctionInfo* type_info_; + + template + class ArgUnwrap { + static_assert(sizeof(F) != sizeof(F), + "CFunction must be created from a function pointer."); + }; + + template + class ArgUnwrap { + public: + static CFunction Make(R (*func)(Args...)); + }; +}; + +struct ApiObject { + uintptr_t address; +}; + +/** + * A struct which may be passed to a fast call callback, like so: + * \code + * void FastMethodWithOptions(int param, FastApiCallbackOptions& options); + * \endcode + */ +struct FastApiCallbackOptions { + /** + * Creates a new instance of FastApiCallbackOptions for testing purpose. The + * returned instance may be filled with mock data. + */ + static FastApiCallbackOptions CreateForTesting(Isolate* isolate) { + return {false, {0}}; + } + + /** + * If the callback wants to signal an error condition or to perform an + * allocation, it must set options.fallback to true and do an early return + * from the fast method. Then V8 checks the value of options.fallback and if + * it's true, falls back to executing the SlowCallback, which is capable of + * reporting the error (either by throwing a JS exception or logging to the + * console) or doing the allocation. It's the embedder's responsibility to + * ensure that the fast callback is idempotent up to the point where error and + * fallback conditions are checked, because otherwise executing the slow + * callback might produce visible side-effects twice. + */ + bool fallback; + + /** + * The `data` passed to the FunctionTemplate constructor, or `undefined`. + * `data_ptr` allows for default constructing FastApiCallbackOptions. + */ + union { + uintptr_t data_ptr; + v8::Value data; + }; +}; + +namespace internal { + +// Helper to count the number of occurances of `T` in `List` +template +struct count : std::integral_constant {}; +template +struct count + : std::integral_constant::value> {}; +template +struct count : count {}; + +template +class CFunctionInfoImpl : public CFunctionInfo { + static constexpr int kOptionsArgCount = + count(); + static constexpr int kReceiverCount = 1; + + static_assert(kOptionsArgCount == 0 || kOptionsArgCount == 1, + "Only one options parameter is supported."); + + static_assert(sizeof...(ArgBuilders) >= kOptionsArgCount + kReceiverCount, + "The receiver or the options argument is missing."); + + public: + constexpr CFunctionInfoImpl() + : CFunctionInfo(RetBuilder::Build(), sizeof...(ArgBuilders), + arg_info_storage_), + arg_info_storage_{ArgBuilders::Build()...} { + constexpr CTypeInfo::Type kReturnType = RetBuilder::Build().GetType(); + static_assert(kReturnType == CTypeInfo::Type::kVoid || + kReturnType == CTypeInfo::Type::kBool || + kReturnType == CTypeInfo::Type::kInt32 || + kReturnType == CTypeInfo::Type::kUint32 || + kReturnType == CTypeInfo::Type::kFloat32 || + kReturnType == CTypeInfo::Type::kFloat64, + "64-bit int and api object values are not currently " + "supported return types."); + } + + private: + const CTypeInfo arg_info_storage_[sizeof...(ArgBuilders)]; +}; + +template +struct TypeInfoHelper { + static_assert(sizeof(T) != sizeof(T), "This type is not supported"); +}; + +#define SPECIALIZE_GET_TYPE_INFO_HELPER_FOR(T, Enum) \ + template <> \ + struct TypeInfoHelper { \ + static constexpr CTypeInfo::Flags Flags() { \ + return CTypeInfo::Flags::kNone; \ + } \ + \ + static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::Enum; } \ + static constexpr CTypeInfo::SequenceType SequenceType() { \ + return CTypeInfo::SequenceType::kScalar; \ + } \ + }; + +template +struct CTypeInfoTraits {}; + +#define DEFINE_TYPE_INFO_TRAITS(CType, Enum) \ + template <> \ + struct CTypeInfoTraits { \ + using ctype = CType; \ + }; + +#define PRIMITIVE_C_TYPES(V) \ + V(bool, kBool) \ + V(int32_t, kInt32) \ + V(uint32_t, kUint32) \ + V(int64_t, kInt64) \ + V(uint64_t, kUint64) \ + V(float, kFloat32) \ + V(double, kFloat64) + +// Same as above, but includes deprecated types for compatibility. +#define ALL_C_TYPES(V) \ + PRIMITIVE_C_TYPES(V) \ + V(void, kVoid) \ + V(v8::Local, kV8Value) \ + V(v8::Local, kV8Value) \ + V(ApiObject, kApiObject) + +// ApiObject was a temporary solution to wrap the pointer to the v8::Value. +// Please use v8::Local in new code for the arguments and +// v8::Local for the receiver, as ApiObject will be deprecated. + +ALL_C_TYPES(SPECIALIZE_GET_TYPE_INFO_HELPER_FOR) +PRIMITIVE_C_TYPES(DEFINE_TYPE_INFO_TRAITS) + +#undef PRIMITIVE_C_TYPES +#undef ALL_C_TYPES + +#define SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA(T, Enum) \ + template <> \ + struct TypeInfoHelper&> { \ + static constexpr CTypeInfo::Flags Flags() { \ + return CTypeInfo::Flags::kNone; \ + } \ + \ + static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::Enum; } \ + static constexpr CTypeInfo::SequenceType SequenceType() { \ + return CTypeInfo::SequenceType::kIsTypedArray; \ + } \ + }; + +#define TYPED_ARRAY_C_TYPES(V) \ + V(int32_t, kInt32) \ + V(uint32_t, kUint32) \ + V(int64_t, kInt64) \ + V(uint64_t, kUint64) \ + V(float, kFloat32) \ + V(double, kFloat64) + +TYPED_ARRAY_C_TYPES(SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA) + +#undef TYPED_ARRAY_C_TYPES + +template <> +struct TypeInfoHelper> { + static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; } + + static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::kVoid; } + static constexpr CTypeInfo::SequenceType SequenceType() { + return CTypeInfo::SequenceType::kIsSequence; + } +}; + +template <> +struct TypeInfoHelper> { + static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; } + + static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::kUint32; } + static constexpr CTypeInfo::SequenceType SequenceType() { + return CTypeInfo::SequenceType::kIsTypedArray; + } +}; + +template <> +struct TypeInfoHelper { + static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; } + + static constexpr CTypeInfo::Type Type() { + return CTypeInfo::kCallbackOptionsType; + } + static constexpr CTypeInfo::SequenceType SequenceType() { + return CTypeInfo::SequenceType::kScalar; + } +}; + +#define STATIC_ASSERT_IMPLIES(COND, ASSERTION, MSG) \ + static_assert(((COND) == 0) || (ASSERTION), MSG) + +template +class CTypeInfoBuilder { + public: + using BaseType = T; + + static constexpr CTypeInfo Build() { + constexpr CTypeInfo::Flags kFlags = + MergeFlags(TypeInfoHelper::Flags(), Flags...); + constexpr CTypeInfo::Type kType = TypeInfoHelper::Type(); + constexpr CTypeInfo::SequenceType kSequenceType = + TypeInfoHelper::SequenceType(); + + STATIC_ASSERT_IMPLIES( + uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kAllowSharedBit), + (kSequenceType == CTypeInfo::SequenceType::kIsTypedArray || + kSequenceType == CTypeInfo::SequenceType::kIsArrayBuffer), + "kAllowSharedBit is only allowed for TypedArrays and ArrayBuffers."); + STATIC_ASSERT_IMPLIES( + uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kEnforceRangeBit), + CTypeInfo::IsIntegralType(kType), + "kEnforceRangeBit is only allowed for integral types."); + STATIC_ASSERT_IMPLIES( + uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kClampBit), + CTypeInfo::IsIntegralType(kType), + "kClampBit is only allowed for integral types."); + STATIC_ASSERT_IMPLIES( + uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kIsRestrictedBit), + CTypeInfo::IsFloatingPointType(kType), + "kIsRestrictedBit is only allowed for floating point types."); + STATIC_ASSERT_IMPLIES(kSequenceType == CTypeInfo::SequenceType::kIsSequence, + kType == CTypeInfo::Type::kVoid, + "Sequences are only supported from void type."); + STATIC_ASSERT_IMPLIES( + kSequenceType == CTypeInfo::SequenceType::kIsTypedArray, + CTypeInfo::IsPrimitive(kType) || kType == CTypeInfo::Type::kVoid, + "TypedArrays are only supported from primitive types or void."); + + // Return the same type with the merged flags. + return CTypeInfo(TypeInfoHelper::Type(), + TypeInfoHelper::SequenceType(), kFlags); + } + + private: + template + static constexpr CTypeInfo::Flags MergeFlags(CTypeInfo::Flags flags, + Rest... rest) { + return CTypeInfo::Flags(uint8_t(flags) | uint8_t(MergeFlags(rest...))); + } + static constexpr CTypeInfo::Flags MergeFlags() { return CTypeInfo::Flags(0); } +}; + +template +class CFunctionBuilderWithFunction { + public: + explicit constexpr CFunctionBuilderWithFunction(const void* fn) : fn_(fn) {} + + template + constexpr auto Ret() { + return CFunctionBuilderWithFunction< + CTypeInfoBuilder, + ArgBuilders...>(fn_); + } + + template + constexpr auto Arg() { + // Return a copy of the builder with the Nth arg builder merged with + // template parameter pack Flags. + return ArgImpl( + std::make_index_sequence()); + } + + auto Build() { + static CFunctionInfoImpl instance; + return CFunction(fn_, &instance); + } + + private: + template + struct GetArgBuilder; + + // Returns the same ArgBuilder as the one at index N, including its flags. + // Flags in the template parameter pack are ignored. + template + struct GetArgBuilder { + using type = + typename std::tuple_element>::type; + }; + + // Returns an ArgBuilder with the same base type as the one at index N, + // but merges the flags with the flags in the template parameter pack. + template + struct GetArgBuilder { + using type = CTypeInfoBuilder< + typename std::tuple_element>::type::BaseType, + std::tuple_element>::type::Build() + .GetFlags(), + Flags...>; + }; + + // Return a copy of the CFunctionBuilder, but merges the Flags on + // ArgBuilder index N with the new Flags passed in the template parameter + // pack. + template + constexpr auto ArgImpl(std::index_sequence) { + return CFunctionBuilderWithFunction< + RetBuilder, typename GetArgBuilder::type...>(fn_); + } + + const void* fn_; +}; + +class CFunctionBuilder { + public: + constexpr CFunctionBuilder() {} + + template + constexpr auto Fn(R (*fn)(Args...)) { + return CFunctionBuilderWithFunction, + CTypeInfoBuilder...>( + reinterpret_cast(fn)); + } +}; + +} // namespace internal + +// static +template +CFunction CFunction::ArgUnwrap::Make(R (*func)(Args...)) { + return internal::CFunctionBuilder().Fn(func).Build(); +} + +using CFunctionBuilder = internal::CFunctionBuilder; + +static constexpr CTypeInfo kTypeInfoInt32 = CTypeInfo(CTypeInfo::Type::kInt32); +static constexpr CTypeInfo kTypeInfoFloat64 = + CTypeInfo(CTypeInfo::Type::kFloat64); + +/** + * Copies the contents of this JavaScript array to a C++ buffer with + * a given max_length. A CTypeInfo is passed as an argument, + * instructing different rules for conversion (e.g. restricted float/double). + * The element type T of the destination array must match the C type + * corresponding to the CTypeInfo (specified by CTypeInfoTraits). + * If the array length is larger than max_length or the array is of + * unsupported type, the operation will fail, returning false. Generally, an + * array which contains objects, undefined, null or anything not convertible + * to the requested destination type, is considered unsupported. The operation + * returns true on success. `type_info` will be used for conversions. + */ +template +bool V8_EXPORT V8_WARN_UNUSED_RESULT TryCopyAndConvertArrayToCppBuffer( + Local src, T* dst, uint32_t max_length); + +template <> +inline bool V8_WARN_UNUSED_RESULT +TryCopyAndConvertArrayToCppBuffer<&kTypeInfoInt32, int32_t>( + Local src, int32_t* dst, uint32_t max_length) { + return CopyAndConvertArrayToCppBufferInt32(src, dst, max_length); +} + +template <> +inline bool V8_WARN_UNUSED_RESULT +TryCopyAndConvertArrayToCppBuffer<&kTypeInfoFloat64, double>( + Local src, double* dst, uint32_t max_length) { + return CopyAndConvertArrayToCppBufferFloat64(src, dst, max_length); +} + +} // namespace v8 + +#endif // INCLUDE_V8_FAST_API_CALLS_H_ diff --git a/libs/android/libnode/include/node/v8-inspector-protocol.h b/libs/android/libnode/include/node/v8-inspector-protocol.h new file mode 100644 index 00000000..a5ffb7d6 --- /dev/null +++ b/libs/android/libnode/include/node/v8-inspector-protocol.h @@ -0,0 +1,13 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_V8_INSPECTOR_PROTOCOL_H_ +#define V8_V8_INSPECTOR_PROTOCOL_H_ + +#include "inspector/Debugger.h" // NOLINT(build/include_directory) +#include "inspector/Runtime.h" // NOLINT(build/include_directory) +#include "inspector/Schema.h" // NOLINT(build/include_directory) +#include "v8-inspector.h" // NOLINT(build/include_directory) + +#endif // V8_V8_INSPECTOR_PROTOCOL_H_ diff --git a/libs/android/libnode/include/node/v8-inspector.h b/libs/android/libnode/include/node/v8-inspector.h new file mode 100644 index 00000000..e6621ccd --- /dev/null +++ b/libs/android/libnode/include/node/v8-inspector.h @@ -0,0 +1,345 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_V8_INSPECTOR_H_ +#define V8_V8_INSPECTOR_H_ + +#include +#include + +#include +#include + +#include "v8.h" // NOLINT(build/include_directory) + +namespace v8_inspector { + +namespace protocol { +namespace Debugger { +namespace API { +class SearchMatch; +} +} +namespace Runtime { +namespace API { +class RemoteObject; +class StackTrace; +class StackTraceId; +} +} +namespace Schema { +namespace API { +class Domain; +} +} +} // namespace protocol + +class V8_EXPORT StringView { + public: + StringView() : m_is8Bit(true), m_length(0), m_characters8(nullptr) {} + + StringView(const uint8_t* characters, size_t length) + : m_is8Bit(true), m_length(length), m_characters8(characters) {} + + StringView(const uint16_t* characters, size_t length) + : m_is8Bit(false), m_length(length), m_characters16(characters) {} + + bool is8Bit() const { return m_is8Bit; } + size_t length() const { return m_length; } + + // TODO(dgozman): add DCHECK(m_is8Bit) to accessors once platform can be used + // here. + const uint8_t* characters8() const { return m_characters8; } + const uint16_t* characters16() const { return m_characters16; } + + private: + bool m_is8Bit; + size_t m_length; + union { + const uint8_t* m_characters8; + const uint16_t* m_characters16; + }; +}; + +class V8_EXPORT StringBuffer { + public: + virtual ~StringBuffer() = default; + virtual StringView string() const = 0; + // This method copies contents. + static std::unique_ptr create(StringView); +}; + +class V8_EXPORT V8ContextInfo { + public: + V8ContextInfo(v8::Local context, int contextGroupId, + StringView humanReadableName) + : context(context), + contextGroupId(contextGroupId), + humanReadableName(humanReadableName), + hasMemoryOnConsole(false) {} + + v8::Local context; + // Each v8::Context is a part of a group. The group id must be non-zero. + int contextGroupId; + StringView humanReadableName; + StringView origin; + StringView auxData; + bool hasMemoryOnConsole; + + static int executionContextId(v8::Local context); + + // Disallow copying and allocating this one. + enum NotNullTagEnum { NotNullLiteral }; + void* operator new(size_t) = delete; + void* operator new(size_t, NotNullTagEnum, void*) = delete; + void* operator new(size_t, void*) = delete; + V8ContextInfo(const V8ContextInfo&) = delete; + V8ContextInfo& operator=(const V8ContextInfo&) = delete; +}; + +class V8_EXPORT V8StackTrace { + public: + virtual StringView firstNonEmptySourceURL() const = 0; + virtual bool isEmpty() const = 0; + virtual StringView topSourceURL() const = 0; + virtual int topLineNumber() const = 0; + virtual int topColumnNumber() const = 0; + virtual int topScriptId() const = 0; + V8_DEPRECATE_SOON("Use V8::StackTrace::topScriptId() instead.") + int topScriptIdAsInteger() const { return topScriptId(); } + virtual StringView topFunctionName() const = 0; + + virtual ~V8StackTrace() = default; + virtual std::unique_ptr + buildInspectorObject() const = 0; + virtual std::unique_ptr + buildInspectorObject(int maxAsyncDepth) const = 0; + virtual std::unique_ptr toString() const = 0; + + // Safe to pass between threads, drops async chain. + virtual std::unique_ptr clone() = 0; +}; + +class V8_EXPORT V8InspectorSession { + public: + virtual ~V8InspectorSession() = default; + + // Cross-context inspectable values (DOM nodes in different worlds, etc.). + class V8_EXPORT Inspectable { + public: + virtual v8::Local get(v8::Local) = 0; + virtual ~Inspectable() = default; + }; + class V8_EXPORT CommandLineAPIScope { + public: + virtual ~CommandLineAPIScope() = default; + }; + virtual void addInspectedObject(std::unique_ptr) = 0; + + // Dispatching protocol messages. + static bool canDispatchMethod(StringView method); + virtual void dispatchProtocolMessage(StringView message) = 0; + virtual std::vector state() = 0; + virtual std::vector> + supportedDomains() = 0; + + virtual std::unique_ptr + initializeCommandLineAPIScope(int executionContextId) = 0; + + // Debugger actions. + virtual void schedulePauseOnNextStatement(StringView breakReason, + StringView breakDetails) = 0; + virtual void cancelPauseOnNextStatement() = 0; + virtual void breakProgram(StringView breakReason, + StringView breakDetails) = 0; + virtual void setSkipAllPauses(bool) = 0; + virtual void resume(bool setTerminateOnResume = false) = 0; + virtual void stepOver() = 0; + virtual std::vector> + searchInTextByLines(StringView text, StringView query, bool caseSensitive, + bool isRegex) = 0; + + // Remote objects. + virtual std::unique_ptr wrapObject( + v8::Local, v8::Local, StringView groupName, + bool generatePreview) = 0; + + virtual bool unwrapObject(std::unique_ptr* error, + StringView objectId, v8::Local*, + v8::Local*, + std::unique_ptr* objectGroup) = 0; + virtual void releaseObjectGroup(StringView) = 0; + virtual void triggerPreciseCoverageDeltaUpdate(StringView occasion) = 0; +}; + +class V8_EXPORT V8InspectorClient { + public: + virtual ~V8InspectorClient() = default; + + virtual void runMessageLoopOnPause(int contextGroupId) {} + virtual void quitMessageLoopOnPause() {} + virtual void runIfWaitingForDebugger(int contextGroupId) {} + + virtual void muteMetrics(int contextGroupId) {} + virtual void unmuteMetrics(int contextGroupId) {} + + virtual void beginUserGesture() {} + virtual void endUserGesture() {} + + virtual std::unique_ptr valueSubtype(v8::Local) { + return nullptr; + } + virtual std::unique_ptr descriptionForValueSubtype( + v8::Local, v8::Local) { + return nullptr; + } + virtual bool isInspectableHeapObject(v8::Local) { return true; } + + virtual v8::Local ensureDefaultContextInGroup( + int contextGroupId) { + return v8::Local(); + } + virtual void beginEnsureAllContextsInGroup(int contextGroupId) {} + virtual void endEnsureAllContextsInGroup(int contextGroupId) {} + + virtual void installAdditionalCommandLineAPI(v8::Local, + v8::Local) {} + virtual void consoleAPIMessage(int contextGroupId, + v8::Isolate::MessageErrorLevel level, + const StringView& message, + const StringView& url, unsigned lineNumber, + unsigned columnNumber, V8StackTrace*) {} + virtual v8::MaybeLocal memoryInfo(v8::Isolate*, + v8::Local) { + return v8::MaybeLocal(); + } + + virtual void consoleTime(const StringView& title) {} + virtual void consoleTimeEnd(const StringView& title) {} + virtual void consoleTimeStamp(const StringView& title) {} + virtual void consoleClear(int contextGroupId) {} + virtual double currentTimeMS() { return 0; } + typedef void (*TimerCallback)(void*); + virtual void startRepeatingTimer(double, TimerCallback, void* data) {} + virtual void cancelTimer(void* data) {} + + // TODO(dgozman): this was added to support service worker shadow page. We + // should not connect at all. + virtual bool canExecuteScripts(int contextGroupId) { return true; } + + virtual void maxAsyncCallStackDepthChanged(int depth) {} + + virtual std::unique_ptr resourceNameToUrl( + const StringView& resourceName) { + return nullptr; + } + + // The caller would defer to generating a random 64 bit integer if + // this method returns 0. + virtual int64_t generateUniqueId() { return 0; } +}; + +// These stack trace ids are intended to be passed between debuggers and be +// resolved later. This allows to track cross-debugger calls and step between +// them if a single client connects to multiple debuggers. +struct V8_EXPORT V8StackTraceId { + uintptr_t id; + std::pair debugger_id; + bool should_pause = false; + + V8StackTraceId(); + V8StackTraceId(const V8StackTraceId&) = default; + V8StackTraceId(uintptr_t id, const std::pair debugger_id); + V8StackTraceId(uintptr_t id, const std::pair debugger_id, + bool should_pause); + explicit V8StackTraceId(StringView); + V8StackTraceId& operator=(const V8StackTraceId&) = default; + V8StackTraceId& operator=(V8StackTraceId&&) noexcept = default; + ~V8StackTraceId() = default; + + bool IsInvalid() const; + std::unique_ptr ToString(); +}; + +class V8_EXPORT V8Inspector { + public: + static std::unique_ptr create(v8::Isolate*, V8InspectorClient*); + virtual ~V8Inspector() = default; + + // Contexts instrumentation. + virtual void contextCreated(const V8ContextInfo&) = 0; + virtual void contextDestroyed(v8::Local) = 0; + virtual void resetContextGroup(int contextGroupId) = 0; + virtual v8::MaybeLocal contextById(int contextId) = 0; + + // Various instrumentation. + virtual void idleStarted() = 0; + virtual void idleFinished() = 0; + + // Async stack traces instrumentation. + virtual void asyncTaskScheduled(StringView taskName, void* task, + bool recurring) = 0; + virtual void asyncTaskCanceled(void* task) = 0; + virtual void asyncTaskStarted(void* task) = 0; + virtual void asyncTaskFinished(void* task) = 0; + virtual void allAsyncTasksCanceled() = 0; + + virtual V8StackTraceId storeCurrentStackTrace(StringView description) = 0; + virtual void externalAsyncTaskStarted(const V8StackTraceId& parent) = 0; + virtual void externalAsyncTaskFinished(const V8StackTraceId& parent) = 0; + + // Exceptions instrumentation. + virtual unsigned exceptionThrown(v8::Local, StringView message, + v8::Local exception, + StringView detailedMessage, StringView url, + unsigned lineNumber, unsigned columnNumber, + std::unique_ptr, + int scriptId) = 0; + virtual void exceptionRevoked(v8::Local, unsigned exceptionId, + StringView message) = 0; + virtual bool associateExceptionData(v8::Local, + v8::Local exception, + v8::Local key, + v8::Local value) = 0; + + // Connection. + class V8_EXPORT Channel { + public: + virtual ~Channel() = default; + virtual void sendResponse(int callId, + std::unique_ptr message) = 0; + virtual void sendNotification(std::unique_ptr message) = 0; + virtual void flushProtocolNotifications() = 0; + }; + virtual std::unique_ptr connect(int contextGroupId, + Channel*, + StringView state) = 0; + + // API methods. + virtual std::unique_ptr createStackTrace( + v8::Local) = 0; + virtual std::unique_ptr captureStackTrace(bool fullStack) = 0; + + // Performance counters. + class V8_EXPORT Counters : public std::enable_shared_from_this { + public: + explicit Counters(v8::Isolate* isolate); + ~Counters(); + const std::unordered_map& getCountersMap() const { + return m_countersMap; + } + + private: + static int* getCounterPtr(const char* name); + + v8::Isolate* m_isolate; + std::unordered_map m_countersMap; + }; + + virtual std::shared_ptr enableCounters() = 0; +}; + +} // namespace v8_inspector + +#endif // V8_V8_INSPECTOR_H_ diff --git a/libs/android/libnode/include/node/v8-internal.h b/libs/android/libnode/include/node/v8-internal.h index 8ce88fb3..0b95c2ca 100644 --- a/libs/android/libnode/include/node/v8-internal.h +++ b/libs/android/libnode/include/node/v8-internal.h @@ -10,14 +10,17 @@ #include #include -#include "v8-version.h" // NOLINT(build/include) -#include "v8config.h" // NOLINT(build/include) +#include "v8-version.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { +class Array; class Context; class Data; class Isolate; +template +class Local; namespace internal { @@ -40,6 +43,13 @@ const int kWeakHeapObjectTag = 3; const int kHeapObjectTagSize = 2; const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1; +// Tag information for fowarding pointers stored in object headers. +// 0b00 at the lowest 2 bits in the header indicates that the map word is a +// forwarding pointer. +const int kForwardingTag = 0; +const int kForwardingTagSize = 2; +const intptr_t kForwardingTagMask = (1 << kForwardingTagSize) - 1; + // Tag information for Smi. const int kSmiTag = 0; const int kSmiTagSize = 1; @@ -106,12 +116,51 @@ const int kApiTaggedSize = kApiInt32Size; const int kApiTaggedSize = kApiSystemPointerSize; #endif +constexpr bool PointerCompressionIsEnabled() { + return kApiTaggedSize != kApiSystemPointerSize; +} + +constexpr bool HeapSandboxIsEnabled() { +#ifdef V8_HEAP_SANDBOX + return true; +#else + return false; +#endif +} + +using ExternalPointer_t = Address; + +// If the heap sandbox is enabled, these tag values will be ORed with the +// external pointers in the external pointer table to prevent use of pointers of +// the wrong type. When a pointer is loaded, it is ANDed with the inverse of the +// expected type's tag. The tags are constructed in a way that guarantees that a +// failed type check will result in one or more of the top bits of the pointer +// to be set, rendering the pointer inacessible. This construction allows +// performing the type check and removing GC marking bits from the pointer at +// the same time. +enum ExternalPointerTag : uint64_t { + kExternalPointerNullTag = 0x0000000000000000, + kArrayBufferBackingStoreTag = 0x00ff000000000000, // 0b000000011111111 + kTypedArrayExternalPointerTag = 0x017f000000000000, // 0b000000101111111 + kDataViewDataPointerTag = 0x01bf000000000000, // 0b000000110111111 + kExternalStringResourceTag = 0x01df000000000000, // 0b000000111011111 + kExternalStringResourceDataTag = 0x01ef000000000000, // 0b000000111101111 + kForeignForeignAddressTag = 0x01f7000000000000, // 0b000000111110111 + kNativeContextMicrotaskQueueTag = 0x01fb000000000000, // 0b000000111111011 + kEmbedderDataSlotPayloadTag = 0x01fd000000000000, // 0b000000111111101 + kCodeEntryPointTag = 0x01fe000000000000, // 0b000000111111110 +}; + +constexpr uint64_t kExternalPointerTagMask = 0xffff000000000000; + #ifdef V8_31BIT_SMIS_ON_64BIT_ARCH using PlatformSmiTagging = SmiTagging; #else using PlatformSmiTagging = SmiTagging; #endif +// TODO(ishell): Consinder adding kSmiShiftBits = kSmiShiftSize + kSmiTagSize +// since it's used much more often than the inividual constants. const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize; const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize; const int kSmiMinValue = static_cast(PlatformSmiTagging::kSmiMinValue); @@ -124,12 +173,34 @@ V8_INLINE static constexpr internal::Address IntToSmi(int value) { kSmiTag; } +// Converts encoded external pointer to address. +V8_EXPORT Address DecodeExternalPointerImpl(const Isolate* isolate, + ExternalPointer_t pointer, + ExternalPointerTag tag); + +// {obj} must be the raw tagged pointer representation of a HeapObject +// that's guaranteed to never be in ReadOnlySpace. +V8_EXPORT internal::Isolate* IsolateFromNeverReadOnlySpaceObject(Address obj); + +// Returns if we need to throw when an error occurs. This infers the language +// mode based on the current context and the closure. This returns true if the +// language mode is strict. +V8_EXPORT bool ShouldThrowOnError(v8::internal::Isolate* isolate); + /** * This class exports constants and functionality from within v8 that * is necessary to implement inline functions in the v8 api. Don't * depend on functions and constants defined here. */ class Internals { +#ifdef V8_MAP_PACKING + V8_INLINE static constexpr internal::Address UnpackMapWord( + internal::Address mapword) { + // TODO(wenyuzhao): Clear header metadata. + return mapword ^ kMapWordXorMask; + } +#endif + public: // These values match non-compiler-dependent values defined within // the implementation of v8. @@ -139,12 +210,14 @@ class Internals { 1 * kApiTaggedSize + 2 * kApiInt32Size; static const int kOddballKindOffset = 4 * kApiTaggedSize + kApiDoubleSize; - static const int kForeignAddressOffset = kApiTaggedSize; static const int kJSObjectHeaderSize = 3 * kApiTaggedSize; static const int kFixedArrayHeaderSize = 2 * kApiTaggedSize; static const int kEmbedderDataArrayHeaderSize = 2 * kApiTaggedSize; static const int kEmbedderDataSlotSize = kApiSystemPointerSize; - static const int kNativeContextEmbedderDataOffset = 7 * kApiTaggedSize; +#ifdef V8_HEAP_SANDBOX + static const int kEmbedderDataSlotRawPayloadOffset = kApiTaggedSize; +#endif + static const int kNativeContextEmbedderDataOffset = 6 * kApiTaggedSize; static const int kFullStringRepresentationMask = 0x0f; static const int kStringEncodingMask = 0x8; static const int kExternalTwoByteRepresentationTag = 0x02; @@ -152,15 +225,24 @@ class Internals { static const uint32_t kNumIsolateDataSlots = 4; + // IsolateData layout guarantees. static const int kIsolateEmbedderDataOffset = 0; - static const int kExternalMemoryOffset = + static const int kIsolateFastCCallCallerFpOffset = kNumIsolateDataSlots * kApiSystemPointerSize; - static const int kExternalMemoryLimitOffset = - kExternalMemoryOffset + kApiInt64Size; - static const int kExternalMemoryAtLastMarkCompactOffset = - kExternalMemoryLimitOffset + kApiInt64Size; + static const int kIsolateFastCCallCallerPcOffset = + kIsolateFastCCallCallerFpOffset + kApiSystemPointerSize; + static const int kIsolateFastApiCallTargetOffset = + kIsolateFastCCallCallerPcOffset + kApiSystemPointerSize; + static const int kIsolateStackGuardOffset = + kIsolateFastApiCallTargetOffset + kApiSystemPointerSize; static const int kIsolateRootsOffset = - kExternalMemoryAtLastMarkCompactOffset + kApiInt64Size; + kIsolateStackGuardOffset + 7 * kApiSystemPointerSize; + + static const int kExternalPointerTableBufferOffset = 0; + static const int kExternalPointerTableLengthOffset = + kExternalPointerTableBufferOffset + kApiSystemPointerSize; + static const int kExternalPointerTableCapacityOffset = + kExternalPointerTableLengthOffset + kApiInt32Size; static const int kUndefinedValueRootIndex = 4; static const int kTheHoleValueRootIndex = 5; @@ -174,12 +256,10 @@ class Internals { static const int kNodeStateMask = 0x7; static const int kNodeStateIsWeakValue = 2; static const int kNodeStateIsPendingValue = 3; - static const int kNodeIsIndependentShift = 3; - static const int kNodeIsActiveShift = 4; static const int kFirstNonstringType = 0x40; static const int kOddballType = 0x43; - static const int kForeignType = 0x47; + static const int kForeignType = 0x46; static const int kJSSpecialApiObjectType = 0x410; static const int kJSApiObjectType = 0x420; static const int kJSObjectType = 0x421; @@ -197,6 +277,17 @@ class Internals { // incremental GC once the external memory reaches this limit. static constexpr int kExternalAllocationSoftLimit = 64 * 1024 * 1024; +#ifdef V8_MAP_PACKING + static const uintptr_t kMapWordMetadataMask = 0xffffULL << 48; + // The lowest two bits of mapwords are always `0b10` + static const uintptr_t kMapWordSignature = 0b10; + // XORing a (non-compressed) map with this mask ensures that the two + // low-order bits are 0b10. The 0 at the end makes this look like a Smi, + // although real Smis have all lower 32 bits unset. We only rely on these + // values passing as Smis in very few places. + static const int kMapWordXorMask = 0b11; +#endif + V8_EXPORT static void CheckInitializedImpl(v8::Isolate* isolate); V8_INLINE static void CheckInitialized(v8::Isolate* isolate) { #ifdef V8_ENABLE_CHECKS @@ -223,6 +314,9 @@ class Internals { V8_INLINE static int GetInstanceType(const internal::Address obj) { typedef internal::Address A; A map = ReadTaggedPointerField(obj, kHeapObjectMapOffset); +#ifdef V8_MAP_PACKING + map = UnpackMapWord(map); +#endif return ReadRawField(map, kMapInstanceTypeOffset); } @@ -301,9 +395,10 @@ class Internals { V8_INLINE static internal::Address ReadTaggedPointerField( internal::Address heap_object_ptr, int offset) { #ifdef V8_COMPRESS_POINTERS - int32_t value = ReadRawField(heap_object_ptr, offset); - internal::Address root = GetRootFromOnHeapAddress(heap_object_ptr); - return root + static_cast(static_cast(value)); + uint32_t value = ReadRawField(heap_object_ptr, offset); + internal::Address base = + GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr); + return base + static_cast(static_cast(value)); #else return ReadRawField(heap_object_ptr, offset); #endif @@ -312,35 +407,64 @@ class Internals { V8_INLINE static internal::Address ReadTaggedSignedField( internal::Address heap_object_ptr, int offset) { #ifdef V8_COMPRESS_POINTERS - int32_t value = ReadRawField(heap_object_ptr, offset); - return static_cast(static_cast(value)); + uint32_t value = ReadRawField(heap_object_ptr, offset); + return static_cast(static_cast(value)); #else return ReadRawField(heap_object_ptr, offset); #endif } + V8_INLINE static internal::Isolate* GetIsolateForHeapSandbox( + internal::Address obj) { +#ifdef V8_HEAP_SANDBOX + return internal::IsolateFromNeverReadOnlySpaceObject(obj); +#else + // Not used in non-sandbox mode. + return nullptr; +#endif + } + + V8_INLINE static Address DecodeExternalPointer( + const Isolate* isolate, ExternalPointer_t encoded_pointer, + ExternalPointerTag tag) { +#ifdef V8_HEAP_SANDBOX + return internal::DecodeExternalPointerImpl(isolate, encoded_pointer, tag); +#else + return encoded_pointer; +#endif + } + + V8_INLINE static internal::Address ReadExternalPointerField( + internal::Isolate* isolate, internal::Address heap_object_ptr, int offset, + ExternalPointerTag tag) { +#ifdef V8_HEAP_SANDBOX + internal::ExternalPointer_t encoded_value = + ReadRawField(heap_object_ptr, offset); + // We currently have to treat zero as nullptr in embedder slots. + return encoded_value ? DecodeExternalPointer(isolate, encoded_value, tag) + : 0; +#else + return ReadRawField
(heap_object_ptr, offset); +#endif + } + #ifdef V8_COMPRESS_POINTERS // See v8:7703 or src/ptr-compr.* for details about pointer compression. - static constexpr size_t kPtrComprHeapReservationSize = size_t{1} << 32; - static constexpr size_t kPtrComprIsolateRootBias = - kPtrComprHeapReservationSize / 2; - static constexpr size_t kPtrComprIsolateRootAlignment = size_t{1} << 32; + static constexpr size_t kPtrComprCageReservationSize = size_t{1} << 32; + static constexpr size_t kPtrComprCageBaseAlignment = size_t{1} << 32; - V8_INLINE static internal::Address GetRootFromOnHeapAddress( + V8_INLINE static internal::Address GetPtrComprCageBaseFromOnHeapAddress( internal::Address addr) { - return (addr + kPtrComprIsolateRootBias) & - -static_cast(kPtrComprIsolateRootAlignment); + return addr & -static_cast(kPtrComprCageBaseAlignment); } V8_INLINE static internal::Address DecompressTaggedAnyField( - internal::Address heap_object_ptr, int32_t value) { - internal::Address root_mask = static_cast( - -static_cast(value & kSmiTagMask)); - internal::Address root_or_zero = - root_mask & GetRootFromOnHeapAddress(heap_object_ptr); - return root_or_zero + - static_cast(static_cast(value)); + internal::Address heap_object_ptr, uint32_t value) { + internal::Address base = + GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr); + return base + static_cast(static_cast(value)); } + #endif // V8_COMPRESS_POINTERS }; @@ -364,19 +488,24 @@ void CastCheck::Perform(T* data) {} template V8_INLINE void PerformCastCheck(T* data) { - CastCheck::value>::Perform(data); + CastCheck::value && + !std::is_same>::value>::Perform(data); } -// {obj} must be the raw tagged pointer representation of a HeapObject -// that's guaranteed to never be in ReadOnlySpace. -V8_EXPORT internal::Isolate* IsolateFromNeverReadOnlySpaceObject(Address obj); - -// Returns if we need to throw when an error occurs. This infers the language -// mode based on the current context and the closure. This returns true if the -// language mode is strict. -V8_EXPORT bool ShouldThrowOnError(v8::internal::Isolate* isolate); +// A base class for backing stores, which is needed due to vagaries of +// how static casts work with std::shared_ptr. +class BackingStoreBase {}; } // namespace internal + +V8_EXPORT bool CopyAndConvertArrayToCppBufferInt32(Local src, + int32_t* dst, + uint32_t max_length); + +V8_EXPORT bool CopyAndConvertArrayToCppBufferFloat64(Local src, + double* dst, + uint32_t max_length); + } // namespace v8 #endif // INCLUDE_V8_INTERNAL_H_ diff --git a/libs/android/libnode/include/node/v8-metrics.h b/libs/android/libnode/include/node/v8-metrics.h new file mode 100644 index 00000000..498ee25f --- /dev/null +++ b/libs/android/libnode/include/node/v8-metrics.h @@ -0,0 +1,202 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_METRICS_H_ +#define V8_METRICS_H_ + +#include "v8.h" // NOLINT(build/include_directory) + +namespace v8 { +namespace metrics { + +struct GarbageCollectionPhases { + int64_t compact_wall_clock_duration_in_us = -1; + int64_t mark_wall_clock_duration_in_us = -1; + int64_t sweep_wall_clock_duration_in_us = -1; + int64_t weak_wall_clock_duration_in_us = -1; +}; + +struct GarbageCollectionSizes { + int64_t bytes_before = -1; + int64_t bytes_after = -1; + int64_t bytes_freed = -1; +}; + +struct GarbageCollectionFullCycle { + GarbageCollectionPhases total; + GarbageCollectionPhases total_cpp; + GarbageCollectionPhases main_thread; + GarbageCollectionPhases main_thread_cpp; + GarbageCollectionPhases main_thread_atomic; + GarbageCollectionPhases main_thread_atomic_cpp; + GarbageCollectionPhases main_thread_incremental; + GarbageCollectionPhases main_thread_incremental_cpp; + GarbageCollectionSizes objects; + GarbageCollectionSizes objects_cpp; + GarbageCollectionSizes memory; + GarbageCollectionSizes memory_cpp; + double collection_rate_in_percent; + double collection_rate_cpp_in_percent; + double efficiency_in_bytes_per_us; + double efficiency_cpp_in_bytes_per_us; + double main_thread_efficiency_in_bytes_per_us; + double main_thread_efficiency_cpp_in_bytes_per_us; +}; + +struct GarbageCollectionFullMainThreadIncrementalMark { + int64_t wall_clock_duration_in_us = -1; + int64_t cpp_wall_clock_duration_in_us = -1; +}; + +struct GarbageCollectionFullMainThreadBatchedIncrementalMark { + std::vector events; +}; + +struct GarbageCollectionFullMainThreadIncrementalSweep { + int64_t wall_clock_duration_in_us = -1; + int64_t cpp_wall_clock_duration_in_us = -1; +}; + +struct GarbageCollectionFullMainThreadBatchedIncrementalSweep { + std::vector events; +}; + +struct GarbageCollectionYoungCycle { + int64_t total_wall_clock_duration_in_us = -1; + int64_t main_thread_wall_clock_duration_in_us = -1; + double collection_rate_in_percent; + double efficiency_in_bytes_per_us; + double main_thread_efficiency_in_bytes_per_us; +}; + +struct WasmModuleDecoded { + bool async = false; + bool streamed = false; + bool success = false; + size_t module_size_in_bytes = 0; + size_t function_count = 0; + int64_t wall_clock_duration_in_us = -1; + int64_t cpu_duration_in_us = -1; +}; + +struct WasmModuleCompiled { + bool async = false; + bool streamed = false; + bool cached = false; + bool deserialized = false; + bool lazy = false; + bool success = false; + size_t code_size_in_bytes = 0; + size_t liftoff_bailout_count = 0; + int64_t wall_clock_duration_in_us = -1; + int64_t cpu_duration_in_us = -1; +}; + +struct WasmModuleInstantiated { + bool async = false; + bool success = false; + size_t imported_function_count = 0; + int64_t wall_clock_duration_in_us = -1; +}; + +struct WasmModuleTieredUp { + bool lazy = false; + size_t code_size_in_bytes = 0; + int64_t wall_clock_duration_in_us = -1; + int64_t cpu_duration_in_us = -1; +}; + +struct WasmModulesPerIsolate { + size_t count = 0; +}; + +#define V8_MAIN_THREAD_METRICS_EVENTS(V) \ + V(GarbageCollectionFullCycle) \ + V(GarbageCollectionFullMainThreadIncrementalMark) \ + V(GarbageCollectionFullMainThreadBatchedIncrementalMark) \ + V(GarbageCollectionFullMainThreadIncrementalSweep) \ + V(GarbageCollectionFullMainThreadBatchedIncrementalSweep) \ + V(GarbageCollectionYoungCycle) \ + V(WasmModuleDecoded) \ + V(WasmModuleCompiled) \ + V(WasmModuleInstantiated) \ + V(WasmModuleTieredUp) + +#define V8_THREAD_SAFE_METRICS_EVENTS(V) V(WasmModulesPerIsolate) + +/** + * This class serves as a base class for recording event-based metrics in V8. + * There a two kinds of metrics, those which are expected to be thread-safe and + * whose implementation is required to fulfill this requirement and those whose + * implementation does not have that requirement and only needs to be + * executable on the main thread. If such an event is triggered from a + * background thread, it will be delayed and executed by the foreground task + * runner. + * + * The thread-safe events are listed in the V8_THREAD_SAFE_METRICS_EVENTS + * macro above while the main thread event are listed in + * V8_MAIN_THREAD_METRICS_EVENTS above. For the former, a virtual method + * AddMainThreadEvent(const E& event, v8::Context::Token token) will be + * generated and for the latter AddThreadSafeEvent(const E& event). + * + * Thread-safe events are not allowed to access the context and therefore do + * not carry a context ID with them. These IDs can be generated using + * Recorder::GetContextId() and the ID will be valid throughout the lifetime + * of the isolate. It is not guaranteed that the ID will still resolve to + * a valid context using Recorder::GetContext() at the time the metric is + * recorded. In this case, an empty handle will be returned. + * + * The embedder is expected to call v8::Isolate::SetMetricsRecorder() + * providing its implementation and have the virtual methods overwritten + * for the events it cares about. + */ +class V8_EXPORT Recorder { + public: + // A unique identifier for a context in this Isolate. + // It is guaranteed to not be reused throughout the lifetime of the Isolate. + class ContextId { + public: + ContextId() : id_(kEmptyId) {} + + bool IsEmpty() const { return id_ == kEmptyId; } + static const ContextId Empty() { return ContextId{kEmptyId}; } + + bool operator==(const ContextId& other) const { return id_ == other.id_; } + bool operator!=(const ContextId& other) const { return id_ != other.id_; } + + private: + friend class ::v8::Context; + friend class ::v8::internal::Isolate; + + explicit ContextId(uintptr_t id) : id_(id) {} + + static constexpr uintptr_t kEmptyId = 0; + uintptr_t id_; + }; + + virtual ~Recorder() = default; + +#define ADD_MAIN_THREAD_EVENT(E) \ + virtual void AddMainThreadEvent(const E& event, ContextId context_id) {} + V8_MAIN_THREAD_METRICS_EVENTS(ADD_MAIN_THREAD_EVENT) +#undef ADD_MAIN_THREAD_EVENT + +#define ADD_THREAD_SAFE_EVENT(E) \ + virtual void AddThreadSafeEvent(const E& event) {} + V8_THREAD_SAFE_METRICS_EVENTS(ADD_THREAD_SAFE_EVENT) +#undef ADD_THREAD_SAFE_EVENT + + virtual void NotifyIsolateDisposal() {} + + // Return the context with the given id or an empty handle if the context + // was already garbage collected. + static MaybeLocal GetContext(Isolate* isolate, ContextId id); + // Return the unique id corresponding to the given context. + static ContextId GetContextId(Local context); +}; + +} // namespace metrics +} // namespace v8 + +#endif // V8_METRICS_H_ diff --git a/libs/android/libnode/include/node/v8-platform.h b/libs/android/libnode/include/node/v8-platform.h index 7e43b0d9..4c94d7fd 100644 --- a/libs/android/libnode/include/node/v8-platform.h +++ b/libs/android/libnode/include/node/v8-platform.h @@ -11,12 +11,34 @@ #include #include -#include "v8config.h" // NOLINT(build/include) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { class Isolate; +// Valid priorities supported by the task scheduling infrastructure. +enum class TaskPriority : uint8_t { + /** + * Best effort tasks are not critical for performance of the application. The + * platform implementation should preempt such tasks if higher priority tasks + * arrive. + */ + kBestEffort, + /** + * User visible tasks are long running background tasks that will + * improve performance and memory usage of the application upon completion. + * Example: background compilation and garbage collection. + */ + kUserVisible, + /** + * User blocking tasks are highest priority tasks that block the execution + * thread (e.g. major garbage collection). They must be finished as soon as + * possible. + */ + kUserBlocking, +}; + /** * A Task represents a unit of work. */ @@ -58,6 +80,14 @@ class TaskRunner { * implementation takes ownership of |task|. The |task| cannot be nested * within other task executions. * + * Tasks which shouldn't be interleaved with JS execution must be posted with + * |PostNonNestableTask| or |PostNonNestableDelayedTask|. This is because the + * embedder may process tasks in a callback which is called during JS + * execution. + * + * In particular, tasks which execute JS must be non-nestable, since JS + * execution is not allowed to nest. + * * Requires that |TaskRunner::NonNestableTasksEnabled()| is true. */ virtual void PostNonNestableTask(std::unique_ptr task) {} @@ -76,6 +106,14 @@ class TaskRunner { * implementation takes ownership of |task|. The |task| cannot be nested * within other task executions. * + * Tasks which shouldn't be interleaved with JS execution must be posted with + * |PostNonNestableTask| or |PostNonNestableDelayedTask|. This is because the + * embedder may process tasks in a callback which is called during JS + * execution. + * + * In particular, tasks which execute JS must be non-nestable, since JS + * execution is not allowed to nest. + * * Requires that |TaskRunner::NonNestableDelayedTasksEnabled()| is true. */ virtual void PostNonNestableDelayedTask(std::unique_ptr task, @@ -113,6 +151,133 @@ class TaskRunner { TaskRunner& operator=(const TaskRunner&) = delete; }; +/** + * Delegate that's passed to Job's worker task, providing an entry point to + * communicate with the scheduler. + */ +class JobDelegate { + public: + /** + * Returns true if this thread should return from the worker task on the + * current thread ASAP. Workers should periodically invoke ShouldYield (or + * YieldIfNeeded()) as often as is reasonable. + */ + virtual bool ShouldYield() = 0; + + /** + * Notifies the scheduler that max concurrency was increased, and the number + * of worker should be adjusted accordingly. See Platform::PostJob() for more + * details. + */ + virtual void NotifyConcurrencyIncrease() = 0; + + /** + * Returns a task_id unique among threads currently running this job, such + * that GetTaskId() < worker count. To achieve this, the same task_id may be + * reused by a different thread after a worker_task returns. + */ + virtual uint8_t GetTaskId() = 0; + + /** + * Returns true if the current task is called from the thread currently + * running JobHandle::Join(). + * TODO(etiennep): Make pure virtual once custom embedders implement it. + */ + virtual bool IsJoiningThread() const { return false; } +}; + +/** + * Handle returned when posting a Job. Provides methods to control execution of + * the posted Job. + */ +class JobHandle { + public: + virtual ~JobHandle() = default; + + /** + * Notifies the scheduler that max concurrency was increased, and the number + * of worker should be adjusted accordingly. See Platform::PostJob() for more + * details. + */ + virtual void NotifyConcurrencyIncrease() = 0; + + /** + * Contributes to the job on this thread. Doesn't return until all tasks have + * completed and max concurrency becomes 0. When Join() is called and max + * concurrency reaches 0, it should not increase again. This also promotes + * this Job's priority to be at least as high as the calling thread's + * priority. + */ + virtual void Join() = 0; + + /** + * Forces all existing workers to yield ASAP. Waits until they have all + * returned from the Job's callback before returning. + */ + virtual void Cancel() = 0; + + /* + * Forces all existing workers to yield ASAP but doesn’t wait for them. + * Warning, this is dangerous if the Job's callback is bound to or has access + * to state which may be deleted after this call. + * TODO(etiennep): Cleanup once implemented by all embedders. + */ + virtual void CancelAndDetach() { Cancel(); } + + /** + * Returns true if there's any work pending or any worker running. + */ + virtual bool IsActive() = 0; + + // TODO(etiennep): Clean up once all overrides are removed. + V8_DEPRECATED("Use !IsActive() instead.") + virtual bool IsCompleted() { return !IsActive(); } + + /** + * Returns true if associated with a Job and other methods may be called. + * Returns false after Join() or Cancel() was called. This may return true + * even if no workers are running and IsCompleted() returns true + */ + virtual bool IsValid() = 0; + + // TODO(etiennep): Clean up once all overrides are removed. + V8_DEPRECATED("Use IsValid() instead.") + virtual bool IsRunning() { return IsValid(); } + + /** + * Returns true if job priority can be changed. + */ + virtual bool UpdatePriorityEnabled() const { return false; } + + /** + * Update this Job's priority. + */ + virtual void UpdatePriority(TaskPriority new_priority) {} +}; + +/** + * A JobTask represents work to run in parallel from Platform::PostJob(). + */ +class JobTask { + public: + virtual ~JobTask() = default; + + virtual void Run(JobDelegate* delegate) = 0; + + /** + * Controls the maximum number of threads calling Run() concurrently, given + * the number of threads currently assigned to this job and executing Run(). + * Run() is only invoked if the number of threads previously running Run() was + * less than the value returned. Since GetMaxConcurrency() is a leaf function, + * it must not call back any JobHandle methods. + */ + virtual size_t GetMaxConcurrency(size_t worker_count) const = 0; + + // TODO(1114823): Clean up once all overrides are removed. + V8_DEPRECATED("Use the version that takes |worker_count|.") + virtual size_t GetMaxConcurrency() const { return 0; } +}; + /** * The interface represents complex arguments to trace events. */ @@ -138,6 +303,10 @@ class TracingController { public: virtual ~TracingController() = default; + // In Perfetto mode, trace events are written using Perfetto's Track Event + // API directly without going through the embedder. However, it is still + // possible to observe tracing being enabled and disabled. +#if !defined(V8_USE_PERFETTO) /** * Called by TRACE_EVENT* macros, don't call this directly. * The name parameter is a category group for example: @@ -183,6 +352,7 @@ class TracingController { **/ virtual void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, const char* name, uint64_t handle) {} +#endif // !defined(V8_USE_PERFETTO) class TraceStateObserver { public: @@ -238,9 +408,14 @@ class PageAllocator { kNoAccess, kRead, kReadWrite, - // TODO(hpayer): Remove this flag. Memory should never be rwx. kReadWriteExecute, - kReadExecute + kReadExecute, + // Set this when reserving memory that will later require kReadWriteExecute + // permissions. The resulting behavior is platform-specific, currently + // this is used to set the MAP_JIT flag on Apple Silicon. + // TODO(jkummerow): Remove this when Wasm has a platform-independent + // w^x implementation. + kNoAccessWillJitLater }; /** @@ -272,6 +447,69 @@ class PageAllocator { * memory area brings the memory transparently back. */ virtual bool DiscardSystemPages(void* address, size_t size) { return true; } + + /** + * INTERNAL ONLY: This interface has not been stabilised and may change + * without notice from one release to another without being deprecated first. + */ + class SharedMemoryMapping { + public: + // Implementations are expected to free the shared memory mapping in the + // destructor. + virtual ~SharedMemoryMapping() = default; + virtual void* GetMemory() const = 0; + }; + + /** + * INTERNAL ONLY: This interface has not been stabilised and may change + * without notice from one release to another without being deprecated first. + */ + class SharedMemory { + public: + // Implementations are expected to free the shared memory in the destructor. + virtual ~SharedMemory() = default; + virtual std::unique_ptr RemapTo( + void* new_address) const = 0; + virtual void* GetMemory() const = 0; + virtual size_t GetSize() const = 0; + }; + + /** + * INTERNAL ONLY: This interface has not been stabilised and may change + * without notice from one release to another without being deprecated first. + * + * Reserve pages at a fixed address returning whether the reservation is + * possible. The reserved memory is detached from the PageAllocator and so + * should not be freed by it. It's intended for use with + * SharedMemory::RemapTo, where ~SharedMemoryMapping would free the memory. + */ + virtual bool ReserveForSharedMemoryMapping(void* address, size_t size) { + return false; + } + + /** + * INTERNAL ONLY: This interface has not been stabilised and may change + * without notice from one release to another without being deprecated first. + * + * Allocates shared memory pages. Not all PageAllocators need support this and + * so this method need not be overridden. + * Allocates a new read-only shared memory region of size |length| and copies + * the memory at |original_address| into it. + */ + virtual std::unique_ptr AllocateSharedPages( + size_t length, const void* original_address) { + return {}; + } + + /** + * INTERNAL ONLY: This interface has not been stabilised and may change + * without notice from one release to another without being deprecated first. + * + * If not overridden and changed to return true, V8 will not attempt to call + * AllocateSharedPages or RemapSharedPages. If overridden, AllocateSharedPages + * and RemapSharedPages must also be overridden. + */ + virtual bool CanAllocateSharedPages() { return false; } }; /** @@ -326,7 +564,8 @@ class Platform { /** * Returns a TaskRunner which can be used to post a task on the foreground. - * This function should only be called from a foreground thread. + * The TaskRunner's NonNestableTasksEnabled() must be true. This function + * should only be called from a foreground thread. */ virtual std::shared_ptr GetForegroundTaskRunner( Isolate* isolate) = 0; @@ -362,48 +601,65 @@ class Platform { virtual void CallDelayedOnWorkerThread(std::unique_ptr task, double delay_in_seconds) = 0; - /** - * Schedules a task to be invoked on a foreground thread wrt a specific - * |isolate|. Tasks posted for the same isolate should be execute in order of - * scheduling. The definition of "foreground" is opaque to V8. - */ - V8_DEPRECATE_SOON( - "Use a taskrunner acquired by GetForegroundTaskRunner instead.", - virtual void CallOnForegroundThread(Isolate* isolate, Task* task)) = 0; - - /** - * Schedules a task to be invoked on a foreground thread wrt a specific - * |isolate| after the given number of seconds |delay_in_seconds|. - * Tasks posted for the same isolate should be execute in order of - * scheduling. The definition of "foreground" is opaque to V8. - */ - V8_DEPRECATE_SOON( - "Use a taskrunner acquired by GetForegroundTaskRunner instead.", - virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task, - double delay_in_seconds)) = 0; - - /** - * Schedules a task to be invoked on a foreground thread wrt a specific - * |isolate| when the embedder is idle. - * Requires that SupportsIdleTasks(isolate) is true. - * Idle tasks may be reordered relative to other task types and may be - * starved for an arbitrarily long time if no idle time is available. - * The definition of "foreground" is opaque to V8. - */ - V8_DEPRECATE_SOON( - "Use a taskrunner acquired by GetForegroundTaskRunner instead.", - virtual void CallIdleOnForegroundThread(Isolate* isolate, - IdleTask* task)) { - // This must be overriden if |IdleTasksEnabled()|. - abort(); - } - /** * Returns true if idle tasks are enabled for the given |isolate|. */ - virtual bool IdleTasksEnabled(Isolate* isolate) { - return false; - } + virtual bool IdleTasksEnabled(Isolate* isolate) { return false; } + + /** + * Posts |job_task| to run in parallel. Returns a JobHandle associated with + * the Job, which can be joined or canceled. + * This avoids degenerate cases: + * - Calling CallOnWorkerThread() for each work item, causing significant + * overhead. + * - Fixed number of CallOnWorkerThread() calls that split the work and might + * run for a long time. This is problematic when many components post + * "num cores" tasks and all expect to use all the cores. In these cases, + * the scheduler lacks context to be fair to multiple same-priority requests + * and/or ability to request lower priority work to yield when high priority + * work comes in. + * A canonical implementation of |job_task| looks like: + * class MyJobTask : public JobTask { + * public: + * MyJobTask(...) : worker_queue_(...) {} + * // JobTask: + * void Run(JobDelegate* delegate) override { + * while (!delegate->ShouldYield()) { + * // Smallest unit of work. + * auto work_item = worker_queue_.TakeWorkItem(); // Thread safe. + * if (!work_item) return; + * ProcessWork(work_item); + * } + * } + * + * size_t GetMaxConcurrency() const override { + * return worker_queue_.GetSize(); // Thread safe. + * } + * }; + * auto handle = PostJob(TaskPriority::kUserVisible, + * std::make_unique(...)); + * handle->Join(); + * + * PostJob() and methods of the returned JobHandle/JobDelegate, must never be + * called while holding a lock that could be acquired by JobTask::Run or + * JobTask::GetMaxConcurrency -- that could result in a deadlock. This is + * because [1] JobTask::GetMaxConcurrency may be invoked while holding + * internal lock (A), hence JobTask::GetMaxConcurrency can only use a lock (B) + * if that lock is *never* held while calling back into JobHandle from any + * thread (A=>B/B=>A deadlock) and [2] JobTask::Run or + * JobTask::GetMaxConcurrency may be invoked synchronously from JobHandle + * (B=>JobHandle::foo=>B deadlock). + * + * A sufficient PostJob() implementation that uses the default Job provided in + * libplatform looks like: + * std::unique_ptr PostJob( + * TaskPriority priority, std::unique_ptr job_task) override { + * return v8::platform::NewDefaultJobHandle( + * this, priority, std::move(job_task), NumberOfWorkerThreads()); + * } + */ + virtual std::unique_ptr PostJob( + TaskPriority priority, std::unique_ptr job_task) = 0; /** * Monotonically increasing time in seconds from an arbitrary fixed point in @@ -439,14 +695,6 @@ class Platform { */ virtual void DumpWithoutCrashing() {} - /** - * Lets the embedder to add crash keys. - */ - virtual void AddCrashKey(int id, const char* name, uintptr_t value) { - // "noop" is a valid implementation if the embedder doesn't care to log - // additional data for crashes. - } - protected: /** * Default implementation of current wall-clock time in milliseconds diff --git a/libs/android/libnode/include/node/v8-profiler.h b/libs/android/libnode/include/node/v8-profiler.h index 2c7d4b12..49ada0a7 100644 --- a/libs/android/libnode/include/node/v8-profiler.h +++ b/libs/android/libnode/include/node/v8-profiler.h @@ -6,9 +6,12 @@ #define V8_V8_PROFILER_H_ #include + +#include #include #include -#include "v8.h" // NOLINT(build/include) + +#include "v8.h" // NOLINT(build/include_directory) /** * Profiler support for the V8 JavaScript engine. @@ -18,8 +21,8 @@ namespace v8 { class HeapGraphNode; struct HeapStatsUpdate; -typedef uint32_t SnapshotObjectId; - +using NativeObject = void*; +using SnapshotObjectId = uint32_t; struct CpuProfileDeoptFrame { int script_id; @@ -142,11 +145,6 @@ class V8_EXPORT CpuProfileNode { */ unsigned GetHitCount() const; - /** Returns function entry UID. */ - V8_DEPRECATE_SOON( - "Use GetScriptId, GetLineNumber, and GetColumnNumber instead.", - unsigned GetCallUid() const); - /** Returns id of the node. The id is unique within the tree */ unsigned GetNodeId() const; @@ -251,6 +249,26 @@ enum CpuProfilingLoggingMode { kEagerLogging, }; +// Enum for returning profiling status. Once StartProfiling is called, +// we want to return to clients whether the profiling was able to start +// correctly, or return a descriptive error. +enum class CpuProfilingStatus { + kStarted, + kAlreadyStarted, + kErrorTooManyProfilers +}; + +/** + * Delegate for when max samples reached and samples are discarded. + */ +class V8_EXPORT DiscardedSamplesDelegate { + public: + DiscardedSamplesDelegate() {} + + virtual ~DiscardedSamplesDelegate() = default; + virtual void Notify() = 0; +}; + /** * Optional profiling attributes. */ @@ -271,13 +289,13 @@ class V8_EXPORT CpuProfilingOptions { * interval, set via SetSamplingInterval(). If * zero, the sampling interval will be equal to * the profiler's sampling interval. + * \param filter_context Deprecated option to filter by context, currently a + * no-op. */ - CpuProfilingOptions(CpuProfilingMode mode = kLeafNodeLineNumbers, - unsigned max_samples = kNoSampleLimit, - int sampling_interval_us = 0) - : mode_(mode), - max_samples_(max_samples), - sampling_interval_us_(sampling_interval_us) {} + CpuProfilingOptions( + CpuProfilingMode mode = kLeafNodeLineNumbers, + unsigned max_samples = kNoSampleLimit, int sampling_interval_us = 0, + MaybeLocal filter_context = MaybeLocal()); CpuProfilingMode mode() const { return mode_; } unsigned max_samples() const { return max_samples_; } @@ -286,9 +304,6 @@ class V8_EXPORT CpuProfilingOptions { private: friend class internal::CpuProfile; - bool has_filter_context() const; - void* raw_filter_context() const; - CpuProfilingMode mode_; unsigned max_samples_; int sampling_interval_us_; @@ -305,12 +320,9 @@ class V8_EXPORT CpuProfiler { * initialized. The profiler object must be disposed after use by calling * |Dispose| method. */ - static CpuProfiler* New(Isolate* isolate); - static CpuProfiler* New(Isolate* isolate, - CpuProfilingNamingMode mode); static CpuProfiler* New(Isolate* isolate, - CpuProfilingNamingMode namingMode, - CpuProfilingLoggingMode loggingMode); + CpuProfilingNamingMode = kDebugNaming, + CpuProfilingLoggingMode = kLazyLogging); /** * Synchronously collect current stack sample in all profilers attached to @@ -345,7 +357,9 @@ class V8_EXPORT CpuProfiler { * profiles may be collected at once. Attempts to start collecting several * profiles with the same title are silently ignored. */ - void StartProfiling(Local title, CpuProfilingOptions options); + CpuProfilingStatus StartProfiling( + Local title, CpuProfilingOptions options, + std::unique_ptr delegate = nullptr); /** * Starts profiling with the same semantics as above, except with expanded @@ -358,17 +372,16 @@ class V8_EXPORT CpuProfiler { * recorded by the profiler. Samples obtained after this limit will be * discarded. */ - void StartProfiling( - Local title, CpuProfilingMode mode, bool record_samples = false); - void StartProfiling( - Local title, CpuProfilingMode mode, bool record_samples, - unsigned max_samples); + CpuProfilingStatus StartProfiling( + Local title, CpuProfilingMode mode, bool record_samples = false, + unsigned max_samples = CpuProfilingOptions::kNoSampleLimit); /** * The same as StartProfiling above, but the CpuProfilingMode defaults to * kLeafNodeLineNumbers mode, which was the previous default behavior of the * profiler. */ - void StartProfiling(Local title, bool record_samples = false); + CpuProfilingStatus StartProfiling(Local title, + bool record_samples = false); /** * Stops collecting CPU profile with a given title and returns it. @@ -376,20 +389,6 @@ class V8_EXPORT CpuProfiler { */ CpuProfile* StopProfiling(Local title); - /** - * Force collection of a sample. Must be called on the VM thread. - * Recording the forced sample does not contribute to the aggregated - * profile statistics. - */ - V8_DEPRECATED("Use static CollectSample(Isolate*) instead.", - void CollectSample()); - - /** - * Tells the profiler whether the embedder is idle. - */ - V8_DEPRECATED("Use Isolate::SetIdle(bool) instead.", - void SetIdle(bool is_idle)); - /** * Generate more detailed source positions to code objects. This results in * better results when mapping profiling samples to script source. @@ -493,7 +492,7 @@ class V8_EXPORT HeapGraphNode { /** * An interface for exporting data from V8, using "push" model. */ -class V8_EXPORT OutputStream { // NOLINT +class V8_EXPORT OutputStream { public: enum WriteResult { kContinue = 0, @@ -520,7 +519,6 @@ class V8_EXPORT OutputStream { // NOLINT } }; - /** * HeapSnapshots record the state of the JS heap at some moment. */ @@ -587,7 +585,7 @@ class V8_EXPORT HeapSnapshot { * An interface for reporting progress and controlling long-running * activities. */ -class V8_EXPORT ActivityControl { // NOLINT +class V8_EXPORT ActivityControl { public: enum ControlOption { kContinue = 0, @@ -601,7 +599,6 @@ class V8_EXPORT ActivityControl { // NOLINT virtual ControlOption ReportProgressValue(int done, int total) = 0; }; - /** * AllocationProfile is a sampled profile of allocations done by the program. * This is structured as a call-graph. @@ -735,6 +732,19 @@ class V8_EXPORT EmbedderGraph { public: class Node { public: + /** + * Detachedness specifies whether an object is attached or detached from the + * main application state. While unkown in general, there may be objects + * that specifically know their state. V8 passes this information along in + * the snapshot. Users of the snapshot may use it to annotate the object + * graph. + */ + enum class Detachedness : uint8_t { + kUnknown = 0, + kAttached = 1, + kDetached = 2, + }; + Node() = default; virtual ~Node() = default; virtual const char* Name() = 0; @@ -753,6 +763,20 @@ class V8_EXPORT EmbedderGraph { */ virtual const char* NamePrefix() { return nullptr; } + /** + * Returns the NativeObject that can be used for querying the + * |HeapSnapshot|. + */ + virtual NativeObject GetNativeObject() { return nullptr; } + + /** + * Detachedness state of a given object. While unkown in general, there may + * be objects that specifically know their state. V8 passes this information + * along in the snapshot. Users of the snapshot may use it to annotate the + * object graph. + */ + virtual Detachedness GetDetachedness() { return Detachedness::kUnknown; } + Node(const Node&) = delete; Node& operator=(const Node&) = delete; }; @@ -803,6 +827,18 @@ class V8_EXPORT HeapProfiler { v8::EmbedderGraph* graph, void* data); + /** + * Callback function invoked during heap snapshot generation to retrieve + * the detachedness state of an object referenced by a TracedReference. + * + * The callback takes Local as parameter to allow the embedder to + * unpack the TracedReference into a Local and reuse that Local for different + * purposes. + */ + using GetDetachednessCallback = EmbedderGraph::Node::Detachedness (*)( + v8::Isolate* isolate, const v8::Local& v8_value, + uint16_t class_id, void* data); + /** Returns the number of snapshots taken. */ int GetSnapshotCount(); @@ -815,6 +851,12 @@ class V8_EXPORT HeapProfiler { */ SnapshotObjectId GetObjectId(Local value); + /** + * Returns SnapshotObjectId for a native object referenced by |value| if it + * has been seen by the heap profiler, kUnknownObjectId otherwise. + */ + SnapshotObjectId GetObjectId(NativeObject value); + /** * Returns heap object with given SnapshotObjectId if the object is alive, * otherwise empty handle is returned. @@ -855,7 +897,17 @@ class V8_EXPORT HeapProfiler { */ const HeapSnapshot* TakeHeapSnapshot( ActivityControl* control = nullptr, - ObjectNameResolver* global_object_name_resolver = nullptr); + ObjectNameResolver* global_object_name_resolver = nullptr, + bool treat_global_objects_as_roots = true); + + /** + * Takes a heap snapshot and returns it. + */ + const HeapSnapshot* TakeHeapSnapshotV8_92( + ActivityControl* control = nullptr, + ObjectNameResolver* global_object_name_resolver = nullptr, + bool treat_global_objects_as_roots = true, + bool capture_numeric_value = false); /** * Starts tracking of heap objects population statistics. After calling @@ -946,6 +998,8 @@ class V8_EXPORT HeapProfiler { void RemoveBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback, void* data); + void SetGetDetachednessCallback(GetDetachednessCallback callback, void* data); + /** * Default value of persistent handle class ID. Must not be used to * define a class. Can be used to reset a class of a persistent @@ -983,7 +1037,8 @@ struct HeapStatsUpdate { V(LazyCompile) \ V(RegExp) \ V(Script) \ - V(Stub) + V(Stub) \ + V(Relocation) /** * Note that this enum may be extended in the future. Please include a default @@ -1016,10 +1071,12 @@ class V8_EXPORT CodeEvent { const char* GetComment(); static const char* GetCodeEventTypeName(CodeEventType code_event_type); + + uintptr_t GetPreviousCodeStartAddress(); }; /** - * Interface to listen to code creation events. + * Interface to listen to code creation and code relocation events. */ class V8_EXPORT CodeEventHandler { public: @@ -1031,9 +1088,26 @@ class V8_EXPORT CodeEventHandler { explicit CodeEventHandler(Isolate* isolate); virtual ~CodeEventHandler(); + /** + * Handle is called every time a code object is created or moved. Information + * about each code event will be available through the `code_event` + * parameter. + * + * When the CodeEventType is kRelocationType, the code for this CodeEvent has + * moved from `GetPreviousCodeStartAddress()` to `GetCodeStartAddress()`. + */ virtual void Handle(CodeEvent* code_event) = 0; + /** + * Call `Enable()` to starts listening to code creation and code relocation + * events. These events will be handled by `Handle()`. + */ void Enable(); + + /** + * Call `Disable()` to stop listening to code creation and code relocation + * events. + */ void Disable(); private: diff --git a/libs/android/libnode/include/node/v8-testing.h b/libs/android/libnode/include/node/v8-testing.h deleted file mode 100644 index f67bf253..00000000 --- a/libs/android/libnode/include/node/v8-testing.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef V8_V8_TEST_H_ -#define V8_V8_TEST_H_ - -#include "v8.h" // NOLINT(build/include) - -/** - * Testing support for the V8 JavaScript engine. - */ -namespace v8 { - -class V8_EXPORT Testing { - public: - enum StressType { - kStressTypeOpt, - kStressTypeDeopt - }; - - /** - * Set the type of stressing to do. The default if not set is kStressTypeOpt. - */ - static void SetStressRunType(StressType type); - - /** - * Get the number of runs of a given test that is required to get the full - * stress coverage. - */ - static int GetStressRuns(); - - /** - * Indicate the number of the run which is about to start. The value of run - * should be between 0 and one less than the result from GetStressRuns() - */ - static void PrepareStressRun(int run); - - /** - * Force deoptimization of all functions. - */ - static void DeoptimizeAll(Isolate* isolate); -}; - - -} // namespace v8 - -#endif // V8_V8_TEST_H_ diff --git a/libs/android/libnode/include/node/v8-unwinder-state.h b/libs/android/libnode/include/node/v8-unwinder-state.h new file mode 100644 index 00000000..00f8b8b1 --- /dev/null +++ b/libs/android/libnode/include/node/v8-unwinder-state.h @@ -0,0 +1,30 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_V8_UNWINDER_STATE_H_ +#define INCLUDE_V8_UNWINDER_STATE_H_ + +namespace v8 { + +#ifdef V8_TARGET_ARCH_ARM +struct CalleeSavedRegisters { + void* arm_r4; + void* arm_r5; + void* arm_r6; + void* arm_r7; + void* arm_r8; + void* arm_r9; + void* arm_r10; +}; +#elif V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM64 || \ + V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC || \ + V8_TARGET_ARCH_PPC64 || V8_TARGET_ARCH_RISCV64 || V8_TARGET_ARCH_S390 +struct CalleeSavedRegisters {}; +#else +#error Target architecture was not detected as supported by v8 +#endif + +} // namespace v8 + +#endif // INCLUDE_V8_UNWINDER _STATE_H_ diff --git a/libs/android/libnode/include/node/v8-util.h b/libs/android/libnode/include/node/v8-util.h index 24962607..8e4d6615 100644 --- a/libs/android/libnode/include/node/v8-util.h +++ b/libs/android/libnode/include/node/v8-util.h @@ -5,7 +5,7 @@ #ifndef V8_UTIL_H_ #define V8_UTIL_H_ -#include "v8.h" // NOLINT(build/include) +#include "v8.h" // NOLINT(build/include_directory) #include #include #include @@ -43,7 +43,7 @@ class StdMapTraits { static bool Empty(Impl* impl) { return impl->empty(); } static size_t Size(Impl* impl) { return impl->size(); } - static void Swap(Impl& a, Impl& b) { std::swap(a, b); } // NOLINT + static void Swap(Impl& a, Impl& b) { std::swap(a, b); } static Iterator Begin(Impl* impl) { return impl->begin(); } static Iterator End(Impl* impl) { return impl->end(); } static K Key(Iterator it) { return it->first; } @@ -194,14 +194,6 @@ class PersistentValueMapBase { return SetReturnValueFromVal(&returnValue, Traits::Get(&impl_, key)); } - /** - * Call V8::RegisterExternallyReferencedObject with the map value for given - * key. - */ - V8_DEPRECATED( - "Used TracedGlobal and EmbedderHeapTracer::RegisterEmbedderReference", - inline void RegisterExternallyReferencedObject(K& key)); - /** * Return value for key and remove it from the map. */ @@ -352,16 +344,6 @@ class PersistentValueMapBase { const char* label_; }; -template -inline void -PersistentValueMapBase::RegisterExternallyReferencedObject( - K& key) { - assert(Contains(key)); - V8::RegisterExternallyReferencedObject( - reinterpret_cast(FromVal(Traits::Get(&impl_, key))), - reinterpret_cast(GetIsolate())); -} - template class PersistentValueMap : public PersistentValueMapBase { public: diff --git a/libs/android/libnode/include/node/v8-version-string.h b/libs/android/libnode/include/node/v8-version-string.h index fb84144d..8faed2a7 100644 --- a/libs/android/libnode/include/node/v8-version-string.h +++ b/libs/android/libnode/include/node/v8-version-string.h @@ -5,7 +5,7 @@ #ifndef V8_VERSION_STRING_H_ #define V8_VERSION_STRING_H_ -#include "v8-version.h" // NOLINT(build/include) +#include "v8-version.h" // NOLINT(build/include_directory) // This is here rather than v8-version.h to keep that file simple and // machine-processable. diff --git a/libs/android/libnode/include/node/v8-version.h b/libs/android/libnode/include/node/v8-version.h index 38881eb3..7f77900f 100644 --- a/libs/android/libnode/include/node/v8-version.h +++ b/libs/android/libnode/include/node/v8-version.h @@ -8,10 +8,10 @@ // These macros define the version number for the current version. // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. -#define V8_MAJOR_VERSION 7 -#define V8_MINOR_VERSION 8 -#define V8_BUILD_NUMBER 279 -#define V8_PATCH_LEVEL 23 +#define V8_MAJOR_VERSION 9 +#define V8_MINOR_VERSION 4 +#define V8_BUILD_NUMBER 146 +#define V8_PATCH_LEVEL 26 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/libs/android/libnode/include/node/v8-wasm-trap-handler-posix.h b/libs/android/libnode/include/node/v8-wasm-trap-handler-posix.h index 998d0a41..9b8e8a5b 100644 --- a/libs/android/libnode/include/node/v8-wasm-trap-handler-posix.h +++ b/libs/android/libnode/include/node/v8-wasm-trap-handler-posix.h @@ -7,7 +7,7 @@ #include -#include "v8config.h" // NOLINT(build/include) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { /** diff --git a/libs/android/libnode/include/node/v8-wasm-trap-handler-win.h b/libs/android/libnode/include/node/v8-wasm-trap-handler-win.h index 0185df64..9d3cad58 100644 --- a/libs/android/libnode/include/node/v8-wasm-trap-handler-win.h +++ b/libs/android/libnode/include/node/v8-wasm-trap-handler-win.h @@ -7,7 +7,7 @@ #include -#include "v8config.h" // NOLINT(build/include) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { /** diff --git a/libs/android/libnode/include/node/v8.h b/libs/android/libnode/include/node/v8.h index aa19cf8c..eacdaae7 100644 --- a/libs/android/libnode/include/node/v8.h +++ b/libs/android/libnode/include/node/v8.h @@ -9,7 +9,7 @@ * This set of documents provides reference material generated from the * V8 header file, include/v8.h. * - * For other documentation see http://code.google.com/apis/v8/ + * For other documentation see https://v8.dev/. */ #ifndef INCLUDE_V8_H_ @@ -18,15 +18,18 @@ #include #include #include + +#include #include #include #include #include #include -#include "v8-internal.h" // NOLINT(build/include) -#include "v8-version.h" // NOLINT(build/include) -#include "v8config.h" // NOLINT(build/include) +#include "cppgc/common.h" +#include "v8-internal.h" // NOLINT(build/include_directory) +#include "v8-version.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) // We reserve the V8_* prefix for macros defined in V8 public API and // assume there are no name conflicts with the embedder's code. @@ -43,9 +46,14 @@ class BigInt; class BigIntObject; class Boolean; class BooleanObject; +class CFunction; +class CallHandlerHelper; class Context; +class CppHeap; +class CTypeInfo; class Data; class Date; +class EscapableHandleScope; class External; class Function; class FunctionTemplate; @@ -54,8 +62,7 @@ class ImplementationUtilities; class Int32; class Integer; class Isolate; -template -class Maybe; +class Isolate; class MicrotaskQueue; class Name; class Number; @@ -65,6 +72,8 @@ class ObjectOperationDescriptor; class ObjectTemplate; class Platform; class Primitive; +class PrimitiveArray; +class Private; class Promise; class PropertyDescriptor; class Proxy; @@ -72,66 +81,72 @@ class RawOperationDescriptor; class Script; class SharedArrayBuffer; class Signature; -class StartupData; class StackFrame; class StackTrace; +class StartupData; class String; class StringObject; class Symbol; class SymbolObject; -class PrimitiveArray; -class Private; +class TracedReferenceBase; class Uint32; class Utils; class Value; +class WasmMemoryObject; class WasmModuleObject; -template class Local; -template -class MaybeLocal; -template class Eternal; +template +class GlobalValueMap; +template +class PersistentValueMapBase; template class NonCopyablePersistentTraits; -template class PersistentBase; -template > +template > class Persistent; template +class BasicTracedReference; +template +class Eternal; +template class Global; template +class Local; +template +class Maybe; +template +class MaybeLocal; +template class TracedGlobal; +template +class TracedReference; template class PersistentValueMap; -template -class PersistentValueMapBase; -template -class GlobalValueMap; -template class PersistentValueVector; template class WeakCallbackObject; -class FunctionTemplate; -class ObjectTemplate; +template +class PersistentBase; +template +class PersistentValueVector; template class FunctionCallbackInfo; template class PropertyCallbackInfo; -class StackTrace; -class StackFrame; -class Isolate; -class CallHandlerHelper; -class EscapableHandleScope; template class ReturnValue; namespace internal { -class Arguments; -class DeferredHandles; +class BasicTracedReferenceExtractor; +class ExternalString; +class FunctionCallbackArguments; +class GlobalHandles; class Heap; class HeapObject; -class ExternalString; class Isolate; class LocalEmbedderHeapTracer; class MicrotaskQueue; -class NeverReadOnlySpaceObject; -struct ScriptStreamingData; -template class CustomArguments; class PropertyCallbackArguments; -class FunctionCallbackArguments; -class GlobalHandles; +class ReadOnlyHeap; class ScopedExternalStringLock; class ThreadLocalTop; +struct ScriptStreamingData; +enum class ArgumentsType; +template +class Arguments; +template +class CustomArguments; namespace wasm { class NativeModule; @@ -140,17 +155,16 @@ class StreamingDecoder; } // namespace internal +namespace metrics { +class Recorder; +} // namespace metrics + namespace debug { class ConsoleCallArguments; } // namespace debug // --- Handles --- -#define TYPE_CHECK(T, S) \ - while (false) { \ - *(static_cast(0)) = static_cast(0); \ - } - /** * An object reference managed by the v8 garbage collector. * @@ -194,7 +208,7 @@ class Local { * handles. For example, converting from a Local to a * Local. */ - TYPE_CHECK(T, S); + static_assert(std::is_base_of::value, "type check"); } /** @@ -213,9 +227,13 @@ class Local { /** * Checks whether two handles are the same. - * Returns true if both are empty, or if the objects - * to which they refer are identical. - * The handles' references are not checked. + * Returns true if both are empty, or if the objects to which they refer + * are identical. + * + * If both handles refer to JS objects, this is the same as strict equality. + * For primitives, such as numbers or strings, a `false` return value does not + * indicate that the values aren't equal in the JavaScript sense. + * Use `Value::StrictEquals()` to check primitives for equality. */ template V8_INLINE bool operator==(const Local& that) const { @@ -239,7 +257,11 @@ class Local { * Checks whether two handles are different. * Returns true if only one of the handles is empty, or if * the objects to which they refer are different. - * The handles' references are not checked. + * + * If both handles refer to JS objects, this is the same as strict + * non-equality. For primitives, such as numbers or strings, a `true` return + * value does not indicate that the values aren't equal in the JavaScript + * sense. Use `Value::StrictEquals()` to check primitives for equality. */ template V8_INLINE bool operator!=(const Local& that) const { @@ -283,9 +305,11 @@ class Local { V8_INLINE static Local New(Isolate* isolate, Local that); V8_INLINE static Local New(Isolate* isolate, const PersistentBase& that); - V8_INLINE static Local New(Isolate* isolate, const TracedGlobal& that); + V8_INLINE static Local New(Isolate* isolate, + const BasicTracedReference& that); private: + friend class TracedReferenceBase; friend class Utils; template friend class Eternal; template friend class PersistentBase; @@ -313,7 +337,13 @@ class Local { template friend class ReturnValue; template + friend class Traced; + template friend class TracedGlobal; + template + friend class BasicTracedReference; + template + friend class TracedReference; explicit V8_INLINE Local(T* that) : val_(that) {} V8_INLINE static Local New(Isolate* isolate, T* that); @@ -345,7 +375,7 @@ class MaybeLocal { template V8_INLINE MaybeLocal(Local that) : val_(reinterpret_cast(*that)) { - TYPE_CHECK(T, S); + static_assert(std::is_base_of::value, "type check"); } V8_INLINE bool IsEmpty() const { return val_ == nullptr; } @@ -406,7 +436,7 @@ static const int kEmbedderFieldsInWeakCallback = 2; template class WeakCallbackInfo { public: - typedef void (*Callback)(const WeakCallbackInfo& data); + using Callback = void (*)(const WeakCallbackInfo& data); WeakCallbackInfo(Isolate* isolate, T* parameter, void* embedder_fields[kEmbedderFieldsInWeakCallback], @@ -514,11 +544,16 @@ template class PersistentBase { } /** - * Install a finalization callback on this object. - * NOTE: There is no guarantee as to *when* or even *if* the callback is - * invoked. The invocation is performed solely on a best effort basis. - * As always, GC-based finalization should *not* be relied upon for any - * critical form of resource management! + * Install a finalization callback on this object. + * NOTE: There is no guarantee as to *when* or even *if* the callback is + * invoked. The invocation is performed solely on a best effort basis. + * As always, GC-based finalization should *not* be relied upon for any + * critical form of resource management! + * + * The callback is supposed to reset the handle. No further V8 API may be + * called in this callback. In case additional work involving V8 needs to be + * done, a second callback can be scheduled using + * WeakCallbackInfo::SetSecondPassCallback. */ template V8_INLINE void SetWeak(P* parameter, @@ -548,38 +583,6 @@ template class PersistentBase { */ V8_INLINE void AnnotateStrongRetainer(const char* label); - /** - * Allows the embedder to tell the v8 garbage collector that a certain object - * is alive. Only allowed when the embedder is asked to trace its heap by - * EmbedderHeapTracer. - */ - V8_DEPRECATED( - "Used TracedGlobal and EmbedderHeapTracer::RegisterEmbedderReference", - V8_INLINE void RegisterExternalReference(Isolate* isolate) const); - - /** - * Marks the reference to this object independent. Garbage collector is free - * to ignore any object groups containing this object. Weak callback for an - * independent handle should not assume that it will be preceded by a global - * GC prologue callback or followed by a global GC epilogue callback. - */ - V8_DEPRECATED( - "Weak objects are always considered independent. " - "Use TracedGlobal when trying to use EmbedderHeapTracer. " - "Use a strong handle when trying to keep an object alive.", - V8_INLINE void MarkIndependent()); - - /** - * Marks the reference to this object as active. The scavenge garbage - * collection should not reclaim the objects marked as active, even if the - * object held by the handle is otherwise unreachable. - * - * This bit is cleared after the each garbage collection pass. - */ - V8_DEPRECATED("Use TracedGlobal.", V8_INLINE void MarkActive()); - - V8_DEPRECATED("See MarkIndependent.", V8_INLINE bool IsIndependent() const); - /** Returns true if the handle's reference is weak. */ V8_INLINE bool IsWeak() const; @@ -594,7 +597,7 @@ template class PersistentBase { */ V8_INLINE uint16_t WrapperClassId() const; - PersistentBase(const PersistentBase& other) = delete; // NOLINT + PersistentBase(const PersistentBase& other) = delete; void operator=(const PersistentBase&) = delete; private: @@ -627,16 +630,13 @@ template class PersistentBase { template class NonCopyablePersistentTraits { public: - typedef Persistent > NonCopyablePersistent; + using NonCopyablePersistent = Persistent>; static const bool kResetInDestructor = false; template V8_INLINE static void Copy(const Persistent& source, NonCopyablePersistent* dest) { - Uncompilable(); - } - // TODO(dcarney): come up with a good compile error here. - template V8_INLINE static void Uncompilable() { - TYPE_CHECK(O, Primitive); + static_assert(sizeof(S) < 0, + "NonCopyablePersistentTraits::Copy is not instantiable"); } }; @@ -647,7 +647,7 @@ class NonCopyablePersistentTraits { */ template struct CopyablePersistentTraits { - typedef Persistent > CopyablePersistent; + using CopyablePersistent = Persistent>; static const bool kResetInDestructor = true; template static V8_INLINE void Copy(const Persistent& source, @@ -679,7 +679,7 @@ template class Persistent : public PersistentBase { template V8_INLINE Persistent(Isolate* isolate, Local that) : PersistentBase(PersistentBase::New(isolate, *that)) { - TYPE_CHECK(T, S); + static_assert(std::is_base_of::value, "type check"); } /** * Construct a Persistent from a Persistent. @@ -689,7 +689,7 @@ template class Persistent : public PersistentBase { template V8_INLINE Persistent(Isolate* isolate, const Persistent& that) : PersistentBase(PersistentBase::New(isolate, *that)) { - TYPE_CHECK(T, S); + static_assert(std::is_base_of::value, "type check"); } /** * The copy constructors and assignment operator create a Persistent @@ -709,7 +709,7 @@ template class Persistent : public PersistentBase { return *this; } template - V8_INLINE Persistent& operator=(const Persistent& that) { // NOLINT + V8_INLINE Persistent& operator=(const Persistent& that) { Copy(that); return *this; } @@ -724,7 +724,7 @@ template class Persistent : public PersistentBase { // TODO(dcarney): this is pretty useless, fix or remove template - V8_INLINE static Persistent& Cast(const Persistent& that) { // NOLINT + V8_INLINE static Persistent& Cast(const Persistent& that) { #ifdef V8_ENABLE_CHECKS // If we're going to perform the type check then we have to check // that the handle isn't empty before doing the checked cast. @@ -735,7 +735,7 @@ template class Persistent : public PersistentBase { // TODO(dcarney): this is pretty useless, fix or remove template - V8_INLINE Persistent& As() const { // NOLINT + V8_INLINE Persistent& As() const { return Persistent::Cast(*this); } @@ -774,7 +774,7 @@ class Global : public PersistentBase { template V8_INLINE Global(Isolate* isolate, Local that) : PersistentBase(PersistentBase::New(isolate, *that)) { - TYPE_CHECK(T, S); + static_assert(std::is_base_of::value, "type check"); } /** @@ -785,7 +785,7 @@ class Global : public PersistentBase { template V8_INLINE Global(Isolate* isolate, const PersistentBase& that) : PersistentBase(PersistentBase::New(isolate, that.val_)) { - TYPE_CHECK(T, S); + static_assert(std::is_base_of::value, "type check"); } /** @@ -804,12 +804,12 @@ class Global : public PersistentBase { /** * Pass allows returning uniques from functions, etc. */ - Global Pass() { return static_cast(*this); } // NOLINT + Global Pass() { return static_cast(*this); } /* * For compatibility with Chromium's base::Bind (base::Passed). */ - typedef void MoveOnlyTypeForCPP03; + using MoveOnlyTypeForCPP03 = void; Global(const Global&) = delete; void operator=(const Global&) = delete; @@ -826,43 +826,165 @@ template using UniquePersistent = Global; /** - * Trait specifying behavior of |TracedGlobal|. + * Deprecated. Use |TracedReference| instead. */ template -struct TracedGlobalTrait { +struct TracedGlobalTrait {}; + +class TracedReferenceBase { + public: /** - * Specifies whether |TracedGlobal| should clear its handle on destruction. - * - * V8 will *not* clear the embedder-side memory of the handle. The embedder is - * expected to report all |TracedGlobal| handles through - * |EmbedderHeapTracer| upon garabge collection. - * - * See |EmbedderHeapTracer::IsRootForNonTracingGC| for handling with - * non-tracing GCs in V8. + * Returns true if the reference is empty, i.e., has not been assigned + * object. + */ + bool IsEmpty() const { return val_ == nullptr; } + + /** + * If non-empty, destroy the underlying storage cell. |IsEmpty| will return + * true after this call. + */ + V8_INLINE void Reset(); + + /** + * Construct a Local from this handle. + */ + V8_INLINE v8::Local Get(v8::Isolate* isolate) const; + + /** + * Returns true if this TracedReference is empty, i.e., has not been + * assigned an object. This version of IsEmpty is thread-safe. + */ + bool IsEmptyThreadSafe() const { + return this->GetSlotThreadSafe() == nullptr; + } + + /** + * Assigns a wrapper class ID to the handle. + */ + V8_INLINE void SetWrapperClassId(uint16_t class_id); + + /** + * Returns the class ID previously assigned to this handle or 0 if no class ID + * was previously assigned. */ - static constexpr bool kRequiresExplicitDestruction = true; + V8_INLINE uint16_t WrapperClassId() const; + + protected: + /** + * Update this reference in a thread-safe way. + */ + void SetSlotThreadSafe(void* new_val) { + reinterpret_cast*>(&val_)->store( + new_val, std::memory_order_relaxed); + } + + /** + * Get this reference in a thread-safe way + */ + const void* GetSlotThreadSafe() const { + return reinterpret_cast const*>(&val_)->load( + std::memory_order_relaxed); + } + + V8_EXPORT void CheckValue() const; + + // val_ points to a GlobalHandles node. + internal::Address* val_ = nullptr; + + friend class internal::BasicTracedReferenceExtractor; + template + friend class Local; + template + friend bool operator==(const TracedReferenceBase&, const Local&); + friend bool operator==(const TracedReferenceBase&, + const TracedReferenceBase&); }; /** * A traced handle with copy and move semantics. The handle is to be used - * together with |v8::EmbedderHeapTracer| and specifies edges from the embedder - * into V8's heap. + * together with |v8::EmbedderHeapTracer| or as part of GarbageCollected objects + * (see v8-cppgc.h) and specifies edges from C++ objects to JavaScript. * * The exact semantics are: - * - Tracing garbage collections use |v8::EmbedderHeapTracer|. + * - Tracing garbage collections use |v8::EmbedderHeapTracer| or cppgc. * - Non-tracing garbage collections refer to - * |v8::EmbedderHeapTracer::IsRootForNonTracingGC()| whether the handle should - * be treated as root or not. + * |v8::EmbedderRootsHandler::IsRoot()| whether the handle should + * be treated as root or not. * - * For destruction semantics see |TracedGlobalTrait|. + * Note that the base class cannot be instantiated itself. Choose from + * - TracedGlobal + * - TracedReference */ template -class TracedGlobal { +class BasicTracedReference : public TracedReferenceBase { public: + /** + * Construct a Local from this handle. + */ + Local Get(Isolate* isolate) const { return Local::New(isolate, *this); } + + template + V8_INLINE BasicTracedReference& As() const { + return reinterpret_cast&>( + const_cast&>(*this)); + } + + T* operator->() const { +#ifdef V8_ENABLE_CHECKS + CheckValue(); +#endif // V8_ENABLE_CHECKS + return reinterpret_cast(val_); + } + T* operator*() const { +#ifdef V8_ENABLE_CHECKS + CheckValue(); +#endif // V8_ENABLE_CHECKS + return reinterpret_cast(val_); + } + + private: + enum DestructionMode { kWithDestructor, kWithoutDestructor }; + + /** + * An empty BasicTracedReference without storage cell. + */ + BasicTracedReference() = default; + + V8_INLINE static internal::Address* New(Isolate* isolate, T* that, void* slot, + DestructionMode destruction_mode); + + friend class EmbedderHeapTracer; + template + friend class Local; + friend class Object; + template + friend class TracedGlobal; + template + friend class TracedReference; + template + friend class BasicTracedReference; + template + friend class ReturnValue; +}; + +/** + * A traced handle with destructor that clears the handle. For more details see + * BasicTracedReference. + */ +template +class TracedGlobal : public BasicTracedReference { + public: + using BasicTracedReference::Reset; + + /** + * Destructor resetting the handle.Is + */ + ~TracedGlobal() { this->Reset(); } + /** * An empty TracedGlobal without storage cell. */ - TracedGlobal() = default; + TracedGlobal() : BasicTracedReference() {} /** * Construct a TracedGlobal from a Local. @@ -871,9 +993,10 @@ class TracedGlobal { * pointing to the same object. */ template - TracedGlobal(Isolate* isolate, Local that) - : val_(New(isolate, *that, &val_)) { - TYPE_CHECK(T, S); + TracedGlobal(Isolate* isolate, Local that) : BasicTracedReference() { + this->val_ = this->New(isolate, that.val_, &this->val_, + BasicTracedReference::kWithDestructor); + static_assert(std::is_base_of::value, "type check"); } /** @@ -938,18 +1061,6 @@ class TracedGlobal { template V8_INLINE TracedGlobal& operator=(const TracedGlobal& rhs); - /** - * Returns true if this TracedGlobal is empty, i.e., has not been assigned an - * object. - */ - bool IsEmpty() const { return val_ == nullptr; } - - /** - * If non-empty, destroy the underlying storage cell. |IsEmpty| will return - * true after this call. - */ - V8_INLINE void Reset(); - /** * If non-empty, destroy the underlying storage cell and create a new one with * the contents of other if other is non empty @@ -957,103 +1068,132 @@ class TracedGlobal { template V8_INLINE void Reset(Isolate* isolate, const Local& other); - /** - * Construct a Local from this handle. - */ - Local Get(Isolate* isolate) const { return Local::New(isolate, *this); } - template V8_INLINE TracedGlobal& As() const { return reinterpret_cast&>( const_cast&>(*this)); } - template - V8_INLINE bool operator==(const TracedGlobal& that) const { - internal::Address* a = reinterpret_cast(**this); - internal::Address* b = reinterpret_cast(*that); - if (a == nullptr) return b == nullptr; - if (b == nullptr) return false; - return *a == *b; - } + /** + * Adds a finalization callback to the handle. The type of this callback is + * similar to WeakCallbackType::kInternalFields, i.e., it will pass the + * parameter and the first two internal fields of the object. + * + * The callback is then supposed to reset the handle in the callback. No + * further V8 API may be called in this callback. In case additional work + * involving V8 needs to be done, a second callback can be scheduled using + * WeakCallbackInfo::SetSecondPassCallback. + */ + V8_INLINE void SetFinalizationCallback( + void* parameter, WeakCallbackInfo::Callback callback); +}; +/** + * A traced handle without destructor that clears the handle. The embedder needs + * to ensure that the handle is not accessed once the V8 object has been + * reclaimed. This can happen when the handle is not passed through the + * EmbedderHeapTracer. For more details see BasicTracedReference. + * + * The reference assumes the embedder has precise knowledge about references at + * all times. In case V8 needs to separately handle on-stack references, the + * embedder is required to set the stack start through + * |EmbedderHeapTracer::SetStackStart|. + */ +template +class TracedReference : public BasicTracedReference { + public: + using BasicTracedReference::Reset; + + /** + * An empty TracedReference without storage cell. + */ + TracedReference() : BasicTracedReference() {} + + /** + * Construct a TracedReference from a Local. + * + * When the Local is non-empty, a new storage cell is created + * pointing to the same object. + */ template - V8_INLINE bool operator==(const Local& that) const { - internal::Address* a = reinterpret_cast(**this); - internal::Address* b = reinterpret_cast(*that); - if (a == nullptr) return b == nullptr; - if (b == nullptr) return false; - return *a == *b; + TracedReference(Isolate* isolate, Local that) : BasicTracedReference() { + this->val_ = this->New(isolate, that.val_, &this->val_, + BasicTracedReference::kWithoutDestructor); + static_assert(std::is_base_of::value, "type check"); } - template - V8_INLINE bool operator!=(const TracedGlobal& that) const { - return !operator==(that); + /** + * Move constructor initializing TracedReference from an + * existing one. + */ + V8_INLINE TracedReference(TracedReference&& other) { + // Forward to operator=. + *this = std::move(other); } - template - V8_INLINE bool operator!=(const Local& that) const { - return !operator==(that); + /** + * Move constructor initializing TracedReference from an + * existing one. + */ + template + V8_INLINE TracedReference(TracedReference&& other) { + // Forward to operator=. + *this = std::move(other); } /** - * Assigns a wrapper class ID to the handle. + * Copy constructor initializing TracedReference from an + * existing one. */ - V8_INLINE void SetWrapperClassId(uint16_t class_id); + V8_INLINE TracedReference(const TracedReference& other) { + // Forward to operator=; + *this = other; + } /** - * Returns the class ID previously assigned to this handle or 0 if no class ID - * was previously assigned. + * Copy constructor initializing TracedReference from an + * existing one. */ - V8_INLINE uint16_t WrapperClassId() const; + template + V8_INLINE TracedReference(const TracedReference& other) { + // Forward to operator=; + *this = other; + } /** - * Adds a finalization callback to the handle. The type of this callback is - * similar to WeakCallbackType::kInternalFields, i.e., it will pass the - * parameter and the first two internal fields of the object. - * - * The callback is then supposed to reset the handle in the callback. No - * further V8 API may be called in this callback. In case additional work - * involving V8 needs to be done, a second callback can be scheduled using - * WeakCallbackInfo::SetSecondPassCallback. + * Move assignment operator initializing TracedGlobal from an existing one. */ - V8_INLINE void SetFinalizationCallback( - void* parameter, WeakCallbackInfo::Callback callback); + V8_INLINE TracedReference& operator=(TracedReference&& rhs); - private: - // Wrapping type used when clearing on destruction is required. - struct WrappedForDestruction { - T* value; - - explicit WrappedForDestruction(T* val) : value(val) {} - ~WrappedForDestruction(); - operator T*() const { return value; } - T* operator*() const { return value; } - T* operator->() const { return value; } - WrappedForDestruction& operator=(const WrappedForDestruction& other) { - value = other.value; - return *this; - } - WrappedForDestruction& operator=(T* val) { - value = val; - return *this; - } - }; + /** + * Move assignment operator initializing TracedGlobal from an existing one. + */ + template + V8_INLINE TracedReference& operator=(TracedReference&& rhs); - V8_INLINE static T* New(Isolate* isolate, T* that, void* slot); + /** + * Copy assignment operator initializing TracedGlobal from an existing one. + */ + V8_INLINE TracedReference& operator=(const TracedReference& rhs); - T* operator*() const { return this->val_; } + /** + * Copy assignment operator initializing TracedGlobal from an existing one. + */ + template + V8_INLINE TracedReference& operator=(const TracedReference& rhs); - typename std::conditional< - TracedGlobalTrait>::kRequiresExplicitDestruction, - WrappedForDestruction, T*>::type val_{nullptr}; + /** + * If non-empty, destroy the underlying storage cell and create a new one with + * the contents of other if other is non empty + */ + template + V8_INLINE void Reset(Isolate* isolate, const Local& other); - friend class EmbedderHeapTracer; - template - friend class Local; - friend class Object; - template - friend class ReturnValue; + template + V8_INLINE TracedReference& As() const { + return reinterpret_cast&>( + const_cast&>(*this)); + } }; /** @@ -1070,7 +1210,7 @@ class TracedGlobal { * handle and may deallocate it. The behavior of accessing a handle * for which the handle scope has been deleted is undefined. */ -class V8_EXPORT HandleScope { +class V8_EXPORT V8_NODISCARD HandleScope { public: explicit HandleScope(Isolate* isolate); @@ -1117,12 +1257,11 @@ class V8_EXPORT HandleScope { friend class Context; }; - /** * A HandleScope which first allocates a handle in the current scope * which will be later filled with the escape value. */ -class V8_EXPORT EscapableHandleScope : public HandleScope { +class V8_EXPORT V8_NODISCARD EscapableHandleScope : public HandleScope { public: explicit EscapableHandleScope(Isolate* isolate); V8_INLINE ~EscapableHandleScope() = default; @@ -1163,7 +1302,7 @@ class V8_EXPORT EscapableHandleScope : public HandleScope { * are allowed. It can be useful for debugging handle leaks. * Handles can be allocated within inner normal HandleScopes. */ -class V8_EXPORT SealHandleScope { +class V8_EXPORT V8_NODISCARD SealHandleScope { public: explicit SealHandleScope(Isolate* isolate); ~SealHandleScope(); @@ -1184,14 +1323,43 @@ class V8_EXPORT SealHandleScope { int prev_sealed_level_; }; - // --- Special objects --- - /** - * The superclass of values and API object templates. + * The superclass of objects that can reside on V8's heap. */ class V8_EXPORT Data { + public: + /** + * Returns true if this data is a |v8::Value|. + */ + bool IsValue() const; + + /** + * Returns true if this data is a |v8::Module|. + */ + bool IsModule() const; + + /** + * Returns true if this data is a |v8::Private|. + */ + bool IsPrivate() const; + + /** + * Returns true if this data is a |v8::ObjectTemplate|. + */ + bool IsObjectTemplate() const; + + /** + * Returns true if this data is a |v8::FunctionTemplate|. + */ + bool IsFunctionTemplate() const; + + /** + * Returns true if this data is a |v8::Context|. + */ + bool IsContext() const; + private: Data(); }; @@ -1272,10 +1440,12 @@ class ScriptOriginOptions { */ class ScriptOrigin { public: - V8_INLINE ScriptOrigin( - Local resource_name, - Local resource_line_offset = Local(), - Local resource_column_offset = Local(), +#if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */ + V8_DEPRECATED("Use constructor with primitive C++ types") +#endif + V8_INLINE explicit ScriptOrigin( + Local resource_name, Local resource_line_offset, + Local resource_column_offset, Local resource_is_shared_cross_origin = Local(), Local script_id = Local(), Local source_map_url = Local(), @@ -1283,21 +1453,47 @@ class ScriptOrigin { Local is_wasm = Local(), Local is_module = Local(), Local host_defined_options = Local()); +#if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */ + V8_DEPRECATED("Use constructor that takes an isolate") +#endif + V8_INLINE explicit ScriptOrigin( + Local resource_name, int resource_line_offset = 0, + int resource_column_offset = 0, + bool resource_is_shared_cross_origin = false, int script_id = -1, + Local source_map_url = Local(), + bool resource_is_opaque = false, bool is_wasm = false, + bool is_module = false, + Local host_defined_options = Local()); + V8_INLINE explicit ScriptOrigin( + Isolate* isolate, Local resource_name, + int resource_line_offset = 0, int resource_column_offset = 0, + bool resource_is_shared_cross_origin = false, int script_id = -1, + Local source_map_url = Local(), + bool resource_is_opaque = false, bool is_wasm = false, + bool is_module = false, + Local host_defined_options = Local()); V8_INLINE Local ResourceName() const; + V8_DEPRECATED("Use getter with primitvie C++ types.") V8_INLINE Local ResourceLineOffset() const; + V8_DEPRECATED("Use getter with primitvie C++ types.") V8_INLINE Local ResourceColumnOffset() const; + V8_DEPRECATED("Use getter with primitvie C++ types.") V8_INLINE Local ScriptID() const; + V8_INLINE int LineOffset() const; + V8_INLINE int ColumnOffset() const; + V8_INLINE int ScriptId() const; V8_INLINE Local SourceMapUrl() const; V8_INLINE Local HostDefinedOptions() const; V8_INLINE ScriptOriginOptions Options() const { return options_; } private: + Isolate* isolate_; Local resource_name_; - Local resource_line_offset_; - Local resource_column_offset_; + int resource_line_offset_; + int resource_column_offset_; ScriptOriginOptions options_; - Local script_id_; + int script_id_; Local source_map_url_; Local host_defined_options_; }; @@ -1336,7 +1532,7 @@ class V8_EXPORT UnboundScript { /** * A compiled JavaScript module, not yet tied to a Context. */ -class V8_EXPORT UnboundModuleScript { +class V8_EXPORT UnboundModuleScript : public Data { // Only used as a container for code caching. }; @@ -1356,10 +1552,54 @@ class V8_EXPORT Location { int column_number_; }; +/** + * A fixed-sized array with elements of type Data. + */ +class V8_EXPORT FixedArray : public Data { + public: + int Length() const; + Local Get(Local context, int i) const; +}; + +class V8_EXPORT ModuleRequest : public Data { + public: + /** + * Returns the module specifier for this ModuleRequest. + */ + Local GetSpecifier() const; + + /** + * Returns the source code offset of this module request. + * Use Module::SourceOffsetToLocation to convert this to line/column numbers. + */ + int GetSourceOffset() const; + + /** + * Contains the import assertions for this request in the form: + * [key1, value1, source_offset1, key2, value2, source_offset2, ...]. + * The keys and values are of type v8::String, and the source offsets are of + * type Int32. Use Module::SourceOffsetToLocation to convert the source + * offsets to Locations with line/column numbers. + * + * All assertions present in the module request will be supplied in this + * list, regardless of whether they are supported by the host. Per + * https://tc39.es/proposal-import-assertions/#sec-hostgetsupportedimportassertions, + * hosts are expected to ignore assertions that they do not support (as + * opposed to, for example, triggering an error if an unsupported assertion is + * present). + */ + Local GetImportAssertions() const; + + V8_INLINE static ModuleRequest* Cast(Data* data); + + private: + static void CheckCast(Data* obj); +}; + /** * A compiled JavaScript module. */ -class V8_EXPORT Module { +class V8_EXPORT Module : public Data { public: /** * The different states a module can be in. @@ -1390,28 +1630,48 @@ class V8_EXPORT Module { /** * Returns the number of modules requested by this module. */ + V8_DEPRECATED("Use Module::GetModuleRequests() and FixedArray::Length().") int GetModuleRequestsLength() const; /** * Returns the ith module specifier in this module. * i must be < GetModuleRequestsLength() and >= 0. */ + V8_DEPRECATED( + "Use Module::GetModuleRequests() and ModuleRequest::GetSpecifier().") Local GetModuleRequest(int i) const; /** * Returns the source location (line number and column number) of the ith * module specifier's first occurrence in this module. */ + V8_DEPRECATED( + "Use Module::GetModuleRequests(), ModuleRequest::GetSourceOffset(), and " + "Module::SourceOffsetToLocation().") Location GetModuleRequestLocation(int i) const; + /** + * Returns the ModuleRequests for this module. + */ + Local GetModuleRequests() const; + + /** + * For the given source text offset in this module, returns the corresponding + * Location with line and column numbers. + */ + Location SourceOffsetToLocation(int offset) const; + /** * Returns the identity hash for this object. */ int GetIdentityHash() const; - typedef MaybeLocal (*ResolveCallback)(Local context, - Local specifier, - Local referrer); + using ResolveCallback = + MaybeLocal (*)(Local context, Local specifier, + Local referrer); + using ResolveModuleCallback = MaybeLocal (*)( + Local context, Local specifier, + Local import_assertions, Local referrer); /** * Instantiates the module and its dependencies. @@ -1420,16 +1680,23 @@ class V8_EXPORT Module { * instantiation. (In the case where the callback throws an exception, that * exception is propagated.) */ + V8_DEPRECATED( + "Use the version of InstantiateModule that takes a ResolveModuleCallback " + "parameter") V8_WARN_UNUSED_RESULT Maybe InstantiateModule(Local context, ResolveCallback callback); + V8_WARN_UNUSED_RESULT Maybe InstantiateModule( + Local context, ResolveModuleCallback callback); /** * Evaluates the module and its dependencies. * - * If status is kInstantiated, run the module's code. On success, set status - * to kEvaluated and return the completion value; on failure, set status to - * kErrored and propagate the thrown exception (which is then also available - * via |GetException|). + * If status is kInstantiated, run the module's code and return a Promise + * object. On success, set status to kEvaluated and resolve the Promise with + * the completion value; on failure, set status to kErrored and reject the + * Promise with the error. + * + * If IsGraphAsync() is false, the returned Promise is settled. */ V8_WARN_UNUSED_RESULT MaybeLocal Evaluate(Local context); @@ -1448,15 +1715,40 @@ class V8_EXPORT Module { */ Local GetUnboundModuleScript(); + /** + * Returns the underlying script's id. + * + * The module must be a SourceTextModule and must not have a kErrored status. + */ + int ScriptId(); + + /** + * Returns whether this module or any of its requested modules is async, + * i.e. contains top-level await. + * + * The module's status must be at least kInstantiated. + */ + bool IsGraphAsync() const; + + /** + * Returns whether the module is a SourceTextModule. + */ + bool IsSourceTextModule() const; + + /** + * Returns whether the module is a SyntheticModule. + */ + bool IsSyntheticModule() const; + /* * Callback defined in the embedder. This is responsible for setting * the module's exported values with calls to SetSyntheticModuleExport(). - * The callback must return a Value to indicate success (where no + * The callback must return a resolved Promise to indicate success (where no * exception was thrown) and return an empy MaybeLocal to indicate falure * (where an exception was thrown). */ - typedef MaybeLocal (*SyntheticModuleEvaluationSteps)( - Local context, Local module); + using SyntheticModuleEvaluationSteps = + MaybeLocal (*)(Local context, Local module); /** * Creates a new SyntheticModule with the specified export names, where @@ -1479,13 +1771,18 @@ class V8_EXPORT Module { */ V8_WARN_UNUSED_RESULT Maybe SetSyntheticModuleExport( Isolate* isolate, Local export_name, Local export_value); - V8_DEPRECATE_SOON( + V8_DEPRECATED( "Use the preceding SetSyntheticModuleExport with an Isolate parameter, " "instead of the one that follows. The former will throw a runtime " "error if called for an export that doesn't exist (as per spec); " - "the latter will crash with a failed CHECK().", - void SetSyntheticModuleExport(Local export_name, - Local export_value)); + "the latter will crash with a failed CHECK().") + void SetSyntheticModuleExport(Local export_name, + Local export_value); + + V8_INLINE static Module* Cast(Data* data); + + private: + static void CheckCast(Data* obj); }; /** @@ -1514,6 +1811,7 @@ class V8_EXPORT Script { Local GetUnboundScript(); }; +enum class ScriptType { kClassic, kModule }; /** * For compiling scripts. @@ -1566,8 +1864,8 @@ class V8_EXPORT ScriptCompiler { // Source takes ownership of CachedData. V8_INLINE Source(Local source_string, const ScriptOrigin& origin, CachedData* cached_data = nullptr); - V8_INLINE Source(Local source_string, - CachedData* cached_data = nullptr); + V8_INLINE explicit Source(Local source_string, + CachedData* cached_data = nullptr); V8_INLINE ~Source(); // Ownership of the CachedData or its buffers is *not* transferred to the @@ -1588,8 +1886,8 @@ class V8_EXPORT ScriptCompiler { // Origin information Local resource_name; - Local resource_line_offset; - Local resource_column_offset; + int resource_line_offset; + int resource_column_offset; ScriptOriginOptions resource_options; Local source_map_url; Local host_defined_options; @@ -1657,12 +1955,14 @@ class V8_EXPORT ScriptCompiler { */ class V8_EXPORT StreamedSource { public: - enum Encoding { ONE_BYTE, TWO_BYTE, UTF8 }; + enum Encoding { ONE_BYTE, TWO_BYTE, UTF8, WINDOWS_1252 }; - V8_DEPRECATE_SOON( +#if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */ + V8_DEPRECATED( "This class takes ownership of source_stream, so use the constructor " - "taking a unique_ptr to make these semantics clearer", - StreamedSource(ExternalSourceStream* source_stream, Encoding encoding)); + "taking a unique_ptr to make these semantics clearer") +#endif + StreamedSource(ExternalSourceStream* source_stream, Encoding encoding); StreamedSource(std::unique_ptr source_stream, Encoding encoding); ~StreamedSource(); @@ -1679,7 +1979,7 @@ class V8_EXPORT ScriptCompiler { /** * A streaming task which the embedder must run on a background thread to - * stream scripts into V8. Returned by ScriptCompiler::StartStreamingScript. + * stream scripts into V8. Returned by ScriptCompiler::StartStreaming. */ class V8_EXPORT ScriptStreamingTask final { public: @@ -1728,7 +2028,8 @@ class V8_EXPORT ScriptCompiler { * * Note that when producing cached data, the source must point to NULL for * cached data. When consuming cached data, the cached data must have been - * produced by the same version of V8. + * produced by the same version of V8, and the embedder needs to ensure the + * cached data is the correct one for the given script. * * \param source Script source code. * \return Compiled script object (context independent; for running it must be @@ -1766,9 +2067,13 @@ class V8_EXPORT ScriptCompiler { * This API allows to start the streaming with as little data as possible, and * the remaining data (for example, the ScriptOrigin) is passed to Compile. */ + V8_DEPRECATED("Use ScriptCompiler::StartStreaming instead.") static ScriptStreamingTask* StartStreamingScript( Isolate* isolate, StreamedSource* source, CompileOptions options = kNoCompileOptions); + static ScriptStreamingTask* StartStreaming( + Isolate* isolate, StreamedSource* source, + ScriptType type = ScriptType::kClassic); /** * Compiles a streamed script (bound to current context). @@ -1813,6 +2118,17 @@ class V8_EXPORT ScriptCompiler { CompileOptions options = kNoCompileOptions, NoCacheReason no_cache_reason = kNoCacheNoReason); + /** + * Compiles a streamed module script. + * + * This can only be called after the streaming has finished + * (ScriptStreamingTask has been run). V8 doesn't construct the source string + * during streaming, so the embedder needs to pass the full source here. + */ + static V8_WARN_UNUSED_RESULT MaybeLocal CompileModule( + Local context, StreamedSource* v8_source, + Local full_source_string, const ScriptOrigin& origin); + /** * Compile a function for a given context. This is equivalent to running * @@ -1828,14 +2144,8 @@ class V8_EXPORT ScriptCompiler { Local arguments[], size_t context_extension_count, Local context_extensions[], CompileOptions options = kNoCompileOptions, - NoCacheReason no_cache_reason = kNoCacheNoReason); - - static V8_WARN_UNUSED_RESULT MaybeLocal CompileFunctionInContext( - Local context, Source* source, size_t arguments_count, - Local arguments[], size_t context_extension_count, - Local context_extensions[], CompileOptions options, - NoCacheReason no_cache_reason, - Local* script_or_module_out); + NoCacheReason no_cache_reason = kNoCacheNoReason, + Local* script_or_module_out = nullptr); /** * Creates and returns code cache for the specified unbound_script. @@ -1879,6 +2189,8 @@ class V8_EXPORT Message { */ Isolate* GetIsolate() const; + V8_WARN_UNUSED_RESULT MaybeLocal GetSource( + Local context) const; V8_WARN_UNUSED_RESULT MaybeLocal GetSourceLine( Local context) const; @@ -1918,6 +2230,12 @@ class V8_EXPORT Message { */ int GetEndPosition() const; + /** + * Returns the Wasm function index where the error occurred. Returns -1 if + * message is not from a Wasm script. + */ + int GetWasmFunctionIndex() const; + /** * Returns the error level of the message. */ @@ -1950,6 +2268,7 @@ class V8_EXPORT Message { static const int kNoLineNumberInfo = 0; static const int kNoColumnInfo = 0; static const int kNoScriptIdInfo = 0; + static const int kNoWasmFunctionIndexInfo = -1; }; @@ -2046,6 +2365,17 @@ class V8_EXPORT StackFrame { */ Local GetScriptNameOrSourceURL() const; + /** + * Returns the source of the script for the function for this StackFrame. + */ + Local GetScriptSource() const; + + /** + * Returns the source mapping URL (if one is present) of the script for + * the function for this StackFrame. + */ + Local GetScriptSourceMappingURL() const; + /** * Returns the name of the function associated with this stack frame. */ @@ -2084,17 +2414,29 @@ enum StateTag { COMPILER, OTHER, EXTERNAL, + ATOMICS_WAIT, IDLE }; +// Holds the callee saved registers needed for the stack unwinder. It is the +// empty struct if no registers are required. Implemented in +// include/v8-unwinder-state.h. +struct CalleeSavedRegisters; + // A RegisterState represents the current state of registers used // by the sampling profiler API. -struct RegisterState { - RegisterState() : pc(nullptr), sp(nullptr), fp(nullptr), lr(nullptr) {} +struct V8_EXPORT RegisterState { + RegisterState(); + ~RegisterState(); + RegisterState(const RegisterState& other); + RegisterState& operator=(const RegisterState& other); + void* pc; // Instruction pointer. void* sp; // Stack pointer. void* fp; // Frame pointer. void* lr; // Link register (or nullptr on platforms without a link register). + // Callee saved registers (or null if no callee saved registers were stored) + std::unique_ptr callee_saved; }; // The output structure filled up by GetStackSample API function. @@ -2103,6 +2445,7 @@ struct SampleInfo { StateTag vm_state; // Current VM state. void* external_callback_entry; // External callback address if VM is // executing an external callback. + void* top_context; // Incumbent native context address. }; struct MemoryRange { @@ -2114,10 +2457,10 @@ struct JSEntryStub { MemoryRange code; }; -struct UnwindState { - MemoryRange code_range; - MemoryRange embedded_code_range; +struct JSEntryStubs { JSEntryStub js_entry_stub; + JSEntryStub js_construct_entry_stub; + JSEntryStub js_run_microtasks_entry_stub; }; /** @@ -2340,11 +2683,6 @@ class V8_EXPORT ValueDeserializer { */ void SetSupportsLegacyWireFormat(bool supports_legacy_wire_format); - /** - * Expect inline wasm in the data stream (rather than in-memory transfer) - */ - void SetExpectInlineWasm(bool allow_inline_wasm); - /** * Reads the underlying wire format version. Likely mostly to be useful to * legacy code reading old wire format versions. Must be called after @@ -2382,12 +2720,16 @@ class V8_EXPORT Value : public Data { /** * Returns true if this value is the undefined value. See ECMA-262 * 4.3.10. + * + * This is equivalent to `value === undefined` in JS. */ V8_INLINE bool IsUndefined() const; /** * Returns true if this value is the null value. See ECMA-262 * 4.3.11. + * + * This is equivalent to `value === null` in JS. */ V8_INLINE bool IsNull() const; @@ -2395,37 +2737,56 @@ class V8_EXPORT Value : public Data { * Returns true if this value is either the null or the undefined value. * See ECMA-262 * 4.3.11. and 4.3.12 + * + * This is equivalent to `value == null` in JS. */ V8_INLINE bool IsNullOrUndefined() const; /** - * Returns true if this value is true. - */ + * Returns true if this value is true. + * + * This is not the same as `BooleanValue()`. The latter performs a + * conversion to boolean, i.e. the result of `Boolean(value)` in JS, whereas + * this checks `value === true`. + */ bool IsTrue() const; /** * Returns true if this value is false. + * + * This is not the same as `!BooleanValue()`. The latter performs a + * conversion to boolean, i.e. the result of `!Boolean(value)` in JS, whereas + * this checks `value === false`. */ bool IsFalse() const; /** * Returns true if this value is a symbol or a string. + * + * This is equivalent to + * `typeof value === 'string' || typeof value === 'symbol'` in JS. */ bool IsName() const; /** * Returns true if this value is an instance of the String type. * See ECMA-262 8.4. + * + * This is equivalent to `typeof value === 'string'` in JS. */ V8_INLINE bool IsString() const; /** * Returns true if this value is a symbol. + * + * This is equivalent to `typeof value === 'symbol'` in JS. */ bool IsSymbol() const; /** * Returns true if this value is a function. + * + * This is equivalent to `typeof value === 'function'` in JS. */ bool IsFunction() const; @@ -2442,21 +2803,27 @@ class V8_EXPORT Value : public Data { /** * Returns true if this value is a bigint. + * + * This is equivalent to `typeof value === 'bigint'` in JS. */ bool IsBigInt() const; /** * Returns true if this value is boolean. + * + * This is equivalent to `typeof value === 'boolean'` in JS. */ bool IsBoolean() const; /** * Returns true if this value is a number. + * + * This is equivalent to `typeof value === 'number'` in JS. */ bool IsNumber() const; /** - * Returns true if this value is external. + * Returns true if this value is an `External` object. */ bool IsExternal() const; @@ -2642,7 +3009,6 @@ class V8_EXPORT Value : public Data { /** * Returns true if this value is a SharedArrayBuffer. - * This is an experimental feature. */ bool IsSharedArrayBuffer() const; @@ -2651,43 +3017,73 @@ class V8_EXPORT Value : public Data { */ bool IsProxy() const; - bool IsWebAssemblyCompiledModule() const; + /** + * Returns true if this value is a WasmMemoryObject. + */ + bool IsWasmMemoryObject() const; + + /** + * Returns true if this value is a WasmModuleObject. + */ + bool IsWasmModuleObject() const; /** * Returns true if the value is a Module Namespace Object. */ bool IsModuleNamespaceObject() const; + /** + * Perform the equivalent of `BigInt(value)` in JS. + */ V8_WARN_UNUSED_RESULT MaybeLocal ToBigInt( Local context) const; - V8_DEPRECATED("ToBoolean can never throw. Use Local version.", - V8_WARN_UNUSED_RESULT MaybeLocal ToBoolean( - Local context) const); + /** + * Perform the equivalent of `Number(value)` in JS. + */ V8_WARN_UNUSED_RESULT MaybeLocal ToNumber( Local context) const; + /** + * Perform the equivalent of `String(value)` in JS. + */ V8_WARN_UNUSED_RESULT MaybeLocal ToString( Local context) const; + /** + * Provide a string representation of this value usable for debugging. + * This operation has no observable side effects and will succeed + * unless e.g. execution is being terminated. + */ V8_WARN_UNUSED_RESULT MaybeLocal ToDetailString( Local context) const; + /** + * Perform the equivalent of `Object(value)` in JS. + */ V8_WARN_UNUSED_RESULT MaybeLocal ToObject( Local context) const; + /** + * Perform the equivalent of `Number(value)` in JS and convert the result + * to an integer. Negative values are rounded up, positive values are rounded + * down. NaN is converted to 0. Infinite values yield undefined results. + */ V8_WARN_UNUSED_RESULT MaybeLocal ToInteger( Local context) const; + /** + * Perform the equivalent of `Number(value)` in JS and convert the result + * to an unsigned 32-bit integer by performing the steps in + * https://tc39.es/ecma262/#sec-touint32. + */ V8_WARN_UNUSED_RESULT MaybeLocal ToUint32( Local context) const; + /** + * Perform the equivalent of `Number(value)` in JS and convert the result + * to a signed 32-bit integer by performing the steps in + * https://tc39.es/ecma262/#sec-toint32. + */ V8_WARN_UNUSED_RESULT MaybeLocal ToInt32(Local context) const; + /** + * Perform the equivalent of `Boolean(value)` in JS. This can never fail. + */ Local ToBoolean(Isolate* isolate) const; - V8_DEPRECATED("Use maybe version", - Local ToNumber(Isolate* isolate) const); - V8_DEPRECATED("Use maybe version", - Local ToString(Isolate* isolate) const); - V8_DEPRECATED("Use maybe version", - Local ToObject(Isolate* isolate) const); - V8_DEPRECATED("Use maybe version", - Local ToInteger(Isolate* isolate) const); - V8_DEPRECATED("Use maybe version", - Local ToInt32(Isolate* isolate) const); /** * Attempts to convert a string to an array index. @@ -2696,16 +3092,18 @@ class V8_EXPORT Value : public Data { V8_WARN_UNUSED_RESULT MaybeLocal ToArrayIndex( Local context) const; + /** Returns the equivalent of `ToBoolean()->Value()`. */ bool BooleanValue(Isolate* isolate) const; - V8_DEPRECATED("BooleanValue can never throw. Use Isolate version.", - V8_WARN_UNUSED_RESULT Maybe BooleanValue( - Local context) const); + /** Returns the equivalent of `ToNumber()->Value()`. */ V8_WARN_UNUSED_RESULT Maybe NumberValue(Local context) const; + /** Returns the equivalent of `ToInteger()->Value()`. */ V8_WARN_UNUSED_RESULT Maybe IntegerValue( Local context) const; + /** Returns the equivalent of `ToUint32()->Value()`. */ V8_WARN_UNUSED_RESULT Maybe Uint32Value( Local context) const; + /** Returns the equivalent of `ToInt32()->Value()`. */ V8_WARN_UNUSED_RESULT Maybe Int32Value(Local context) const; /** JS == */ @@ -2728,6 +3126,8 @@ class V8_EXPORT Value : public Data { bool FullIsUndefined() const; bool FullIsNull() const; bool FullIsString() const; + + static void CheckCast(Data* that); }; @@ -2744,11 +3144,11 @@ class V8_EXPORT Primitive : public Value { }; class V8_EXPORT Boolean : public Primitive { public: bool Value() const; - V8_INLINE static Boolean* Cast(v8::Value* obj); + V8_INLINE static Boolean* Cast(v8::Data* data); V8_INLINE static Local New(Isolate* isolate, bool value); private: - static void CheckCast(v8::Value* obj); + static void CheckCast(v8::Data* that); }; @@ -2766,10 +3166,10 @@ class V8_EXPORT Name : public Primitive { */ int GetIdentityHash(); - V8_INLINE static Name* Cast(Value* obj); + V8_INLINE static Name* Cast(Data* data); private: - static void CheckCast(Value* obj); + static void CheckCast(Data* that); }; /** @@ -2797,9 +3197,8 @@ enum class NewStringType { */ class V8_EXPORT String : public Name { public: - static constexpr int kMaxLength = internal::kApiTaggedSize == 4 - ? (1 << 28) - 16 - : internal::kSmiMaxValue / 2 - 24; + static constexpr int kMaxLength = + internal::kApiSystemPointerSize == 4 ? (1 << 28) - 16 : (1 << 29) - 24; enum Encoding { UNKNOWN_ENCODING = 0x1, @@ -2884,16 +3283,21 @@ class V8_EXPORT String : public Name { V8_INLINE static Local Empty(Isolate* isolate); /** - * Returns true if the string is external + * Returns true if the string is external. */ bool IsExternal() const; + /** + * Returns true if the string is both external and two-byte. + */ + bool IsExternalTwoByte() const; + /** * Returns true if the string is both external and one-byte. */ bool IsExternalOneByte() const; - class V8_EXPORT ExternalStringResourceBase { // NOLINT + class V8_EXPORT ExternalStringResourceBase { public: virtual ~ExternalStringResourceBase() = default; @@ -2959,7 +3363,8 @@ class V8_EXPORT String : public Name { ~ExternalStringResource() override = default; /** - * The string data from the underlying buffer. + * The string data from the underlying buffer. If the resource is cacheable + * then data() must return the same value for all invocations. */ virtual const uint16_t* data() const = 0; @@ -2968,8 +3373,29 @@ class V8_EXPORT String : public Name { */ virtual size_t length() const = 0; + /** + * Returns the cached data from the underlying buffer. This method can be + * called only for cacheable resources (i.e. IsCacheable() == true) and only + * after UpdateDataCache() was called. + */ + const uint16_t* cached_data() const { + CheckCachedDataInvariants(); + return cached_data_; + } + + /** + * Update {cached_data_} with the data from the underlying buffer. This can + * be called only for cacheable resources. + */ + void UpdateDataCache(); + protected: ExternalStringResource() = default; + + private: + void CheckCachedDataInvariants() const; + + const uint16_t* cached_data_ = nullptr; }; /** @@ -2990,12 +3416,39 @@ class V8_EXPORT String : public Name { * buffer. */ ~ExternalOneByteStringResource() override = default; - /** The string data from the underlying buffer.*/ + + /** + * The string data from the underlying buffer. If the resource is cacheable + * then data() must return the same value for all invocations. + */ virtual const char* data() const = 0; + /** The number of Latin-1 characters in the string.*/ virtual size_t length() const = 0; + + /** + * Returns the cached data from the underlying buffer. If the resource is + * uncacheable or if UpdateDataCache() was not called before, it has + * undefined behaviour. + */ + const char* cached_data() const { + CheckCachedDataInvariants(); + return cached_data_; + } + + /** + * Update {cached_data_} with the data from the underlying buffer. This can + * be called only for cacheable resources. + */ + void UpdateDataCache(); + protected: ExternalOneByteStringResource() = default; + + private: + void CheckCachedDataInvariants() const; + + const char* cached_data_ = nullptr; }; /** @@ -3018,45 +3471,42 @@ class V8_EXPORT String : public Name { */ const ExternalOneByteStringResource* GetExternalOneByteStringResource() const; - V8_INLINE static String* Cast(v8::Value* obj); - - // TODO(dcarney): remove with deprecation of New functions. - enum NewStringType { - kNormalString = static_cast(v8::NewStringType::kNormal), - kInternalizedString = static_cast(v8::NewStringType::kInternalized) - }; + V8_INLINE static String* Cast(v8::Data* data); - /** Allocates a new string from UTF-8 data.*/ - static V8_DEPRECATED( - "Use maybe version", - Local NewFromUtf8(Isolate* isolate, const char* data, - NewStringType type = kNormalString, - int length = -1)); + /** + * Allocates a new string from a UTF-8 literal. This is equivalent to calling + * String::NewFromUtf(isolate, "...").ToLocalChecked(), but without the check + * overhead. + * + * When called on a string literal containing '\0', the inferred length is the + * length of the input array minus 1 (for the final '\0') and not the value + * returned by strlen. + **/ + template + static V8_WARN_UNUSED_RESULT Local NewFromUtf8Literal( + Isolate* isolate, const char (&literal)[N], + NewStringType type = NewStringType::kNormal) { + static_assert(N <= kMaxLength, "String is too long"); + return NewFromUtf8Literal(isolate, literal, type, N - 1); + } /** Allocates a new string from UTF-8 data. Only returns an empty value when * length > kMaxLength. **/ static V8_WARN_UNUSED_RESULT MaybeLocal NewFromUtf8( - Isolate* isolate, const char* data, v8::NewStringType type, - int length = -1); + Isolate* isolate, const char* data, + NewStringType type = NewStringType::kNormal, int length = -1); /** Allocates a new string from Latin-1 data. Only returns an empty value * when length > kMaxLength. **/ static V8_WARN_UNUSED_RESULT MaybeLocal NewFromOneByte( - Isolate* isolate, const uint8_t* data, v8::NewStringType type, - int length = -1); - - /** Allocates a new string from UTF-16 data.*/ - static V8_DEPRECATED( - "Use maybe version", - Local NewFromTwoByte(Isolate* isolate, const uint16_t* data, - NewStringType type = kNormalString, - int length = -1)); + Isolate* isolate, const uint8_t* data, + NewStringType type = NewStringType::kNormal, int length = -1); /** Allocates a new string from UTF-16 data. Only returns an empty value when * length > kMaxLength. **/ static V8_WARN_UNUSED_RESULT MaybeLocal NewFromTwoByte( - Isolate* isolate, const uint16_t* data, v8::NewStringType type, - int length = -1); + Isolate* isolate, const uint16_t* data, + NewStringType type = NewStringType::kNormal, int length = -1); /** * Creates a new string by concatenating the left and the right strings @@ -3095,10 +3545,6 @@ class V8_EXPORT String : public Name { * should the underlying buffer be deallocated or modified except through the * destructor of the external string resource. */ - static V8_DEPRECATED( - "Use maybe version", - Local NewExternal(Isolate* isolate, - ExternalOneByteStringResource* resource)); static V8_WARN_UNUSED_RESULT MaybeLocal NewExternalOneByte( Isolate* isolate, ExternalOneByteStringResource* resource); @@ -3178,9 +3624,20 @@ class V8_EXPORT String : public Name { ExternalStringResourceBase* GetExternalStringResourceBaseSlow( String::Encoding* encoding_out) const; - static void CheckCast(v8::Value* obj); + static Local NewFromUtf8Literal(Isolate* isolate, + const char* literal, + NewStringType type, int length); + + static void CheckCast(v8::Data* that); }; +// Zero-length string specialization (templated string size includes +// terminator). +template <> +inline V8_WARN_UNUSED_RESULT Local String::NewFromUtf8Literal( + Isolate* isolate, const char (&literal)[1], NewStringType type) { + return String::Empty(isolate); +} /** * A JavaScript symbol (ECMA-262 edition 6) @@ -3188,30 +3645,36 @@ class V8_EXPORT String : public Name { class V8_EXPORT Symbol : public Name { public: /** - * Returns the print name string of the symbol, or undefined if none. + * Returns the description string of the symbol, or undefined if none. */ - Local Name() const; + Local Description() const; + Local Description(Isolate* isolate) const; + + V8_DEPRECATED("Use Symbol::Description()") + Local Name() const { return Description(); } /** - * Create a symbol. If name is not empty, it will be used as the description. + * Create a symbol. If description is not empty, it will be used as the + * description. */ static Local New(Isolate* isolate, - Local name = Local()); + Local description = Local()); /** * Access global symbol registry. * Note that symbols created this way are never collected, so * they should only be used for statically fixed properties. - * Also, there is only one global name space for the names used as keys. + * Also, there is only one global name space for the descriptions used as + * keys. * To minimize the potential for clashes, use qualified names as keys. */ - static Local For(Isolate *isolate, Local name); + static Local For(Isolate* isolate, Local description); /** * Retrieve a global symbol. Similar to |For|, but using a separate * registry that is not accessible by (and cannot clash with) JavaScript code. */ - static Local ForApi(Isolate *isolate, Local name); + static Local ForApi(Isolate* isolate, Local description); // Well-known symbols static Local GetAsyncIterator(Isolate* isolate); @@ -3226,11 +3689,11 @@ class V8_EXPORT Symbol : public Name { static Local GetToStringTag(Isolate* isolate); static Local GetUnscopables(Isolate* isolate); - V8_INLINE static Symbol* Cast(Value* obj); + V8_INLINE static Symbol* Cast(Data* data); private: Symbol(); - static void CheckCast(Value* obj); + static void CheckCast(Data* that); }; @@ -3279,10 +3742,11 @@ class V8_EXPORT Number : public Primitive { public: double Value() const; static Local New(Isolate* isolate, double value); - V8_INLINE static Number* Cast(v8::Value* obj); + V8_INLINE static Number* Cast(v8::Data* data); + private: Number(); - static void CheckCast(v8::Value* obj); + static void CheckCast(v8::Data* that); }; @@ -3294,10 +3758,11 @@ class V8_EXPORT Integer : public Number { static Local New(Isolate* isolate, int32_t value); static Local NewFromUnsigned(Isolate* isolate, uint32_t value); int64_t Value() const; - V8_INLINE static Integer* Cast(v8::Value* obj); + V8_INLINE static Integer* Cast(v8::Data* data); + private: Integer(); - static void CheckCast(v8::Value* obj); + static void CheckCast(v8::Data* that); }; @@ -3307,11 +3772,11 @@ class V8_EXPORT Integer : public Number { class V8_EXPORT Int32 : public Integer { public: int32_t Value() const; - V8_INLINE static Int32* Cast(v8::Value* obj); + V8_INLINE static Int32* Cast(v8::Data* data); private: Int32(); - static void CheckCast(v8::Value* obj); + static void CheckCast(v8::Data* that); }; @@ -3321,11 +3786,11 @@ class V8_EXPORT Int32 : public Integer { class V8_EXPORT Uint32 : public Integer { public: uint32_t Value() const; - V8_INLINE static Uint32* Cast(v8::Value* obj); + V8_INLINE static Uint32* Cast(v8::Data* data); private: Uint32(); - static void CheckCast(v8::Value* obj); + static void CheckCast(v8::Data* that); }; /** @@ -3376,11 +3841,11 @@ class V8_EXPORT BigInt : public Primitive { */ void ToWordsArray(int* sign_bit, int* word_count, uint64_t* words) const; - V8_INLINE static BigInt* Cast(v8::Value* obj); + V8_INLINE static BigInt* Cast(v8::Data* data); private: BigInt(); - static void CheckCast(v8::Value* obj); + static void CheckCast(v8::Data* that); }; /** @@ -3402,23 +3867,17 @@ enum PropertyAttribute { * setting|getting a particular property. See Object and ObjectTemplate's * method SetAccessor. */ -typedef void (*AccessorGetterCallback)( - Local property, - const PropertyCallbackInfo& info); -typedef void (*AccessorNameGetterCallback)( - Local property, - const PropertyCallbackInfo& info); - - -typedef void (*AccessorSetterCallback)( - Local property, - Local value, - const PropertyCallbackInfo& info); -typedef void (*AccessorNameSetterCallback)( - Local property, - Local value, - const PropertyCallbackInfo& info); +using AccessorGetterCallback = + void (*)(Local property, const PropertyCallbackInfo& info); +using AccessorNameGetterCallback = + void (*)(Local property, const PropertyCallbackInfo& info); +using AccessorSetterCallback = void (*)(Local property, + Local value, + const PropertyCallbackInfo& info); +using AccessorNameSetterCallback = + void (*)(Local property, Local value, + const PropertyCallbackInfo& info); /** * Access control specifications. @@ -3450,11 +3909,11 @@ enum PropertyFilter { /** * Options for marking whether callbacks may trigger JS-observable side effects. - * Side-effect-free callbacks are whitelisted during debug evaluation with + * Side-effect-free callbacks are allowlisted during debug evaluation with * throwOnSideEffect. It applies when calling a Function, FunctionTemplate, * or an Accessor callback. For Interceptors, please see * PropertyHandlerFlags's kHasNoSideEffect. - * Callbacks that only cause side effects to the receiver are whitelisted if + * Callbacks that only cause side effects to the receiver are allowlisted if * invoked on receiver objects that are created within the same debug-evaluate * call, as these objects are temporary and the side effect does not escape. */ @@ -3483,7 +3942,7 @@ enum class IndexFilter { kIncludeIndices, kSkipIndices }; * kConvertToString will convert integer indices to strings. * kKeepNumbers will return numbers for integer indices. */ -enum class KeyConversionMode { kConvertToString, kKeepNumbers }; +enum class KeyConversionMode { kConvertToString, kKeepNumbers, kNoNumbers }; /** * Integrity level for objects. @@ -3495,8 +3954,6 @@ enum class IntegrityLevel { kFrozen, kSealed }; */ class V8_EXPORT Object : public Value { public: - V8_DEPRECATED("Use maybe version", - bool Set(Local key, Local value)); /** * Set only return Just(true) or Empty(), so if it should never fail, use * result.Check(). @@ -3504,8 +3961,6 @@ class V8_EXPORT Object : public Value { V8_WARN_UNUSED_RESULT Maybe Set(Local context, Local key, Local value); - V8_DEPRECATED("Use maybe version", - bool Set(uint32_t index, Local value)); V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index, Local value); @@ -3547,14 +4002,11 @@ class V8_EXPORT Object : public Value { // // Returns true on success. V8_WARN_UNUSED_RESULT Maybe DefineProperty( - Local context, Local key, - PropertyDescriptor& descriptor); // NOLINT(runtime/references) + Local context, Local key, PropertyDescriptor& descriptor); - V8_DEPRECATED("Use maybe version", Local Get(Local key)); V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context, Local key); - V8_DEPRECATED("Use maybe version", Local Get(uint32_t index)); V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context, uint32_t index); @@ -3733,9 +4185,10 @@ class V8_EXPORT Object : public Value { return object.val_->InternalFieldCount(); } - /** Same as above, but works for TracedGlobal. */ - V8_INLINE static int InternalFieldCount(const TracedGlobal& object) { - return object.val_->InternalFieldCount(); + /** Same as above, but works for BasicTracedReference. */ + V8_INLINE static int InternalFieldCount( + const BasicTracedReference& object) { + return object->InternalFieldCount(); } /** Gets the value from an internal field. */ @@ -3759,8 +4212,8 @@ class V8_EXPORT Object : public Value { /** Same as above, but works for TracedGlobal. */ V8_INLINE static void* GetAlignedPointerFromInternalField( - const TracedGlobal& object, int index) { - return object.val_->GetAlignedPointerFromInternalField(index); + const BasicTracedReference& object, int index) { + return object->GetAlignedPointerFromInternalField(index); } /** @@ -3858,12 +4311,20 @@ class V8_EXPORT Object : public Value { /** * Returns the context in which the object was created. */ + // TODO(chromium:1166077): Mark as deprecate once users are updated. + V8_DEPRECATE_SOON("Use MaybeLocal GetCreationContext()") Local CreationContext(); + MaybeLocal GetCreationContext(); /** Same as above, but works for Persistents */ - V8_INLINE static Local CreationContext( + // TODO(chromium:1166077): Mark as deprecate once users are updated. + V8_DEPRECATE_SOON( + "Use MaybeLocal GetCreationContext(const " + "PersistentBase& object)") + static Local CreationContext(const PersistentBase& object); + V8_INLINE static MaybeLocal GetCreationContext( const PersistentBase& object) { - return object.val_->CreationContext(); + return object.val_->GetCreationContext(); } /** @@ -3887,6 +4348,13 @@ class V8_EXPORT Object : public Value { */ bool IsApiWrapper(); + /** + * True if this object was created from an object template which was marked + * as undetectable. See v8::ObjectTemplate::MarkAsUndetectable for more + * information. + */ + bool IsUndetectable(); + /** * Call an Object as a function if a callback is set by the * ObjectTemplate::SetCallAsFunctionHandler method. @@ -3936,6 +4404,16 @@ class V8_EXPORT Object : public Value { V8_INLINE static Object* Cast(Value* obj); + /** + * Support for TC39 "dynamic code brand checks" proposal. + * + * This API allows to query whether an object was constructed from a + * "code like" ObjectTemplate. + * + * See also: v8::ObjectTemplate::SetCodeLike + */ + bool IsCodeLike(Isolate* isolate); + private: Object(); static void CheckCast(Value* obj); @@ -3964,6 +4442,7 @@ class V8_EXPORT Array : public Object { static Local New(Isolate* isolate, Local* elements, size_t length); V8_INLINE static Array* Cast(Value* obj); + private: Array(); static void CheckCast(Value* obj); @@ -4043,16 +4522,13 @@ class ReturnValue { public: template V8_INLINE ReturnValue(const ReturnValue& that) : value_(that.value_) { - TYPE_CHECK(T, S); + static_assert(std::is_base_of::value, "type check"); } // Local setters template - V8_INLINE V8_DEPRECATED("Use Global<> instead", - void Set(const Persistent& handle)); - template V8_INLINE void Set(const Global& handle); template - V8_INLINE void Set(const TracedGlobal& handle); + V8_INLINE void Set(const BasicTracedReference& handle); template V8_INLINE void Set(const Local handle); // Fast primitive setters @@ -4100,7 +4576,10 @@ class FunctionCallbackInfo { public: /** The number of available arguments. */ V8_INLINE int Length() const; - /** Accessor for the available arguments. */ + /** + * Accessor for the available arguments. Returns `undefined` if the index + * is out of bounds. + */ V8_INLINE Local operator[](int i) const; /** Returns the receiver. This corresponds to the "this" value. */ V8_INLINE Local This() const; @@ -4258,8 +4737,7 @@ class PropertyCallbackInfo { internal::Address* args_; }; - -typedef void (*FunctionCallback)(const FunctionCallbackInfo& info); +using FunctionCallback = void (*)(const FunctionCallbackInfo& info); enum class ConstructorBehavior { kThrow, kAllow }; @@ -4320,6 +4798,11 @@ class V8_EXPORT Function : public Object { * User-defined name assigned to the "displayName" property of this function. * Used to facilitate debugging and profiling of JavaScript code. */ + V8_DEPRECATED( + "Use v8::Object::Get() instead to look up \"displayName\". " + "V8 and DevTools no longer use \"displayName\" in stack " + "traces, but the standard \"name\" property. " + "See http://crbug.com/1177685.") Local GetDisplayName() const; /** @@ -4344,6 +4827,15 @@ class V8_EXPORT Function : public Object { */ Local GetBoundFunction() const; + /** + * Calls builtin Function.prototype.toString on this function. + * This is different from Value::ToString() that may call a user-defined + * toString() function, and different than Object::ObjectProtoToString() which + * always serializes "[object Function]". + */ + V8_WARN_UNUSED_RESULT MaybeLocal FunctionProtoToString( + Local context); + ScriptOrigin GetScriptOrigin() const; V8_INLINE static Function* Cast(Value* obj); static const int kLineOffsetNotFound; @@ -4437,6 +4929,12 @@ class V8_EXPORT Promise : public Object { */ void MarkAsHandled(); + /** + * Marks this promise as silent to prevent pausing the debugger when the + * promise is rejected. + */ + void MarkAsSilent(); + V8_INLINE static Promise* Cast(Value* obj); static const int kEmbedderFieldCount = V8_PROMISE_INTERNAL_FIELD_COUNT; @@ -4598,56 +5096,46 @@ class V8_EXPORT CompiledWasmModule { */ MemorySpan GetWireBytesRef(); + const std::string& source_url() const { return source_url_; } + private: - explicit CompiledWasmModule(std::shared_ptr); - friend class Utils; + friend class WasmModuleObject; + friend class WasmStreaming; + + explicit CompiledWasmModule(std::shared_ptr, + const char* source_url, size_t url_length); const std::shared_ptr native_module_; + const std::string source_url_; }; -// An instance of WebAssembly.Module. -class V8_EXPORT WasmModuleObject : public Object { +// An instance of WebAssembly.Memory. +class V8_EXPORT WasmMemoryObject : public Object { public: + WasmMemoryObject() = delete; + /** - * An opaque, native heap object for transferring wasm modules. It - * supports move semantics, and does not support copy semantics. - * TODO(wasm): Merge this with CompiledWasmModule once code sharing is always - * enabled. + * Returns underlying ArrayBuffer. */ - class TransferrableModule final { - public: - TransferrableModule(TransferrableModule&& src) = default; - TransferrableModule(const TransferrableModule& src) = delete; + Local Buffer(); - TransferrableModule& operator=(TransferrableModule&& src) = default; - TransferrableModule& operator=(const TransferrableModule& src) = delete; + V8_INLINE static WasmMemoryObject* Cast(Value* obj); - private: - typedef std::shared_ptr SharedModule; - friend class WasmModuleObject; - explicit TransferrableModule(SharedModule shared_module) - : shared_module_(std::move(shared_module)) {} - TransferrableModule(OwnedBuffer serialized, OwnedBuffer bytes) - : serialized_(std::move(serialized)), wire_bytes_(std::move(bytes)) {} - - SharedModule shared_module_; - OwnedBuffer serialized_ = {nullptr, 0}; - OwnedBuffer wire_bytes_ = {nullptr, 0}; - }; + private: + static void CheckCast(Value* object); +}; - /** - * Get an in-memory, non-persistable, and context-independent (meaning, - * suitable for transfer to another Isolate and Context) representation - * of this wasm compiled module. - */ - TransferrableModule GetTransferrableModule(); +// An instance of WebAssembly.Module. +class V8_EXPORT WasmModuleObject : public Object { + public: + WasmModuleObject() = delete; /** * Efficiently re-create a WasmModuleObject, without recompiling, from - * a TransferrableModule. + * a CompiledWasmModule. */ - static MaybeLocal FromTransferrableModule( - Isolate* isolate, const TransferrableModule&); + static MaybeLocal FromCompiledModule( + Isolate* isolate, const CompiledWasmModule&); /** * Get the compiled module for this module object. The compiled module can be @@ -4655,27 +5143,9 @@ class V8_EXPORT WasmModuleObject : public Object { */ CompiledWasmModule GetCompiledModule(); - /** - * If possible, deserialize the module, otherwise compile it from the provided - * uncompiled bytes. - */ - static MaybeLocal DeserializeOrCompile( - Isolate* isolate, MemorySpan serialized_module, - MemorySpan wire_bytes); V8_INLINE static WasmModuleObject* Cast(Value* obj); private: - static MaybeLocal Deserialize( - Isolate* isolate, MemorySpan serialized_module, - MemorySpan wire_bytes); - static MaybeLocal Compile(Isolate* isolate, - const uint8_t* start, - size_t length); - static MemorySpan AsReference(const OwnedBuffer& buff) { - return {buff.buffer.get(), buff.size}; - } - - WasmModuleObject(); static void CheckCast(Value* obj); }; @@ -4741,6 +5211,12 @@ class V8_EXPORT WasmStreaming final { */ void SetClient(std::shared_ptr client); + /* + * Sets the UTF-8 encoded source URL for the {Script} object. This must be + * called before {Finish}. + */ + void SetUrl(const char* url, size_t length); + /** * Unpacks a {WasmStreaming} object wrapped in a {Managed} for the embedder. * Since the embedder is on the other side of the API, it cannot unpack the @@ -4807,6 +5283,90 @@ class V8_EXPORT WasmModuleObjectBuilderStreaming final { enum class ArrayBufferCreationMode { kInternalized, kExternalized }; +/** + * A wrapper around the backing store (i.e. the raw memory) of an array buffer. + * See a document linked in http://crbug.com/v8/9908 for more information. + * + * The allocation and destruction of backing stores is generally managed by + * V8. Clients should always use standard C++ memory ownership types (i.e. + * std::unique_ptr and std::shared_ptr) to manage lifetimes of backing stores + * properly, since V8 internal objects may alias backing stores. + * + * This object does not keep the underlying |ArrayBuffer::Allocator| alive by + * default. Use Isolate::CreateParams::array_buffer_allocator_shared when + * creating the Isolate to make it hold a reference to the allocator itself. + */ +class V8_EXPORT BackingStore : public v8::internal::BackingStoreBase { + public: + ~BackingStore(); + + /** + * Return a pointer to the beginning of the memory block for this backing + * store. The pointer is only valid as long as this backing store object + * lives. + */ + void* Data() const; + + /** + * The length (in bytes) of this backing store. + */ + size_t ByteLength() const; + + /** + * Indicates whether the backing store was created for an ArrayBuffer or + * a SharedArrayBuffer. + */ + bool IsShared() const; + + /** + * Prevent implicit instantiation of operator delete with size_t argument. + * The size_t argument would be incorrect because ptr points to the + * internal BackingStore object. + */ + void operator delete(void* ptr) { ::operator delete(ptr); } + + /** + * Wrapper around ArrayBuffer::Allocator::Reallocate that preserves IsShared. + * Assumes that the backing_store was allocated by the ArrayBuffer allocator + * of the given isolate. + */ + static std::unique_ptr Reallocate( + v8::Isolate* isolate, std::unique_ptr backing_store, + size_t byte_length); + + /** + * This callback is used only if the memory block for a BackingStore cannot be + * allocated with an ArrayBuffer::Allocator. In such cases the destructor of + * the BackingStore invokes the callback to free the memory block. + */ + using DeleterCallback = void (*)(void* data, size_t length, + void* deleter_data); + + /** + * If the memory block of a BackingStore is static or is managed manually, + * then this empty deleter along with nullptr deleter_data can be passed to + * ArrayBuffer::NewBackingStore to indicate that. + * + * The manually managed case should be used with caution and only when it + * is guaranteed that the memory block freeing happens after detaching its + * ArrayBuffer. + */ + static void EmptyDeleter(void* data, size_t length, void* deleter_data); + + private: + /** + * See [Shared]ArrayBuffer::GetBackingStore and + * [Shared]ArrayBuffer::NewBackingStore. + */ + BackingStore(); +}; + +#if !defined(V8_IMMINENT_DEPRECATION_WARNINGS) +// Use v8::BackingStore::DeleterCallback instead. +using BackingStoreDeleterCallback = void (*)(void* data, size_t length, + void* deleter_data); + +#endif /** * An instance of the built-in ArrayBuffer constructor (ES6 draft 15.13.5). @@ -4828,18 +5388,18 @@ class V8_EXPORT ArrayBuffer : public Object { * Note that it is unsafe to call back into V8 from any of the allocator * functions. */ - class V8_EXPORT Allocator { // NOLINT + class V8_EXPORT Allocator { public: virtual ~Allocator() = default; /** - * Allocate |length| bytes. Return NULL if allocation is not successful. + * Allocate |length| bytes. Return nullptr if allocation is not successful. * Memory should be initialized to zeroes. */ virtual void* Allocate(size_t length) = 0; /** - * Allocate |length| bytes. Return NULL if allocation is not successful. + * Allocate |length| bytes. Return nullptr if allocation is not successful. * Memory does not have to be initialized. */ virtual void* AllocateUninitialized(size_t length) = 0; @@ -4850,6 +5410,20 @@ class V8_EXPORT ArrayBuffer : public Object { */ virtual void Free(void* data, size_t length) = 0; + /** + * Reallocate the memory block of size |old_length| to a memory block of + * size |new_length| by expanding, contracting, or copying the existing + * memory block. If |new_length| > |old_length|, then the new part of + * the memory must be initialized to zeros. Return nullptr if reallocation + * is not successful. + * + * The caller guarantees that the memory block was previously allocated + * using Allocate or AllocateUninitialized. + * + * The default implementation allocates a new block and copies data. + */ + virtual void* Reallocate(void* data, size_t old_length, size_t new_length); + /** * ArrayBuffer allocation mode. kNormal is a malloc/free style allocation, * while kReservation is for larger allocations with the ability to set @@ -4939,14 +5513,58 @@ class V8_EXPORT ArrayBuffer : public Object { * |Allocator::Free| once all ArrayBuffers referencing it are collected by * the garbage collector. */ + V8_DEPRECATED( + "Use the version that takes a BackingStore. " + "See http://crbug.com/v8/9908.") static Local New( Isolate* isolate, void* data, size_t byte_length, ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized); + /** + * Create a new ArrayBuffer with an existing backing store. + * The created array keeps a reference to the backing store until the array + * is garbage collected. Note that the IsExternal bit does not affect this + * reference from the array to the backing store. + * + * In future IsExternal bit will be removed. Until then the bit is set as + * follows. If the backing store does not own the underlying buffer, then + * the array is created in externalized state. Otherwise, the array is created + * in internalized state. In the latter case the array can be transitioned + * to the externalized state using Externalize(backing_store). + */ + static Local New(Isolate* isolate, + std::shared_ptr backing_store); + + /** + * Returns a new standalone BackingStore that is allocated using the array + * buffer allocator of the isolate. The result can be later passed to + * ArrayBuffer::New. + * + * If the allocator returns nullptr, then the function may cause GCs in the + * given isolate and re-try the allocation. If GCs do not help, then the + * function will crash with an out-of-memory error. + */ + static std::unique_ptr NewBackingStore(Isolate* isolate, + size_t byte_length); + /** + * Returns a new standalone BackingStore that takes over the ownership of + * the given buffer. The destructor of the BackingStore invokes the given + * deleter callback. + * + * The result can be later passed to ArrayBuffer::New. The raw pointer + * to the buffer must not be passed again to any V8 API function. + */ + static std::unique_ptr NewBackingStore( + void* data, size_t byte_length, v8::BackingStore::DeleterCallback deleter, + void* deleter_data); + /** * Returns true if ArrayBuffer is externalized, that is, does not * own its memory block. */ + V8_DEPRECATED( + "With v8::BackingStore externalized ArrayBuffers are " + "the same as ordinary ArrayBuffers. See http://crbug.com/v8/9908.") bool IsExternal() const; /** @@ -4954,12 +5572,6 @@ class V8_EXPORT ArrayBuffer : public Object { */ bool IsDetachable() const; - // TODO(913887): fix the use of 'neuter' in the API. - V8_DEPRECATED("Use IsDetachable() instead.", - inline bool IsNeuterable() const) { - return IsDetachable(); - } - /** * Detaches this ArrayBuffer and all its views (typed arrays). * Detaching sets the byte length of the buffer and all typed arrays to zero, @@ -4968,9 +5580,6 @@ class V8_EXPORT ArrayBuffer : public Object { */ void Detach(); - // TODO(913887): fix the use of 'neuter' in the API. - V8_DEPRECATED("Use Detach() instead.", inline void Neuter()) { Detach(); } - /** * Make this ArrayBuffer external. The pointer to underlying memory block * and byte length are returned as |Contents| structure. After ArrayBuffer @@ -4979,10 +5588,21 @@ class V8_EXPORT ArrayBuffer : public Object { * * The Data pointer of ArrayBuffer::Contents must be freed using the provided * deleter, which will call ArrayBuffer::Allocator::Free if the buffer - * was allocated with ArraryBuffer::Allocator::Allocate. + * was allocated with ArrayBuffer::Allocator::Allocate. */ + V8_DEPRECATED("Use GetBackingStore or Detach. See http://crbug.com/v8/9908.") Contents Externalize(); + /** + * Marks this ArrayBuffer external given a witness that the embedder + * has fetched the backing store using the new GetBackingStore() function. + * + * With the new lifetime management of backing stores there is no need for + * externalizing, so this function exists only to make the transition easier. + */ + V8_DEPRECATED("This will be removed together with IsExternal.") + void Externalize(const std::shared_ptr& backing_store); + /** * Get a pointer to the ArrayBuffer's underlying memory block without * externalizing it. If the ArrayBuffer is not externalized, this pointer @@ -4991,8 +5611,19 @@ class V8_EXPORT ArrayBuffer : public Object { * The embedder should make sure to hold a strong reference to the * ArrayBuffer while accessing this pointer. */ + V8_DEPRECATED("Use GetBackingStore. See http://crbug.com/v8/9908.") Contents GetContents(); + /** + * Get a shared pointer to the backing store of this array buffer. This + * pointer coordinates the lifetime management of the internal storage + * with any live ArrayBuffers on the heap, even across isolates. The embedder + * should not attempt to manage lifetime of the storage through other means. + * + * This function replaces both Externalize() and GetContents(). + */ + std::shared_ptr GetBackingStore(); + V8_INLINE static ArrayBuffer* Cast(Value* obj); static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT; @@ -5001,6 +5632,7 @@ class V8_EXPORT ArrayBuffer : public Object { private: ArrayBuffer(); static void CheckCast(Value* obj); + Contents GetContents(bool externalize); }; @@ -5068,7 +5700,10 @@ class V8_EXPORT TypedArray : public ArrayBufferView { /* * The largest typed array size that can be constructed using New. */ - static constexpr size_t kMaxLength = internal::kSmiMaxValue; + static constexpr size_t kMaxLength = + internal::kApiSystemPointerSize == 4 + ? internal::kSmiMaxValue + : static_cast(uint64_t{1} << 32); /** * Number of elements in this typed array @@ -5287,7 +5922,6 @@ class V8_EXPORT DataView : public ArrayBufferView { /** * An instance of the built-in SharedArrayBuffer constructor. - * This API is experimental and may change significantly. */ class V8_EXPORT SharedArrayBuffer : public Object { public: @@ -5299,8 +5933,6 @@ class V8_EXPORT SharedArrayBuffer : public Object { * The Data pointer of ArrayBuffer::Contents must be freed using the provided * deleter, which will call ArrayBuffer::Allocator::Free if the buffer * was allocated with ArraryBuffer::Allocator::Allocate. - * - * This API is experimental and may change significantly. */ class V8_EXPORT Contents { // NOLINT public: @@ -5314,8 +5946,7 @@ class V8_EXPORT SharedArrayBuffer : public Object { allocation_length_(0), allocation_mode_(Allocator::AllocationMode::kNormal), deleter_(nullptr), - deleter_data_(nullptr), - is_growable_(false) {} + deleter_data_(nullptr) {} void* AllocationBase() const { return allocation_base_; } size_t AllocationLength() const { return allocation_length_; } @@ -5327,13 +5958,12 @@ class V8_EXPORT SharedArrayBuffer : public Object { size_t ByteLength() const { return byte_length_; } DeleterCallback Deleter() const { return deleter_; } void* DeleterData() const { return deleter_data_; } - bool IsGrowable() const { return is_growable_; } private: Contents(void* data, size_t byte_length, void* allocation_base, size_t allocation_length, Allocator::AllocationMode allocation_mode, DeleterCallback deleter, - void* deleter_data, bool is_growable); + void* deleter_data); void* data_; size_t byte_length_; @@ -5342,7 +5972,6 @@ class V8_EXPORT SharedArrayBuffer : public Object { Allocator::AllocationMode allocation_mode_; DeleterCallback deleter_; void* deleter_data_; - bool is_growable_; friend class SharedArrayBuffer; }; @@ -5366,24 +5995,69 @@ class V8_EXPORT SharedArrayBuffer : public Object { * specified. The memory block will not be reclaimed when a created * SharedArrayBuffer is garbage-collected. */ - static Local New( - Isolate* isolate, void* data, size_t byte_length, - ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized); + V8_DEPRECATED( + "Use the version that takes a BackingStore. " + "See http://crbug.com/v8/9908.") + static Local New( + Isolate* isolate, void* data, size_t byte_length, + ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized); + + /** + * Create a new SharedArrayBuffer with an existing backing store. + * The created array keeps a reference to the backing store until the array + * is garbage collected. Note that the IsExternal bit does not affect this + * reference from the array to the backing store. + * + * In future IsExternal bit will be removed. Until then the bit is set as + * follows. If the backing store does not own the underlying buffer, then + * the array is created in externalized state. Otherwise, the array is created + * in internalized state. In the latter case the array can be transitioned + * to the externalized state using Externalize(backing_store). + */ + static Local New( + Isolate* isolate, std::shared_ptr backing_store); + + /** + * Returns a new standalone BackingStore that is allocated using the array + * buffer allocator of the isolate. The result can be later passed to + * SharedArrayBuffer::New. + * + * If the allocator returns nullptr, then the function may cause GCs in the + * given isolate and re-try the allocation. If GCs do not help, then the + * function will crash with an out-of-memory error. + */ + static std::unique_ptr NewBackingStore(Isolate* isolate, + size_t byte_length); + /** + * Returns a new standalone BackingStore that takes over the ownership of + * the given buffer. The destructor of the BackingStore invokes the given + * deleter callback. + * + * The result can be later passed to SharedArrayBuffer::New. The raw pointer + * to the buffer must not be passed again to any V8 functions. + */ + static std::unique_ptr NewBackingStore( + void* data, size_t byte_length, v8::BackingStore::DeleterCallback deleter, + void* deleter_data); /** * Create a new SharedArrayBuffer over an existing memory block. Propagate * flags to indicate whether the underlying buffer can be grown. */ - V8_DEPRECATED("Use New method with data, and byte_length instead.", - static Local New( - Isolate* isolate, const SharedArrayBuffer::Contents&, - ArrayBufferCreationMode mode = - ArrayBufferCreationMode::kExternalized)); + V8_DEPRECATED( + "Use the version that takes a BackingStore. " + "See http://crbug.com/v8/9908.") + static Local New( + Isolate* isolate, const SharedArrayBuffer::Contents&, + ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized); /** * Returns true if SharedArrayBuffer is externalized, that is, does not * own its memory block. */ + V8_DEPRECATED( + "With v8::BackingStore externalized SharedArrayBuffers are the same " + "as ordinary SharedArrayBuffers. See http://crbug.com/v8/9908.") bool IsExternal() const; /** @@ -5398,8 +6072,19 @@ class V8_EXPORT SharedArrayBuffer : public Object { * v8::Isolate::CreateParams::array_buffer_allocator. * */ + V8_DEPRECATED("Use GetBackingStore or Detach. See http://crbug.com/v8/9908.") Contents Externalize(); + /** + * Marks this SharedArrayBuffer external given a witness that the embedder + * has fetched the backing store using the new GetBackingStore() function. + * + * With the new lifetime management of backing stores there is no need for + * externalizing, so this function exists only to make the transition easier. + */ + V8_DEPRECATED("This will be removed together with IsExternal.") + void Externalize(const std::shared_ptr& backing_store); + /** * Get a pointer to the ArrayBuffer's underlying memory block without * externalizing it. If the ArrayBuffer is not externalized, this pointer @@ -5412,8 +6097,19 @@ class V8_EXPORT SharedArrayBuffer : public Object { * by the allocator specified in * v8::Isolate::CreateParams::array_buffer_allocator. */ + V8_DEPRECATED("Use GetBackingStore. See http://crbug.com/v8/9908.") Contents GetContents(); + /** + * Get a shared pointer to the backing store of this array buffer. This + * pointer coordinates the lifetime management of the internal storage + * with any live ArrayBuffers on the heap, even across isolates. The embedder + * should not attempt to manage lifetime of the storage through other means. + * + * This function replaces both Externalize() and GetContents(). + */ + std::shared_ptr GetBackingStore(); + V8_INLINE static SharedArrayBuffer* Cast(Value* obj); static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT; @@ -5421,6 +6117,7 @@ class V8_EXPORT SharedArrayBuffer : public Object { private: SharedArrayBuffer(); static void CheckCast(Value* obj); + Contents GetContents(bool externalize); }; @@ -5440,38 +6137,6 @@ class V8_EXPORT Date : public Object { V8_INLINE static Date* Cast(Value* obj); - /** - * Time zone redetection indicator for - * DateTimeConfigurationChangeNotification. - * - * kSkip indicates V8 that the notification should not trigger redetecting - * host time zone. kRedetect indicates V8 that host time zone should be - * redetected, and used to set the default time zone. - * - * The host time zone detection may require file system access or similar - * operations unlikely to be available inside a sandbox. If v8 is run inside a - * sandbox, the host time zone has to be detected outside the sandbox before - * calling DateTimeConfigurationChangeNotification function. - */ - enum class TimeZoneDetection { kSkip, kRedetect }; - - /** - * Notification that the embedder has changed the time zone, - * daylight savings time, or other date / time configuration - * parameters. V8 keeps a cache of various values used for - * date / time computation. This notification will reset - * those cached values for the current context so that date / - * time configuration changes would be reflected in the Date - * object. - * - * This API should not be called more than needed as it will - * negatively impact the performance of date operations. - */ - V8_DEPRECATED("Use Isolate::DateTimeConfigurationChangeNotification", - static void DateTimeConfigurationChangeNotification( - Isolate* isolate, TimeZoneDetection time_zone_detection = - TimeZoneDetection::kSkip)); - private: static void CheckCast(Value* obj); }; @@ -5563,6 +6228,10 @@ class V8_EXPORT RegExp : public Object { /** * Regular expression flag bits. They can be or'ed to enable a set * of flags. + * The kLinear value ('l') is experimental and can only be used with + * --enable-experimental-regexp-engine. RegExps with kLinear flag are + * guaranteed to be executed in asymptotic linear time wrt. the length of + * the subject string. */ enum Flags { kNone = 0, @@ -5572,9 +6241,11 @@ class V8_EXPORT RegExp : public Object { kSticky = 1 << 3, kUnicode = 1 << 4, kDotAll = 1 << 5, + kLinear = 1 << 6, + kHasIndices = 1 << 7, }; - static constexpr int kFlagCount = 6; + static constexpr int kFlagCount = 8; /** * Creates a regular expression from the given pattern string and @@ -5590,6 +6261,29 @@ class V8_EXPORT RegExp : public Object { Local pattern, Flags flags); + /** + * Like New, but additionally specifies a backtrack limit. If the number of + * backtracks done in one Exec call hits the limit, a match failure is + * immediately returned. + */ + static V8_WARN_UNUSED_RESULT MaybeLocal NewWithBacktrackLimit( + Local context, Local pattern, Flags flags, + uint32_t backtrack_limit); + + /** + * Executes the current RegExp instance on the given subject string. + * Equivalent to RegExp.prototype.exec as described in + * + * https://tc39.es/ecma262/#sec-regexp.prototype.exec + * + * On success, an Array containing the matched strings is returned. On + * failure, returns Null. + * + * Note: modifies global context state, accessible e.g. through RegExp.input. + */ + V8_WARN_UNUSED_RESULT MaybeLocal Exec(Local context, + Local subject); + /** * Returns the value of the source property: a string representing * the regular expression. @@ -5607,33 +6301,6 @@ class V8_EXPORT RegExp : public Object { static void CheckCast(Value* obj); }; -/** - * An instance of the built-in FinalizationGroup constructor. - * - * This API is experimental and may change significantly. - */ -class V8_EXPORT FinalizationGroup : public Object { - public: - /** - * Runs the cleanup callback of the given FinalizationGroup. - * - * V8 will inform the embedder that there are finalizer callbacks be - * called through HostCleanupFinalizationGroupCallback. - * - * HostCleanupFinalizationGroupCallback should schedule a task to - * call FinalizationGroup::Cleanup() at some point in the - * future. It's the embedders responsiblity to make this call at a - * time which does not interrupt synchronous ECMAScript code - * execution. - * - * If the result is Nothing then an exception has - * occurred. Otherwise the result is |true| if the cleanup callback - * was called successfully. The result is never |false|. - */ - static V8_WARN_UNUSED_RESULT Maybe Cleanup( - Local finalization_group); -}; - /** * A JavaScript value that wraps a C++ void*. This type of value is mainly used * to associate C++ data structures with JavaScript objects. @@ -5647,13 +6314,15 @@ class V8_EXPORT External : public Value { static void CheckCast(v8::Value* obj); }; -#define V8_INTRINSICS_LIST(F) \ - F(ArrayProto_entries, array_entries_iterator) \ - F(ArrayProto_forEach, array_for_each_iterator) \ - F(ArrayProto_keys, array_keys_iterator) \ - F(ArrayProto_values, array_values_iterator) \ - F(ErrorPrototype, initial_error_prototype) \ - F(IteratorPrototype, initial_iterator_prototype) +#define V8_INTRINSICS_LIST(F) \ + F(ArrayProto_entries, array_entries_iterator) \ + F(ArrayProto_forEach, array_for_each_iterator) \ + F(ArrayProto_keys, array_keys_iterator) \ + F(ArrayProto_values, array_values_iterator) \ + F(AsyncIteratorPrototype, initial_async_iterator_prototype) \ + F(ErrorPrototype, initial_error_prototype) \ + F(IteratorPrototype, initial_iterator_prototype) \ + F(ObjProto_valueOf, object_value_of_function) enum Intrinsic { #define V8_DECL_INTRINSIC(name, iname) k##name, @@ -5718,7 +6387,6 @@ class V8_EXPORT Template : public Data { void SetNativeDataProperty( Local name, AccessorGetterCallback getter, AccessorSetterCallback setter = nullptr, - // TODO(dcarney): gcc can't handle Local below Local data = Local(), PropertyAttribute attribute = None, Local signature = Local(), AccessControl settings = DEFAULT, @@ -5727,7 +6395,6 @@ class V8_EXPORT Template : public Data { void SetNativeDataProperty( Local name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter = nullptr, - // TODO(dcarney): gcc can't handle Local below Local data = Local(), PropertyAttribute attribute = None, Local signature = Local(), AccessControl settings = DEFAULT, @@ -5797,8 +6464,8 @@ class V8_EXPORT Template : public Data { * * See also `ObjectTemplate::SetHandler`. */ -typedef void (*GenericNamedPropertyGetterCallback)( - Local property, const PropertyCallbackInfo& info); +using GenericNamedPropertyGetterCallback = + void (*)(Local property, const PropertyCallbackInfo& info); /** * Interceptor for set requests on an object. @@ -5821,9 +6488,9 @@ typedef void (*GenericNamedPropertyGetterCallback)( * See also * `ObjectTemplate::SetHandler.` */ -typedef void (*GenericNamedPropertySetterCallback)( - Local property, Local value, - const PropertyCallbackInfo& info); +using GenericNamedPropertySetterCallback = + void (*)(Local property, Local value, + const PropertyCallbackInfo& info); /** * Intercepts all requests that query the attributes of the @@ -5846,8 +6513,8 @@ typedef void (*GenericNamedPropertySetterCallback)( * See also * `ObjectTemplate::SetHandler.` */ -typedef void (*GenericNamedPropertyQueryCallback)( - Local property, const PropertyCallbackInfo& info); +using GenericNamedPropertyQueryCallback = + void (*)(Local property, const PropertyCallbackInfo& info); /** * Interceptor for delete requests on an object. @@ -5870,8 +6537,8 @@ typedef void (*GenericNamedPropertyQueryCallback)( * * See also `ObjectTemplate::SetHandler.` */ -typedef void (*GenericNamedPropertyDeleterCallback)( - Local property, const PropertyCallbackInfo& info); +using GenericNamedPropertyDeleterCallback = + void (*)(Local property, const PropertyCallbackInfo& info); /** * Returns an array containing the names of the properties the named @@ -5879,8 +6546,8 @@ typedef void (*GenericNamedPropertyDeleterCallback)( * * Note: The values in the array must be of type v8::Name. */ -typedef void (*GenericNamedPropertyEnumeratorCallback)( - const PropertyCallbackInfo& info); +using GenericNamedPropertyEnumeratorCallback = + void (*)(const PropertyCallbackInfo& info); /** * Interceptor for defineProperty requests on an object. @@ -5902,9 +6569,9 @@ typedef void (*GenericNamedPropertyEnumeratorCallback)( * * See also `ObjectTemplate::SetHandler`. */ -typedef void (*GenericNamedPropertyDefinerCallback)( - Local property, const PropertyDescriptor& desc, - const PropertyCallbackInfo& info); +using GenericNamedPropertyDefinerCallback = + void (*)(Local property, const PropertyDescriptor& desc, + const PropertyCallbackInfo& info); /** * Interceptor for getOwnPropertyDescriptor requests on an object. @@ -5925,37 +6592,33 @@ typedef void (*GenericNamedPropertyDefinerCallback)( * * See also `ObjectTemplate::SetHandler`. */ -typedef void (*GenericNamedPropertyDescriptorCallback)( - Local property, const PropertyCallbackInfo& info); +using GenericNamedPropertyDescriptorCallback = + void (*)(Local property, const PropertyCallbackInfo& info); /** * See `v8::GenericNamedPropertyGetterCallback`. */ -typedef void (*IndexedPropertyGetterCallback)( - uint32_t index, - const PropertyCallbackInfo& info); +using IndexedPropertyGetterCallback = + void (*)(uint32_t index, const PropertyCallbackInfo& info); /** * See `v8::GenericNamedPropertySetterCallback`. */ -typedef void (*IndexedPropertySetterCallback)( - uint32_t index, - Local value, - const PropertyCallbackInfo& info); +using IndexedPropertySetterCallback = + void (*)(uint32_t index, Local value, + const PropertyCallbackInfo& info); /** * See `v8::GenericNamedPropertyQueryCallback`. */ -typedef void (*IndexedPropertyQueryCallback)( - uint32_t index, - const PropertyCallbackInfo& info); +using IndexedPropertyQueryCallback = + void (*)(uint32_t index, const PropertyCallbackInfo& info); /** * See `v8::GenericNamedPropertyDeleterCallback`. */ -typedef void (*IndexedPropertyDeleterCallback)( - uint32_t index, - const PropertyCallbackInfo& info); +using IndexedPropertyDeleterCallback = + void (*)(uint32_t index, const PropertyCallbackInfo& info); /** * Returns an array containing the indices of the properties the indexed @@ -5963,21 +6626,21 @@ typedef void (*IndexedPropertyDeleterCallback)( * * Note: The values in the array must be uint32_t. */ -typedef void (*IndexedPropertyEnumeratorCallback)( - const PropertyCallbackInfo& info); +using IndexedPropertyEnumeratorCallback = + void (*)(const PropertyCallbackInfo& info); /** * See `v8::GenericNamedPropertyDefinerCallback`. */ -typedef void (*IndexedPropertyDefinerCallback)( - uint32_t index, const PropertyDescriptor& desc, - const PropertyCallbackInfo& info); +using IndexedPropertyDefinerCallback = + void (*)(uint32_t index, const PropertyDescriptor& desc, + const PropertyCallbackInfo& info); /** * See `v8::GenericNamedPropertyDescriptorCallback`. */ -typedef void (*IndexedPropertyDescriptorCallback)( - uint32_t index, const PropertyCallbackInfo& info); +using IndexedPropertyDescriptorCallback = + void (*)(uint32_t index, const PropertyCallbackInfo& info); /** * Access type specification. @@ -5995,9 +6658,9 @@ enum AccessType { * Returns true if the given context should be allowed to access the given * object. */ -typedef bool (*AccessCheckCallback)(Local accessing_context, - Local accessed_object, - Local data); +using AccessCheckCallback = bool (*)(Local accessing_context, + Local accessed_object, + Local data); /** * A FunctionTemplate is used to create functions at runtime. There @@ -6034,11 +6697,12 @@ typedef bool (*AccessCheckCallback)(Local accessing_context, * proto_t->Set(isolate, "proto_const", v8::Number::New(isolate, 2)); * * v8::Local instance_t = t->InstanceTemplate(); - * instance_t->SetAccessor(String::NewFromUtf8(isolate, "instance_accessor"), - * InstanceAccessorCallback); + * instance_t->SetAccessor( + String::NewFromUtf8Literal(isolate, "instance_accessor"), + * InstanceAccessorCallback); * instance_t->SetHandler( * NamedPropertyHandlerConfiguration(PropertyHandlerCallback)); - * instance_t->Set(String::NewFromUtf8(isolate, "instance_property"), + * instance_t->Set(String::NewFromUtf8Literal(isolate, "instance_property"), * Number::New(isolate, 3)); * * v8::Local function = t->GetFunction(); @@ -6098,6 +6762,12 @@ typedef bool (*AccessCheckCallback)(Local accessing_context, * child_instance.instance_accessor calls 'InstanceAccessorCallback' * child_instance.instance_property == 3; * \endcode + * + * The additional 'c_function' parameter refers to a fast API call, which + * must not trigger GC or JavaScript execution, or call into V8 in other + * ways. For more information how to define them, see + * include/v8-fast-api-calls.h. Please note that this feature is still + * experimental. */ class V8_EXPORT FunctionTemplate : public Template { public: @@ -6107,11 +6777,17 @@ class V8_EXPORT FunctionTemplate : public Template { Local data = Local(), Local signature = Local(), int length = 0, ConstructorBehavior behavior = ConstructorBehavior::kAllow, - SideEffectType side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType side_effect_type = SideEffectType::kHasSideEffect, + const CFunction* c_function = nullptr); - /** Get a template included in the snapshot by index. */ - static MaybeLocal FromSnapshot(Isolate* isolate, - size_t index); + /** Creates a function template for multiple overloaded fast API calls.*/ + static Local NewWithCFunctionOverloads( + Isolate* isolate, FunctionCallback callback = nullptr, + Local data = Local(), + Local signature = Local(), int length = 0, + ConstructorBehavior behavior = ConstructorBehavior::kAllow, + SideEffectType side_effect_type = SideEffectType::kHasSideEffect, + const MemorySpan& c_function_overloads = {}); /** * Creates a function template backed/cached by a private property. @@ -6138,11 +6814,24 @@ class V8_EXPORT FunctionTemplate : public Template { /** * Set the call-handler callback for a FunctionTemplate. This * callback is called whenever the function created from this - * FunctionTemplate is called. + * FunctionTemplate is called. The 'c_function' represents a fast + * API call, see the comment above the class declaration. */ void SetCallHandler( FunctionCallback callback, Local data = Local(), - SideEffectType side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType side_effect_type = SideEffectType::kHasSideEffect, + const CFunction* c_function = nullptr); + + /** + * Set the call-handler callback for a FunctionTemplate. This + * callback is called whenever the function created from this + * FunctionTemplate is called. The 'c_function' represents a fast + * API call, see the comment above the class declaration. + */ + void SetCallHandlerV8_92( + FunctionCallback callback, Local data = Local(), + SideEffectType side_effect_type = SideEffectType::kHasSideEffect, + const MemorySpan& c_function_overloads = {}); /** Set the predefined length property for the FunctionTemplate. */ void SetLength(int length); @@ -6185,21 +6874,6 @@ class V8_EXPORT FunctionTemplate : public Template { */ void SetAcceptAnyReceiver(bool value); - /** - * Determines whether the __proto__ accessor ignores instances of - * the function template. If instances of the function template are - * ignored, __proto__ skips all instances and instead returns the - * next object in the prototype chain. - * - * Call with a value of true to make the __proto__ accessor ignore - * instances of the function template. Call with a value of false - * to make the __proto__ accessor not ignore instances of the - * function template. By default, instances of a function template - * are not ignored. - */ - V8_DEPRECATED("This feature is incompatible with ES6+.", - void SetHiddenPrototype(bool value)); - /** * Sets the ReadOnly flag in the attributes of the 'prototype' property * of functions created from this FunctionTemplate to true. @@ -6218,6 +6892,15 @@ class V8_EXPORT FunctionTemplate : public Template { */ bool HasInstance(Local object); + /** + * Returns true if the given value is an API object that was constructed by an + * instance of this function template (without checking for inheriting + * function templates). + * + * This is an experimental feature and may still change significantly. + */ + bool IsLeafTemplateForApiObject(v8::Local value) const; + V8_INLINE static FunctionTemplate* Cast(Data* data); private: @@ -6415,10 +7098,6 @@ class V8_EXPORT ObjectTemplate : public Template { Isolate* isolate, Local constructor = Local()); - /** Get a template included in the snapshot by index. */ - static MaybeLocal FromSnapshot(Isolate* isolate, - size_t index); - /** Creates a new instance of this template.*/ V8_WARN_UNUSED_RESULT MaybeLocal NewInstance(Local context); @@ -6586,6 +7265,18 @@ class V8_EXPORT ObjectTemplate : public Template { */ void SetImmutableProto(); + /** + * Support for TC39 "dynamic code brand checks" proposal. + * + * This API allows to mark (& query) objects as "code like", which causes + * them to be treated like Strings in the context of eval and function + * constructor. + * + * Reference: https://github.com/tc39/proposal-dynamic-code-brand-checks + */ + void SetCodeLike(); + bool IsCodeLike(); + V8_INLINE static ObjectTemplate* Cast(Data* data); private: @@ -6643,7 +7334,7 @@ class V8_EXPORT AccessorSignature : public Data { /** * Ignore */ -class V8_EXPORT Extension { // NOLINT +class V8_EXPORT Extension { public: // Note that the strings passed into this constructor must live as long // as the Extension itself. @@ -6703,7 +7394,26 @@ V8_INLINE Local False(Isolate* isolate); */ class V8_EXPORT ResourceConstraints { public: - ResourceConstraints(); + /** + * Configures the constraints with reasonable default values based on the + * provided heap size limit. The heap size includes both the young and + * the old generation. + * + * \param initial_heap_size_in_bytes The initial heap size or zero. + * By default V8 starts with a small heap and dynamically grows it to + * match the set of live objects. This may lead to ineffective + * garbage collections at startup if the live set is large. + * Setting the initial heap size avoids such garbage collections. + * Note that this does not affect young generation garbage collections. + * + * \param maximum_heap_size_in_bytes The hard limit for the heap size. + * When the heap size approaches this limit, V8 will perform series of + * garbage collections and invoke the NearHeapLimitCallback. If the garbage + * collections do not help and the callback does not increase the limit, + * then V8 will crash with V8::FatalProcessOutOfMemory. + */ + void ConfigureDefaultsFromHeapSize(size_t initial_heap_size_in_bytes, + size_t maximum_heap_size_in_bytes); /** * Configures the constraints with reasonable default values based on the @@ -6726,13 +7436,14 @@ class V8_EXPORT ResourceConstraints { /** * The amount of virtual memory reserved for generated code. This is relevant * for 64-bit architectures that rely on code range for calls in code. + * + * When V8_COMPRESS_POINTERS_IN_SHARED_CAGE is defined, there is a shared + * process-wide code range that is lazily initialized. This value is used to + * configure that shared code range when the first Isolate is + * created. Subsequent Isolates ignore this value. */ - size_t code_range_size_in_bytes() const { - return code_range_size_ * kMB; - } - void set_code_range_size_in_bytes(size_t limit) { - code_range_size_ = limit / kMB; - } + size_t code_range_size_in_bytes() const { return code_range_size_; } + void set_code_range_size_in_bytes(size_t limit) { code_range_size_ = limit; } /** * The maximum size of the old generation. @@ -6742,10 +7453,10 @@ class V8_EXPORT ResourceConstraints { * increase the limit, then V8 will crash with V8::FatalProcessOutOfMemory. */ size_t max_old_generation_size_in_bytes() const { - return max_old_space_size_ * kMB; + return max_old_generation_size_; } void set_max_old_generation_size_in_bytes(size_t limit) { - max_old_space_size_ = limit / kMB; + max_old_generation_size_ = limit; } /** @@ -6753,88 +7464,54 @@ class V8_EXPORT ResourceConstraints { * and a large object space. This affects frequency of Scavenge garbage * collections and should be typically much smaller that the old generation. */ - size_t max_young_generation_size_in_bytes() const; - void set_max_young_generation_size_in_bytes(size_t limit); + size_t max_young_generation_size_in_bytes() const { + return max_young_generation_size_; + } + void set_max_young_generation_size_in_bytes(size_t limit) { + max_young_generation_size_ = limit; + } size_t initial_old_generation_size_in_bytes() const { - return 0; + return initial_old_generation_size_; } void set_initial_old_generation_size_in_bytes(size_t initial_size) { - // Not available on Node 12. + initial_old_generation_size_ = initial_size; } size_t initial_young_generation_size_in_bytes() const { - return 0; + return initial_young_generation_size_; } void set_initial_young_generation_size_in_bytes(size_t initial_size) { - // Not available on Node 12. - } - - /** - * Deprecated functions. Do not use in new code. - */ - V8_DEPRECATE_SOON("Use code_range_size_in_bytes.", - size_t code_range_size() const) { - return code_range_size_; - } - V8_DEPRECATE_SOON("Use set_code_range_size_in_bytes.", - void set_code_range_size(size_t limit_in_mb)) { - code_range_size_ = limit_in_mb; - } - V8_DEPRECATE_SOON("Use max_young_generation_size_in_bytes.", - size_t max_semi_space_size_in_kb() const) { - return max_semi_space_size_in_kb_; - } - V8_DEPRECATE_SOON("Use set_max_young_generation_size_in_bytes.", - void set_max_semi_space_size_in_kb(size_t limit_in_kb)) { - max_semi_space_size_in_kb_ = limit_in_kb; - } - V8_DEPRECATE_SOON("Use max_old_generation_size_in_bytes.", - size_t max_old_space_size() const) { - return max_old_space_size_; - } - V8_DEPRECATE_SOON("Use set_max_old_generation_size_in_bytes.", - void set_max_old_space_size(size_t limit_in_mb)) { - max_old_space_size_ = limit_in_mb; - } - V8_DEPRECATE_SOON("Zone does not pool memory any more.", - size_t max_zone_pool_size() const) { - return max_zone_pool_size_; - } - V8_DEPRECATE_SOON("Zone does not pool memory any more.", - void set_max_zone_pool_size(size_t bytes)) { - max_zone_pool_size_ = bytes; + initial_young_generation_size_ = initial_size; } private: static constexpr size_t kMB = 1048576u; - - // max_semi_space_size_ is in KB - size_t max_semi_space_size_in_kb_ = 0; - - // The remaining limits are in MB - size_t max_old_space_size_ = 0; - uint32_t* stack_limit_ = nullptr; size_t code_range_size_ = 0; - size_t max_zone_pool_size_ = 0; + size_t max_old_generation_size_ = 0; + size_t max_young_generation_size_ = 0; + size_t initial_old_generation_size_ = 0; + size_t initial_young_generation_size_ = 0; + uint32_t* stack_limit_ = nullptr; }; // --- Exceptions --- +using FatalErrorCallback = void (*)(const char* location, const char* message); -typedef void (*FatalErrorCallback)(const char* location, const char* message); +using OOMErrorCallback = void (*)(const char* location, bool is_heap_oom); -typedef void (*OOMErrorCallback)(const char* location, bool is_heap_oom); +using DcheckErrorCallback = void (*)(const char* file, int line, + const char* message); -typedef void (*DcheckErrorCallback)(const char* file, int line, - const char* message); - -typedef void (*MessageCallback)(Local message, Local data); +using MessageCallback = void (*)(Local message, Local data); // --- Tracing --- -typedef void (*LogEventCallback)(const char* name, int event); +enum LogEventStatus : int { kStart = 0, kEnd = 1, kStamp = 2 }; +using LogEventCallback = void (*)(const char* name, + int /* LogEventStatus */ status); /** * Create new error objects by calling the corresponding error object @@ -6846,6 +7523,9 @@ class V8_EXPORT Exception { static Local ReferenceError(Local message); static Local SyntaxError(Local message); static Local TypeError(Local message); + static Local WasmCompileError(Local message); + static Local WasmLinkError(Local message); + static Local WasmRuntimeError(Local message); static Local Error(Local message); /** @@ -6865,14 +7545,12 @@ class V8_EXPORT Exception { // --- Counters Callbacks --- -typedef int* (*CounterLookupCallback)(const char* name); +using CounterLookupCallback = int* (*)(const char* name); -typedef void* (*CreateHistogramCallback)(const char* name, - int min, - int max, - size_t buckets); +using CreateHistogramCallback = void* (*)(const char* name, int min, int max, + size_t buckets); -typedef void (*AddHistogramSampleCallback)(void* histogram, int sample); +using AddHistogramSampleCallback = void (*)(void* histogram, int sample); // --- Crashkeys Callback --- enum class CrashKeyId { @@ -6880,31 +7558,43 @@ enum class CrashKeyId { kReadonlySpaceFirstPageAddress, kMapSpaceFirstPageAddress, kCodeSpaceFirstPageAddress, + kDumpType, }; -typedef void (*AddCrashKeyCallback)(CrashKeyId id, const std::string& value); +using AddCrashKeyCallback = void (*)(CrashKeyId id, const std::string& value); // --- Enter/Leave Script Callback --- -typedef void (*BeforeCallEnteredCallback)(Isolate*); -typedef void (*CallCompletedCallback)(Isolate*); +using BeforeCallEnteredCallback = void (*)(Isolate*); +using CallCompletedCallback = void (*)(Isolate*); /** - * HostCleanupFinalizationGroupCallback is called when we require the - * embedder to enqueue a task that would call - * FinalizationGroup::Cleanup(). + * HostImportModuleDynamicallyCallback is called when we require the + * embedder to load a module. This is used as part of the dynamic + * import syntax. * - * The FinalizationGroup is the one for which the embedder needs to - * call FinalizationGroup::Cleanup() on. + * The referrer contains metadata about the script/module that calls + * import. + * + * The specifier is the name of the module that should be imported. * - * The context provided is the one in which the FinalizationGroup was - * created in. + * The embedder must compile, instantiate, evaluate the Module, and + * obtain its namespace object. + * + * The Promise returned from this function is forwarded to userland + * JavaScript. The embedder must resolve this promise with the module + * namespace object. In case of an exception, the embedder must reject + * this promise with the exception. If the promise creation itself + * fails (e.g. due to stack overflow), the embedder must propagate + * that exception by returning an empty MaybeLocal. */ -typedef void (*HostCleanupFinalizationGroupCallback)( - Local context, Local fg); +using HostImportModuleDynamicallyCallback = + MaybeLocal (*)(Local context, + Local referrer, + Local specifier); /** - * HostImportModuleDynamicallyCallback is called when we require the - * embedder to load a module. This is used as part of the dynamic + * HostImportModuleDynamicallyWithImportAssertionsCallback is called when we + * require the embedder to load a module. This is used as part of the dynamic * import syntax. * * The referrer contains metadata about the script/module that calls @@ -6912,8 +7602,14 @@ typedef void (*HostCleanupFinalizationGroupCallback)( * * The specifier is the name of the module that should be imported. * + * The import_assertions are import assertions for this request in the form: + * [key1, value1, key2, value2, ...] where the keys and values are of type + * v8::String. Note, unlike the FixedArray passed to ResolveModuleCallback and + * returned from ModuleRequest::GetImportAssertions(), this array does not + * contain the source Locations of the assertions. + * * The embedder must compile, instantiate, evaluate the Module, and - * obtain it's namespace object. + * obtain its namespace object. * * The Promise returned from this function is forwarded to userland * JavaScript. The embedder must resolve this promise with the module @@ -6922,9 +7618,11 @@ typedef void (*HostCleanupFinalizationGroupCallback)( * fails (e.g. due to stack overflow), the embedder must propagate * that exception by returning an empty MaybeLocal. */ -typedef MaybeLocal (*HostImportModuleDynamicallyCallback)( - Local context, Local referrer, - Local specifier); +using HostImportModuleDynamicallyWithImportAssertionsCallback = + MaybeLocal (*)(Local context, + Local referrer, + Local specifier, + Local import_assertions); /** * HostInitializeImportMetaObjectCallback is called the first time import.meta @@ -6936,9 +7634,9 @@ typedef MaybeLocal (*HostImportModuleDynamicallyCallback)( * The embedder should use v8::Object::CreateDataProperty to add properties on * the meta object. */ -typedef void (*HostInitializeImportMetaObjectCallback)(Local context, - Local module, - Local meta); +using HostInitializeImportMetaObjectCallback = void (*)(Local context, + Local module, + Local meta); /** * PrepareStackTraceCallback is called when the stack property of an error is @@ -6947,9 +7645,9 @@ typedef void (*HostInitializeImportMetaObjectCallback)(Local context, * |sites| is an array of call sites, specified in * https://v8.dev/docs/stack-trace-api */ -typedef MaybeLocal (*PrepareStackTraceCallback)(Local context, - Local error, - Local sites); +using PrepareStackTraceCallback = MaybeLocal (*)(Local context, + Local error, + Local sites); /** * PromiseHook with type kInit is called when a new promise is @@ -6969,8 +7667,8 @@ typedef MaybeLocal (*PrepareStackTraceCallback)(Local context, */ enum class PromiseHookType { kInit, kResolve, kBefore, kAfter }; -typedef void (*PromiseHook)(PromiseHookType type, Local promise, - Local parent); +using PromiseHook = void (*)(PromiseHookType type, Local promise, + Local parent); // --- Promise Reject Callback --- enum PromiseRejectEvent { @@ -6996,17 +7694,16 @@ class PromiseRejectMessage { Local value_; }; -typedef void (*PromiseRejectCallback)(PromiseRejectMessage message); +using PromiseRejectCallback = void (*)(PromiseRejectMessage message); // --- Microtasks Callbacks --- -typedef void (*MicrotasksCompletedCallback)(Isolate*); -typedef void (*MicrotasksCompletedCallbackWithData)(Isolate*, void*); -typedef void (*MicrotaskCallback)(void* data); - +using MicrotasksCompletedCallbackWithData = void (*)(Isolate*, void*); +using MicrotaskCallback = void (*)(void* data); /** * Policy for running microtasks: - * - explicit: microtasks are invoked with Isolate::RunMicrotasks() method; + * - explicit: microtasks are invoked with the + * Isolate::PerformMicrotaskCheckpoint() method; * - scoped: microtasks invocation is controlled by MicrotasksScope objects; * - auto: microtasks are invoked when the script call depth decrements * to zero. @@ -7033,7 +7730,8 @@ class V8_EXPORT MicrotaskQueue { /** * Creates an empty MicrotaskQueue instance. */ - static std::unique_ptr New(Isolate* isolate); + static std::unique_ptr New( + Isolate* isolate, MicrotasksPolicy policy = MicrotasksPolicy::kAuto); virtual ~MicrotaskQueue() = default; @@ -7081,13 +7779,22 @@ class V8_EXPORT MicrotaskQueue { */ virtual bool IsRunningMicrotasks() const = 0; + /** + * Returns the current depth of nested MicrotasksScope that has + * kRunMicrotasks. + */ + virtual int GetMicrotasksScopeDepth() const = 0; + + MicrotaskQueue(const MicrotaskQueue&) = delete; + MicrotaskQueue& operator=(const MicrotaskQueue&) = delete; + private: friend class internal::MicrotaskQueue; MicrotaskQueue() = default; }; /** - * This scope is used to control microtasks when kScopeMicrotasksInvocation + * This scope is used to control microtasks when MicrotasksPolicy::kScoped * is used on Isolate. In this mode every non-primitive call to V8 should be * done inside some MicrotasksScope. * Microtasks are executed when topmost MicrotasksScope marked as kRunMicrotasks @@ -7095,7 +7802,7 @@ class V8_EXPORT MicrotaskQueue { * kDoNotRunMicrotasks should be used to annotate calls not intended to trigger * microtasks. */ -class V8_EXPORT MicrotasksScope { +class V8_EXPORT V8_NODISCARD MicrotasksScope { public: enum Type { kRunMicrotasks, kDoNotRunMicrotasks }; @@ -7128,11 +7835,9 @@ class V8_EXPORT MicrotasksScope { bool run_; }; - // --- Failed Access Check Callback --- -typedef void (*FailedAccessCheckCallback)(Local target, - AccessType type, - Local data); +using FailedAccessCheckCallback = void (*)(Local target, + AccessType type, Local data); // --- AllowCodeGenerationFromStrings callbacks --- @@ -7140,30 +7845,56 @@ typedef void (*FailedAccessCheckCallback)(Local target, * Callback to check if code generation from strings is allowed. See * Context::AllowCodeGenerationFromStrings. */ -typedef bool (*AllowCodeGenerationFromStringsCallback)(Local context, - Local source); -typedef MaybeLocal (*ModifyCodeGenerationFromStringsCallback)( - Local context, Local source); +using AllowCodeGenerationFromStringsCallback = bool (*)(Local context, + Local source); + +struct ModifyCodeGenerationFromStringsResult { + // If true, proceed with the codegen algorithm. Otherwise, block it. + bool codegen_allowed = false; + // Overwrite the original source with this string, if present. + // Use the original source if empty. + // This field is considered only if codegen_allowed is true. + MaybeLocal modified_source; +}; + +/** + * Callback to check if codegen is allowed from a source object, and convert + * the source to string if necessary. See: ModifyCodeGenerationFromStrings. + */ +using ModifyCodeGenerationFromStringsCallback = + ModifyCodeGenerationFromStringsResult (*)(Local context, + Local source); +using ModifyCodeGenerationFromStringsCallback2 = + ModifyCodeGenerationFromStringsResult (*)(Local context, + Local source, + bool is_code_like); // --- WebAssembly compilation callbacks --- -typedef bool (*ExtensionCallback)(const FunctionCallbackInfo&); +using ExtensionCallback = bool (*)(const FunctionCallbackInfo&); -typedef bool (*AllowWasmCodeGenerationCallback)(Local context, - Local source); +using AllowWasmCodeGenerationCallback = bool (*)(Local context, + Local source); // --- Callback for APIs defined on v8-supported objects, but implemented // by the embedder. Example: WebAssembly.{compile|instantiate}Streaming --- -typedef void (*ApiImplementationCallback)(const FunctionCallbackInfo&); +using ApiImplementationCallback = void (*)(const FunctionCallbackInfo&); // --- Callback for WebAssembly.compileStreaming --- -typedef void (*WasmStreamingCallback)(const FunctionCallbackInfo&); +using WasmStreamingCallback = void (*)(const FunctionCallbackInfo&); + +// --- Callback for loading source map file for Wasm profiling support +using WasmLoadSourceMapCallback = Local (*)(Isolate* isolate, + const char* name); + +// --- Callback for checking if WebAssembly Simd is enabled --- +using WasmSimdEnabledCallback = bool (*)(Local context); -// --- Callback for checking if WebAssembly threads are enabled --- -typedef bool (*WasmThreadsEnabledCallback)(Local context); +// --- Callback for checking if WebAssembly exceptions are enabled --- +using WasmExceptionsEnabledCallback = bool (*)(Local context); -// --- Callback for loading source map file for WASM profiling support -typedef Local (*WasmLoadSourceMapCallback)(Isolate* isolate, - const char* name); +// --- Callback for checking if the SharedArrayBuffer constructor is enabled --- +using SharedArrayBufferConstructorEnabledCallback = + bool (*)(Local context); // --- Garbage Collection Callbacks --- @@ -7207,9 +7938,9 @@ enum GCCallbackFlags { kGCCallbackScheduleIdleGarbageCollection = 1 << 6, }; -typedef void (*GCCallback)(GCType type, GCCallbackFlags flags); +using GCCallback = void (*)(GCType type, GCCallbackFlags flags); -typedef void (*InterruptCallback)(Isolate* isolate, void* data); +using InterruptCallback = void (*)(Isolate* isolate, void* data); /** * This callback is invoked when the heap size is close to the heap limit and @@ -7218,13 +7949,37 @@ typedef void (*InterruptCallback)(Isolate* isolate, void* data); * than the current_heap_limit. The initial heap limit is the limit that was * set after heap setup. */ -typedef size_t (*NearHeapLimitCallback)(void* data, size_t current_heap_limit, - size_t initial_heap_limit); +using NearHeapLimitCallback = size_t (*)(void* data, size_t current_heap_limit, + size_t initial_heap_limit); + +/** + * Collection of shared per-process V8 memory information. + * + * Instances of this class can be passed to + * v8::V8::GetSharedMemoryStatistics to get shared memory statistics from V8. + */ +class V8_EXPORT SharedMemoryStatistics { + public: + SharedMemoryStatistics(); + size_t read_only_space_size() { return read_only_space_size_; } + size_t read_only_space_used_size() { return read_only_space_used_size_; } + size_t read_only_space_physical_size() { + return read_only_space_physical_size_; + } + + private: + size_t read_only_space_size_; + size_t read_only_space_used_size_; + size_t read_only_space_physical_size_; + + friend class V8; + friend class internal::ReadOnlyHeap; +}; /** * Collection of V8 heap information. * - * Instances of this class can be passed to v8::V8::HeapStatistics to + * Instances of this class can be passed to v8::Isolate::GetHeapStatistics to * get heap statistics from V8. */ class V8_EXPORT HeapStatistics { @@ -7234,6 +7989,8 @@ class V8_EXPORT HeapStatistics { size_t total_heap_size_executable() { return total_heap_size_executable_; } size_t total_physical_size() { return total_physical_size_; } size_t total_available_size() { return total_available_size_; } + size_t total_global_handles_size() { return total_global_handles_size_; } + size_t used_global_handles_size() { return used_global_handles_size_; } size_t used_heap_size() { return used_heap_size_; } size_t heap_size_limit() { return heap_size_limit_; } size_t malloced_memory() { return malloced_memory_; } @@ -7261,6 +8018,8 @@ class V8_EXPORT HeapStatistics { bool does_zap_garbage_; size_t number_of_native_contexts_; size_t number_of_detached_contexts_; + size_t total_global_handles_size_; + size_t used_global_handles_size_; friend class V8; friend class Isolate; @@ -7380,6 +8139,20 @@ struct JitCodeEvent { PositionType position_type; }; + struct wasm_source_info_t { + // Source file name. + const char* filename; + // Length of filename. + size_t filename_size; + // Line number table, which maps offsets of JITted code to line numbers of + // source file. + const line_info_t* line_number_table; + // Number of entries in the line number table. + size_t line_number_table_size; + }; + + wasm_source_info_t* wasm_source_info; + union { // Only valid for CODE_ADDED. struct name_t name; @@ -7431,30 +8204,29 @@ enum JitCodeEventOptions { * * \param event code add, move or removal event. */ -typedef void (*JitCodeEventHandler)(const JitCodeEvent* event); +using JitCodeEventHandler = void (*)(const JitCodeEvent* event); /** * Callback function passed to SetUnhandledExceptionCallback. */ #if defined(V8_OS_WIN) -typedef int (*UnhandledExceptionCallback)( - _EXCEPTION_POINTERS* exception_pointers); +using UnhandledExceptionCallback = + int (*)(_EXCEPTION_POINTERS* exception_pointers); #endif /** * Interface for iterating through all external resources in the heap. */ -class V8_EXPORT ExternalResourceVisitor { // NOLINT +class V8_EXPORT ExternalResourceVisitor { public: virtual ~ExternalResourceVisitor() = default; virtual void VisitExternalString(Local string) {} }; - /** * Interface for iterating through all the persistent handles in the heap. */ -class V8_EXPORT PersistentHandleVisitor { // NOLINT +class V8_EXPORT PersistentHandleVisitor { public: virtual ~PersistentHandleVisitor() = default; virtual void VisitPersistentHandle(Persistent* value, @@ -7471,6 +8243,45 @@ class V8_EXPORT PersistentHandleVisitor { // NOLINT */ enum class MemoryPressureLevel { kNone, kModerate, kCritical }; +/** + * Handler for embedder roots on non-unified heap garbage collections. + */ +class V8_EXPORT EmbedderRootsHandler { + public: + virtual ~EmbedderRootsHandler() = default; + + /** + * Returns true if the TracedGlobal handle should be considered as root for + * the currently running non-tracing garbage collection and false otherwise. + * The default implementation will keep all TracedGlobal references as roots. + * + * If this returns false, then V8 may decide that the object referred to by + * such a handle is reclaimed. In that case: + * - No action is required if handles are used with destructors, i.e., by just + * using |TracedGlobal|. + * - When run without destructors, i.e., by using |TracedReference|, V8 calls + * |ResetRoot|. + * + * Note that the |handle| is different from the handle that the embedder holds + * for retaining the object. The embedder may use |WrapperClassId()| to + * distinguish cases where it wants handles to be treated as roots from not + * being treated as roots. + */ + virtual bool IsRoot(const v8::TracedReference& handle) = 0; + virtual bool IsRoot(const v8::TracedGlobal& handle) = 0; + + /** + * Used in combination with |IsRoot|. Called by V8 when an + * object that is backed by a handle is reclaimed by a non-tracing garbage + * collection. It is up to the embedder to reset the original handle. + * + * Note that the |handle| is different from the handle that the embedder holds + * for retaining the object. It is up to the embedder to find the original + * handle via the object or class id. + */ + virtual void ResetRoot(const v8::TracedReference& handle) = 0; +}; + /** * Interface for tracing through the embedder heap. During a V8 garbage * collection, V8 collects hidden fields of all potential wrappers, and at the @@ -7480,16 +8291,12 @@ enum class MemoryPressureLevel { kNone, kModerate, kCritical }; */ class V8_EXPORT EmbedderHeapTracer { public: + using EmbedderStackState = cppgc::EmbedderStackState; + enum TraceFlags : uint64_t { kNoFlags = 0, kReduceMemory = 1 << 0, - }; - - // Indicator for the stack state of the embedder. - enum EmbedderStackState { - kUnknown, - kNonEmpty, - kEmpty, + kForced = 1 << 2, }; /** @@ -7498,7 +8305,8 @@ class V8_EXPORT EmbedderHeapTracer { class V8_EXPORT TracedGlobalHandleVisitor { public: virtual ~TracedGlobalHandleVisitor() = default; - virtual void VisitTracedGlobalHandle(const TracedGlobal& value) = 0; + virtual void VisitTracedGlobalHandle(const TracedGlobal& handle) {} + virtual void VisitTracedReference(const TracedReference& handle) {} }; /** @@ -7527,6 +8335,20 @@ class V8_EXPORT EmbedderHeapTracer { */ void IterateTracedGlobalHandles(TracedGlobalHandleVisitor* visitor); + /** + * Called by the embedder to set the start of the stack which is e.g. used by + * V8 to determine whether handles are used from stack or heap. + */ + void SetStackStart(void* stack_start); + + /** + * Called by the embedder to notify V8 of an empty execution stack. + */ + V8_DEPRECATE_SOON( + "This call only optimized internal caches which V8 is able to figure out " + "on its own now.") + void NotifyEmptyEmbedderStack(); + /** * Called by v8 to register internal fields of found wrappers. * @@ -7536,13 +8358,12 @@ class V8_EXPORT EmbedderHeapTracer { virtual void RegisterV8References( const std::vector >& embedder_fields) = 0; - void RegisterEmbedderReference(const TracedGlobal& ref); + void RegisterEmbedderReference(const BasicTracedReference& ref); /** * Called at the beginning of a GC cycle. */ - V8_DEPRECATED("Use version with flags.", virtual void TracePrologue()) {} - virtual void TracePrologue(TraceFlags flags); + virtual void TracePrologue(TraceFlags flags) {} /** * Called to advance tracing in the embedder. @@ -7569,8 +8390,7 @@ class V8_EXPORT EmbedderHeapTracer { * overriden to fill a |TraceSummary| that is used by V8 to schedule future * garbage collections. */ - virtual void TraceEpilogue() {} - virtual void TraceEpilogue(TraceSummary* trace_summary) { TraceEpilogue(); } + virtual void TraceEpilogue(TraceSummary* trace_summary) {} /** * Called upon entering the final marking pause. No more incremental marking @@ -7590,38 +8410,17 @@ class V8_EXPORT EmbedderHeapTracer { void FinalizeTracing(); /** - * Returns true if the TracedGlobal handle should be considered as root for - * the currently running non-tracing garbage collection and false otherwise. - * The default implementation will keep all TracedGlobal references as roots. - * - * If this returns false, then V8 may decide that the object referred to by - * such a handle is reclaimed. In that case: - * - No action is required if handles are used with destructors. - * - When run without destructors (by specializing - * |TracedGlobalTrait::kRequiresExplicitDestruction|) V8 calls - * |ResetHandleInNonTracingGC|. - * - * Note that the |handle| is different from the |TracedGlobal| handle that - * the embedder holds for retaining the object. The embedder may use - * |TracedGlobal::WrapperClassId()| to distinguish cases where it wants - * handles to be treated as roots from not being treated as roots. + * See documentation on EmbedderRootsHandler. */ virtual bool IsRootForNonTracingGC( - const v8::TracedGlobal& handle) { - return true; - } + const v8::TracedReference& handle); + virtual bool IsRootForNonTracingGC(const v8::TracedGlobal& handle); /** - * Used in combination with |IsRootForNonTracingGC|. Called by V8 when an - * object that is backed by a handle is reclaimed by a non-tracing garbage - * collection. It is up to the embedder to reset the original handle. - * - * Note that the |handle| is different from the |TracedGlobal| handle that - * the embedder holds for retaining the object. It is up to the embedder to - * find the orignal |TracedGlobal| handle via the object or class id. + * See documentation on EmbedderRootsHandler. */ virtual void ResetHandleInNonTracingGC( - const v8::TracedGlobal& handle) {} + const v8::TracedReference& handle); /* * Called by the embedder to immediately perform a full garbage collection. @@ -7660,8 +8459,8 @@ class V8_EXPORT EmbedderHeapTracer { * serialized verbatim. */ struct SerializeInternalFieldsCallback { - typedef StartupData (*CallbackFunction)(Local holder, int index, - void* data); + using CallbackFunction = StartupData (*)(Local holder, int index, + void* data); SerializeInternalFieldsCallback(CallbackFunction function = nullptr, void* data_arg = nullptr) : callback(function), data(data_arg) {} @@ -7670,15 +8469,15 @@ struct SerializeInternalFieldsCallback { }; // Note that these fields are called "internal fields" in the API and called // "embedder fields" within V8. -typedef SerializeInternalFieldsCallback SerializeEmbedderFieldsCallback; +using SerializeEmbedderFieldsCallback = SerializeInternalFieldsCallback; /** * Callback and supporting data used to implement embedder logic to deserialize * internal fields. */ struct DeserializeInternalFieldsCallback { - typedef void (*CallbackFunction)(Local holder, int index, - StartupData payload, void* data); + using CallbackFunction = void (*)(Local holder, int index, + StartupData payload, void* data); DeserializeInternalFieldsCallback(CallbackFunction function = nullptr, void* data_arg = nullptr) : callback(function), data(data_arg) {} @@ -7686,7 +8485,68 @@ struct DeserializeInternalFieldsCallback { void* data); void* data; }; -typedef DeserializeInternalFieldsCallback DeserializeEmbedderFieldsCallback; +using DeserializeEmbedderFieldsCallback = DeserializeInternalFieldsCallback; + +/** + * Controls how the default MeasureMemoryDelegate reports the result of + * the memory measurement to JS. With kSummary only the total size is reported. + * With kDetailed the result includes the size of each native context. + */ +enum class MeasureMemoryMode { kSummary, kDetailed }; + +/** + * Controls how promptly a memory measurement request is executed. + * By default the measurement is folded with the next scheduled GC which may + * happen after a while and is forced after some timeout. + * The kEager mode starts incremental GC right away and is useful for testing. + * The kLazy mode does not force GC. + */ +enum class MeasureMemoryExecution { kDefault, kEager, kLazy }; + +/** + * The delegate is used in Isolate::MeasureMemory API. + * + * It specifies the contexts that need to be measured and gets called when + * the measurement is completed to report the results. + */ +class V8_EXPORT MeasureMemoryDelegate { + public: + virtual ~MeasureMemoryDelegate() = default; + + /** + * Returns true if the size of the given context needs to be measured. + */ + virtual bool ShouldMeasure(Local context) = 0; + + /** + * This function is called when memory measurement finishes. + * + * \param context_sizes_in_bytes a vector of (context, size) pairs that + * includes each context for which ShouldMeasure returned true and that + * was not garbage collected while the memory measurement was in progress. + * + * \param unattributed_size_in_bytes total size of objects that were not + * attributed to any context (i.e. are likely shared objects). + */ + virtual void MeasurementComplete( + const std::vector, size_t>>& + context_sizes_in_bytes, + size_t unattributed_size_in_bytes) = 0; + + /** + * Returns a default delegate that resolves the given promise when + * the memory measurement completes. + * + * \param isolate the current isolate + * \param context the current context + * \param promise_resolver the promise resolver that is given the + * result of the memory measurement. + * \param mode the detail level of the result. + */ + static std::unique_ptr Default( + Isolate* isolate, Local context, + Local promise_resolver, MeasureMemoryMode mode); +}; /** * Isolate represents an isolated instance of the V8 engine. V8 isolates have @@ -7701,23 +8561,15 @@ class V8_EXPORT Isolate { /** * Initial configuration parameters for a new Isolate. */ - struct CreateParams { - CreateParams() - : code_event_handler(nullptr), - snapshot_blob(nullptr), - counter_lookup_callback(nullptr), - create_histogram_callback(nullptr), - add_histogram_sample_callback(nullptr), - array_buffer_allocator(nullptr), - external_references(nullptr), - allow_atomics_wait(true), - only_terminate_in_safe_scope(false) {} + struct V8_EXPORT CreateParams { + CreateParams(); + ~CreateParams(); /** * Allows the host application to provide the address of a function that is * notified each time code is added, moved or removed. */ - JitCodeEventHandler code_event_handler; + JitCodeEventHandler code_event_handler = nullptr; /** * ResourceConstraints to use for the new Isolate. @@ -7727,14 +8579,13 @@ class V8_EXPORT Isolate { /** * Explicitly specify a startup snapshot blob. The embedder owns the blob. */ - StartupData* snapshot_blob; - + StartupData* snapshot_blob = nullptr; /** * Enables the host application to provide a mechanism for recording * statistics counters. */ - CounterLookupCallback counter_lookup_callback; + CounterLookupCallback counter_lookup_callback = nullptr; /** * Enables the host application to provide a mechanism for recording @@ -7742,14 +8593,20 @@ class V8_EXPORT Isolate { * histogram which will later be passed to the AddHistogramSample * function. */ - CreateHistogramCallback create_histogram_callback; - AddHistogramSampleCallback add_histogram_sample_callback; + CreateHistogramCallback create_histogram_callback = nullptr; + AddHistogramSampleCallback add_histogram_sample_callback = nullptr; /** * The ArrayBuffer::Allocator to use for allocating and freeing the backing * store of ArrayBuffers. + * + * If the shared_ptr version is used, the Isolate instance and every + * |BackingStore| allocated using this allocator hold a std::shared_ptr + * to the allocator, in order to facilitate lifetime + * management for the allocator instance. */ - ArrayBuffer::Allocator* array_buffer_allocator; + ArrayBuffer::Allocator* array_buffer_allocator = nullptr; + std::shared_ptr array_buffer_allocator_shared; /** * Specifies an optional nullptr-terminated array of raw addresses in the @@ -7757,26 +8614,38 @@ class V8_EXPORT Isolate { * deserialization. This array and its content must stay valid for the * entire lifetime of the isolate. */ - const intptr_t* external_references; + const intptr_t* external_references = nullptr; /** * Whether calling Atomics.wait (a function that may block) is allowed in * this isolate. This can also be configured via SetAllowAtomicsWait. */ - bool allow_atomics_wait; + bool allow_atomics_wait = true; /** * Termination is postponed when there is no active SafeForTerminationScope. */ - bool only_terminate_in_safe_scope; - }; + bool only_terminate_in_safe_scope = false; + /** + * The following parameters describe the offsets for addressing type info + * for wrapped API objects and are used by the fast C API + * (for details see v8-fast-api-calls.h). + */ + int embedder_wrapper_type_index = -1; + int embedder_wrapper_object_index = -1; + + V8_DEPRECATED( + "Setting this has no effect. Embedders should ignore import assertions " + "that they do not use.") + std::vector supported_import_assertions; + }; /** * Stack-allocated class which sets the isolate for all operations * executed within a local scope. */ - class V8_EXPORT Scope { + class V8_EXPORT V8_NODISCARD Scope { public: explicit Scope(Isolate* isolate) : isolate_(isolate) { isolate->Enter(); @@ -7792,11 +8661,10 @@ class V8_EXPORT Isolate { Isolate* const isolate_; }; - /** * Assert that no Javascript code is invoked. */ - class V8_EXPORT DisallowJavascriptExecutionScope { + class V8_EXPORT V8_NODISCARD DisallowJavascriptExecutionScope { public: enum OnFailure { CRASH_ON_FAILURE, THROW_ON_FAILURE, DUMP_ON_FAILURE }; @@ -7811,14 +8679,17 @@ class V8_EXPORT Isolate { private: OnFailure on_failure_; - void* internal_; - }; + Isolate* isolate_; + bool was_execution_allowed_assert_; + bool was_execution_allowed_throws_; + bool was_execution_allowed_dump_; + }; /** * Introduce exception to DisallowJavascriptExecutionScope. */ - class V8_EXPORT AllowJavascriptExecutionScope { + class V8_EXPORT V8_NODISCARD AllowJavascriptExecutionScope { public: explicit AllowJavascriptExecutionScope(Isolate* isolate); ~AllowJavascriptExecutionScope(); @@ -7830,18 +8701,20 @@ class V8_EXPORT Isolate { const AllowJavascriptExecutionScope&) = delete; private: - void* internal_throws_; - void* internal_assert_; - void* internal_dump_; + Isolate* isolate_; + bool was_execution_allowed_assert_; + bool was_execution_allowed_throws_; + bool was_execution_allowed_dump_; }; /** * Do not run microtasks while this scope is active, even if microtasks are * automatically executed otherwise. */ - class V8_EXPORT SuppressMicrotaskExecutionScope { + class V8_EXPORT V8_NODISCARD SuppressMicrotaskExecutionScope { public: - explicit SuppressMicrotaskExecutionScope(Isolate* isolate); + explicit SuppressMicrotaskExecutionScope( + Isolate* isolate, MicrotaskQueue* microtask_queue = nullptr); ~SuppressMicrotaskExecutionScope(); // Prevent copying of Scope objects. @@ -7852,22 +8725,17 @@ class V8_EXPORT Isolate { private: internal::Isolate* const isolate_; + internal::MicrotaskQueue* const microtask_queue_; internal::Address previous_stack_height_; - static_assert(sizeof(internal::Address) == - sizeof(internal::MicrotaskQueue*) && - alignof(internal::Address) == - alignof(internal::MicrotaskQueue*), - "The previous_stack_height_ field can replace the " - "microtask_queue_ field ABI-wise"); friend class internal::ThreadLocalTop; }; /** * This scope allows terminations inside direct V8 API calls and forbid them - * inside any recursice API calls without explicit SafeForTerminationScope. + * inside any recursive API calls without explicit SafeForTerminationScope. */ - class V8_EXPORT SafeForTerminationScope { + class V8_EXPORT V8_NODISCARD SafeForTerminationScope { public: explicit SafeForTerminationScope(v8::Isolate* isolate); ~SafeForTerminationScope(); @@ -7926,8 +8794,8 @@ class V8_EXPORT Isolate { kArrayInstanceProtoModified = 27, kArrayInstanceConstructorModified = 28, kLegacyFunctionDeclaration = 29, - kRegExpPrototypeSourceGetter = 30, - kRegExpPrototypeOldFlagGetter = 31, + kRegExpPrototypeSourceGetter = 30, // Unused. + kRegExpPrototypeOldFlagGetter = 31, // Unused. kDecimalWithLeadingZeroInStrictMode = 32, kLegacyDateParser = 33, kDefineGetterOrSetterWouldThrow = 34, @@ -7948,8 +8816,8 @@ class V8_EXPORT Isolate { kFunctionTokenOffsetTooLongForToString = 49, kWasmSharedMemory = 50, kWasmThreadOpcodes = 51, - kAtomicsNotify = 52, - kAtomicsWake = 53, + kAtomicsNotify = 52, // Unused. + kAtomicsWake = 53, // Unused. kCollator = 54, kNumberFormat = 55, kDateTimeFormat = 56, @@ -7967,14 +8835,48 @@ class V8_EXPORT Isolate { kDateToLocaleTimeString = 68, kAttemptOverrideReadOnlyOnPrototypeSloppy = 69, kAttemptOverrideReadOnlyOnPrototypeStrict = 70, - kOptimizedFunctionWithOneShotBytecode = 71, + kOptimizedFunctionWithOneShotBytecode = 71, // Unused. kRegExpMatchIsTrueishOnNonJSRegExp = 72, kRegExpMatchIsFalseishOnJSRegExp = 73, - kDateGetTimezoneOffset = 74, + kDateGetTimezoneOffset = 74, // Unused. kStringNormalize = 75, kCallSiteAPIGetFunctionSloppyCall = 76, kCallSiteAPIGetThisSloppyCall = 77, kRegExpMatchAllWithNonGlobalRegExp = 78, + kRegExpExecCalledOnSlowRegExp = 79, + kRegExpReplaceCalledOnSlowRegExp = 80, + kDisplayNames = 81, + kSharedArrayBufferConstructed = 82, + kArrayPrototypeHasElements = 83, + kObjectPrototypeHasElements = 84, + kNumberFormatStyleUnit = 85, + kDateTimeFormatRange = 86, + kDateTimeFormatDateTimeStyle = 87, + kBreakIteratorTypeWord = 88, + kBreakIteratorTypeLine = 89, + kInvalidatedArrayBufferDetachingProtector = 90, + kInvalidatedArrayConstructorProtector = 91, + kInvalidatedArrayIteratorLookupChainProtector = 92, + kInvalidatedArraySpeciesLookupChainProtector = 93, + kInvalidatedIsConcatSpreadableLookupChainProtector = 94, + kInvalidatedMapIteratorLookupChainProtector = 95, + kInvalidatedNoElementsProtector = 96, + kInvalidatedPromiseHookProtector = 97, + kInvalidatedPromiseResolveLookupChainProtector = 98, + kInvalidatedPromiseSpeciesLookupChainProtector = 99, + kInvalidatedPromiseThenLookupChainProtector = 100, + kInvalidatedRegExpSpeciesLookupChainProtector = 101, + kInvalidatedSetIteratorLookupChainProtector = 102, + kInvalidatedStringIteratorLookupChainProtector = 103, + kInvalidatedStringLengthOverflowLookupChainProtector = 104, + kInvalidatedTypedArraySpeciesLookupChainProtector = 105, + kWasmSimdOpcodes = 106, + kVarRedeclaredCatchBinding = 107, + kWasmRefTypes = 108, + kWasmBulkMemory = 109, // Unused. + kWasmMultiValue = 110, + kWasmExceptionHandling = 111, + kInvalidatedMegaDOMProtector = 112, // If you add new values here, you'll also need to update Chromium's: // web_feature.mojom, use_counter_callback.cc, and enums.xml. V8 changes to @@ -7992,8 +8894,8 @@ class V8_EXPORT Isolate { kMessageWarning, }; - typedef void (*UseCounterCallback)(Isolate* isolate, - UseCounterFeature feature); + using UseCounterCallback = void (*)(Isolate* isolate, + UseCounterFeature feature); /** * Allocates a new isolate but does not initialize it. Does not change the @@ -8035,15 +8937,26 @@ class V8_EXPORT Isolate { */ static Isolate* GetCurrent(); + /** + * Returns the entered isolate for the current thread or NULL in + * case there is no current isolate. + * + * No checks are performed by this method. + */ + static Isolate* TryGetCurrent(); + /** * Clears the set of objects held strongly by the heap. This set of * objects are originally built when a WeakRef is created or * successfully dereferenced. * - * The embedder is expected to call this when a synchronous sequence - * of ECMAScript execution completes. It's the embedders - * responsiblity to make this call at a time which does not - * interrupt synchronous ECMAScript code execution. + * This is invoked automatically after microtasks are run. See + * MicrotasksPolicy for when microtasks are run. + * + * This needs to be manually invoked only if the embedder is manually running + * microtasks via a custom MicrotaskQueue class's PerformCheckpoint. In that + * case, it is the embedder's responsibility to make this call at a time which + * does not interrupt synchronous ECMAScript code execution. */ void ClearKeptObjects(); @@ -8056,27 +8969,29 @@ class V8_EXPORT Isolate { * - the custom callback set returns true. * Otherwise, the custom callback will not be called and V8 will not abort. */ - typedef bool (*AbortOnUncaughtExceptionCallback)(Isolate*); + using AbortOnUncaughtExceptionCallback = bool (*)(Isolate*); void SetAbortOnUncaughtExceptionCallback( AbortOnUncaughtExceptionCallback callback); /** - * This specifies the callback to be called when finalization groups - * are ready to be cleaned up and require FinalizationGroup::Cleanup() - * to be called in a future task. + * This specifies the callback called by the upcoming dynamic + * import() language feature to load modules. */ - void SetHostCleanupFinalizationGroupCallback( - HostCleanupFinalizationGroupCallback callback); + V8_DEPRECATED( + "Use the version of SetHostImportModuleDynamicallyCallback that takes a " + "HostImportModuleDynamicallyWithImportAssertionsCallback instead") + void SetHostImportModuleDynamicallyCallback( + HostImportModuleDynamicallyCallback callback); /** * This specifies the callback called by the upcoming dynamic * import() language feature to load modules. */ void SetHostImportModuleDynamicallyCallback( - HostImportModuleDynamicallyCallback callback); + HostImportModuleDynamicallyWithImportAssertionsCallback callback); /** - * This specifies the callback called by the upcoming importa.meta + * This specifies the callback called by the upcoming import.meta * language feature to retrieve host-defined meta data for a module. */ void SetHostInitializeImportMetaObjectCallback( @@ -8096,6 +9011,13 @@ class V8_EXPORT Isolate { */ void MemoryPressureNotification(MemoryPressureLevel level); + /** + * Drop non-essential caches. Should only be called from testing code. + * The method can potentially block for a long time and does not necessarily + * trigger GC. + */ + void ClearCachesForTesting(); + /** * Methods below this point require holding a lock (using Locker) in * a multi-threaded environment. @@ -8206,11 +9128,31 @@ class V8_EXPORT Isolate { /** * Get statistics about code and its metadata in the heap. * - * \param object_statistics The HeapCodeStatistics object to fill in - * statistics of code, bytecode and their metadata. - * \returns true on success. + * \param object_statistics The HeapCodeStatistics object to fill in + * statistics of code, bytecode and their metadata. + * \returns true on success. + */ + bool GetHeapCodeAndMetadataStatistics(HeapCodeStatistics* object_statistics); + + /** + * This API is experimental and may change significantly. + * + * Enqueues a memory measurement request and invokes the delegate with the + * results. + * + * \param delegate the delegate that defines which contexts to measure and + * reports the results. + * + * \param execution promptness executing the memory measurement. + * The kEager value is expected to be used only in tests. */ - bool GetHeapCodeAndMetadataStatistics(HeapCodeStatistics* object_statistics); + bool MeasureMemory( + std::unique_ptr delegate, + MeasureMemoryExecution execution = MeasureMemoryExecution::kDefault); + + V8_DEPRECATED("Use the version with a delegate") + MaybeLocal MeasureMemory(Local context, + MeasureMemoryMode mode); /** * Get a call stack sample from the isolate. @@ -8240,8 +9182,7 @@ class V8_EXPORT Isolate { * kept alive by JavaScript objects. * \returns the adjusted value. */ - V8_INLINE int64_t - AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes); + int64_t AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes); /** * Returns the number of phantom handles without callbacks that were reset @@ -8272,10 +9213,6 @@ class V8_EXPORT Isolate { */ Local GetCurrentContext(); - /** Returns the last context entered through V8's C++ API. */ - V8_DEPRECATED("Use GetEnteredOrMicrotaskContext().", - Local GetEnteredContext()); - /** * Returns either the last context entered through V8's C++ API, or the * context of the currently running microtask while processing microtasks. @@ -8290,6 +9227,17 @@ class V8_EXPORT Isolate { */ Local GetIncumbentContext(); + /** + * Schedules a v8::Exception::Error with the given message. + * See ThrowException for more details. Templatized to provide compile-time + * errors in case of too long strings (see v8::String::NewFromUtf8Literal). + */ + template + Local ThrowError(const char (&message)[N]) { + return ThrowError(String::NewFromUtf8Literal(this, message)); + } + Local ThrowError(Local message); + /** * Schedules an exception to be thrown when returning to JavaScript. When an * exception has been scheduled it is illegal to invoke any JavaScript @@ -8298,10 +9246,10 @@ class V8_EXPORT Isolate { */ Local ThrowException(Local exception); - typedef void (*GCCallback)(Isolate* isolate, GCType type, - GCCallbackFlags flags); - typedef void (*GCCallbackWithData)(Isolate* isolate, GCType type, - GCCallbackFlags flags, void* data); + using GCCallback = void (*)(Isolate* isolate, GCType type, + GCCallbackFlags flags); + using GCCallbackWithData = void (*)(Isolate* isolate, GCType type, + GCCallbackFlags flags, void* data); /** * Enables the host application to receive a notification before a @@ -8334,6 +9282,42 @@ class V8_EXPORT Isolate { */ EmbedderHeapTracer* GetEmbedderHeapTracer(); + /** + * Sets an embedder roots handle that V8 should consider when performing + * non-unified heap garbage collections. + * + * Using only EmbedderHeapTracer automatically sets up a default handler. + * The intended use case is for setting a custom handler after invoking + * `AttachCppHeap()`. + * + * V8 does not take ownership of the handler. + */ + void SetEmbedderRootsHandler(EmbedderRootsHandler* handler); + + /** + * Attaches a managed C++ heap as an extension to the JavaScript heap. The + * embedder maintains ownership of the CppHeap. At most one C++ heap can be + * attached to V8. + * + * This is an experimental feature and may still change significantly. + */ + void AttachCppHeap(CppHeap*); + + /** + * Detaches a managed C++ heap if one was attached using `AttachCppHeap()`. + * + * This is an experimental feature and may still change significantly. + */ + void DetachCppHeap(); + + /** + * This is an experimental feature and may still change significantly. + + * \returns the C++ heap managed by V8. Only available if such a heap has been + * attached using `AttachCppHeap()`. + */ + CppHeap* GetCppHeap() const; + /** * Use for |AtomicsWaitCallback| to indicate the type of event it receives. */ @@ -8398,12 +9382,12 @@ class V8_EXPORT Isolate { * This callback may schedule exceptions, *unless* |event| is equal to * |kTerminatedExecution|. */ - typedef void (*AtomicsWaitCallback)(AtomicsWaitEvent event, - Local array_buffer, - size_t offset_in_bytes, int64_t value, - double timeout_in_ms, - AtomicsWaitWakeHandle* stop_handle, - void* data); + using AtomicsWaitCallback = void (*)(AtomicsWaitEvent event, + Local array_buffer, + size_t offset_in_bytes, int64_t value, + double timeout_in_ms, + AtomicsWaitWakeHandle* stop_handle, + void* data); /** * Set a new |AtomicsWaitCallback|. This overrides an earlier @@ -8435,7 +9419,7 @@ class V8_EXPORT Isolate { void* data = nullptr); void RemoveGCEpilogueCallback(GCCallback callback); - typedef size_t (*GetExternallyAllocatedMemoryInBytesCallback)(); + using GetExternallyAllocatedMemoryInBytesCallback = size_t (*)(); /** * Set the callback that tells V8 how much memory is currently allocated @@ -8491,6 +9475,13 @@ class V8_EXPORT Isolate { */ void RequestInterrupt(InterruptCallback callback, void* data); + /** + * Returns true if there is ongoing background work within V8 that will + * eventually post a foreground task, like asynchronous WebAssembly + * compilation. + */ + bool HasPendingBackgroundTasks(); + /** * Request garbage collection in this Isolate. It is only valid to call this * function if --expose_gc was specified. @@ -8548,10 +9539,12 @@ class V8_EXPORT Isolate { void SetPromiseRejectCallback(PromiseRejectCallback callback); /** - * Runs the default MicrotaskQueue until it gets empty. - * Any exceptions thrown by microtask callbacks are swallowed. + * Runs the default MicrotaskQueue until it gets empty and perform other + * microtask checkpoint steps, such as calling ClearKeptObjects. Asserts that + * the MicrotasksPolicy is not kScoped. Any exceptions thrown by microtask + * callbacks are swallowed. */ - void RunMicrotasks(); + void PerformMicrotaskCheckpoint(); /** * Enqueues the callback to the default MicrotaskQueue @@ -8586,18 +9579,12 @@ class V8_EXPORT Isolate { * Executing scripts inside the callback will not re-trigger microtasks and * the callback. */ - V8_DEPRECATE_SOON("Use *WithData version.", - void AddMicrotasksCompletedCallback( - MicrotasksCompletedCallback callback)); void AddMicrotasksCompletedCallback( MicrotasksCompletedCallbackWithData callback, void* data = nullptr); /** * Removes callback that was installed by AddMicrotasksCompletedCallback. */ - V8_DEPRECATE_SOON("Use *WithData version.", - void RemoveMicrotasksCompletedCallback( - MicrotasksCompletedCallback callback)); void RemoveMicrotasksCompletedCallback( MicrotasksCompletedCallbackWithData callback, void* data = nullptr); @@ -8621,6 +9608,18 @@ class V8_EXPORT Isolate { void SetCreateHistogramFunction(CreateHistogramCallback); void SetAddHistogramSampleFunction(AddHistogramSampleCallback); + /** + * Enables the host application to provide a mechanism for recording + * event based metrics. In order to use this interface + * include/v8-metrics.h + * needs to be included and the recorder needs to be derived from the + * Recorder base class defined there. + * This method can only be called once per isolate and must happen during + * isolate initialization before background threads are spawned. + */ + void SetMetricsRecorder( + const std::shared_ptr& metrics_recorder); + /** * Enables the host application to provide a mechanism for recording a * predefined set of data as crash keys to be used in postmortem debugging in @@ -8651,10 +9650,10 @@ class V8_EXPORT Isolate { void LowMemoryNotification(); /** - * Optional notification that a context has been disposed. V8 uses - * these notifications to guide the GC heuristic. Returns the number - * of context disposals - including this one - since the last time - * V8 had a chance to clean up. + * Optional notification that a context has been disposed. V8 uses these + * notifications to guide the GC heuristic and cancel FinalizationRegistry + * cleanup tasks. Returns the number of context disposals - including this one + * - since the last time V8 had a chance to clean up. * * The optional parameter |dependant_context| specifies whether the disposed * context was depending on state from other contexts or not. @@ -8694,6 +9693,11 @@ class V8_EXPORT Isolate { */ void SetRAILMode(RAILMode rail_mode); + /** + * Update load start time of the RAIL mode + */ + void UpdateLoadStartTime(); + /** * Optional notification to tell V8 the current isolate is used for debugging * and requires higher heap limit. @@ -8765,9 +9769,32 @@ class V8_EXPORT Isolate { void GetCodeRange(void** start, size_t* length_in_bytes); /** - * Returns the UnwindState necessary for use with the Unwinder API. + * As GetCodeRange, but for embedded builtins (these live in a distinct + * memory region from other V8 Code objects). + */ + void GetEmbeddedCodeRange(const void** start, size_t* length_in_bytes); + + /** + * Returns the JSEntryStubs necessary for use with the Unwinder API. + */ + JSEntryStubs GetJSEntryStubs(); + + static constexpr size_t kMinCodePagesBufferSize = 32; + + /** + * Copies the code heap pages currently in use by V8 into |code_pages_out|. + * |code_pages_out| must have at least kMinCodePagesBufferSize capacity and + * must be empty. + * + * Signal-safe, does not allocate, does not access the V8 heap. + * No code on the stack can rely on pages that might be missing. + * + * Returns the number of pages available to be copied, which might be greater + * than |capacity|. In this case, only |capacity| pages will be copied into + * |code_pages_out|. The caller should provide a bigger buffer on the next + * call in order to get all available code pages, but this is not required. */ - UnwindState GetUnwindState(); + size_t CopyCodePages(size_t capacity, MemoryRange* code_pages_out); /** Set the callback to invoke in case of fatal errors. */ void SetFatalErrorHandler(FatalErrorCallback that); @@ -8804,10 +9831,15 @@ class V8_EXPORT Isolate { * Set the callback to invoke to check if code generation from * strings should be allowed. */ - void SetAllowCodeGenerationFromStringsCallback( - AllowCodeGenerationFromStringsCallback callback); + V8_DEPRECATED( + "Use Isolate::SetModifyCodeGenerationFromStringsCallback with " + "ModifyCodeGenerationFromStringsCallback2 instead. See " + "http://crbug.com/1096017 and TC39 Dynamic Code Brand Checks proposal " + "at https://github.com/tc39/proposal-dynamic-code-brand-checks.") void SetModifyCodeGenerationFromStringsCallback( ModifyCodeGenerationFromStringsCallback callback); + void SetModifyCodeGenerationFromStringsCallback( + ModifyCodeGenerationFromStringsCallback2 callback); /** * Set the callback to invoke to check if wasm code generation should @@ -8825,10 +9857,22 @@ class V8_EXPORT Isolate { void SetWasmStreamingCallback(WasmStreamingCallback callback); - void SetWasmThreadsEnabledCallback(WasmThreadsEnabledCallback callback); - void SetWasmLoadSourceMapCallback(WasmLoadSourceMapCallback callback); + void SetWasmSimdEnabledCallback(WasmSimdEnabledCallback callback); + + void SetWasmExceptionsEnabledCallback(WasmExceptionsEnabledCallback callback); + + void SetSharedArrayBufferConstructorEnabledCallback( + SharedArrayBufferConstructorEnabledCallback callback); + + /** + * This function can be called by the embedder to signal V8 that the dynamic + * enabling of features has finished. V8 can now set up dynamically added + * features. + */ + void InstallConditionalFeatures(Local context); + /** * Check if V8 is dead and therefore unusable. This is the case after * fatal errors such as out-of-memory situations. @@ -8967,7 +10011,6 @@ class V8_EXPORT Isolate { internal::Address* GetDataFromSnapshotOnce(size_t index); void ReportExternalAllocationLimitReached(); - void CheckMemoryPressure(); }; class V8_EXPORT StartupData { @@ -8978,17 +10021,21 @@ class V8_EXPORT StartupData { * Only valid for StartupData returned by SnapshotCreator::CreateBlob(). */ bool CanBeRehashed() const; + /** + * Allows embedders to verify whether the data is valid for the current + * V8 instance. + */ + bool IsValid() const; const char* data; int raw_size; }; - /** * EntropySource is used as a callback function when v8 needs a source * of entropy. */ -typedef bool (*EntropySource)(unsigned char* buffer, size_t length); +using EntropySource = bool (*)(unsigned char* buffer, size_t length); /** * ReturnAddressLocationResolver is used as a callback function when v8 is @@ -9003,9 +10050,8 @@ typedef bool (*EntropySource)(unsigned char* buffer, size_t length); * * \note The resolver function must not cause garbage collection. */ -typedef uintptr_t (*ReturnAddressLocationResolver)( - uintptr_t return_addr_location); - +using ReturnAddressLocationResolver = + uintptr_t (*)(uintptr_t return_addr_location); /** * Container class for static utility functions. @@ -9027,7 +10073,6 @@ class V8_EXPORT V8 { * handled entirely on the embedders' side. * - The call will abort if the data is invalid. */ - static void SetNativesDataBlob(StartupData* startup_blob); static void SetSnapshotDataBlob(StartupData* startup_blob); /** Set the callback to invoke in case of Dcheck failures. */ @@ -9038,7 +10083,7 @@ class V8_EXPORT V8 { * Sets V8 flags from a string. */ static void SetFlagsFromString(const char* str); - static void SetFlagsFromString(const char* str, int length); + static void SetFlagsFromString(const char* str, size_t length); /** * Sets V8 flags from the command line. @@ -9054,7 +10099,13 @@ class V8_EXPORT V8 { * Initializes V8. This function needs to be called before the first Isolate * is created. It always returns true. */ - static bool Initialize(); + V8_INLINE static bool Initialize() { + const int kBuildConfiguration = + (internal::PointerCompressionIsEnabled() ? kPointerCompression : 0) | + (internal::SmiValuesAre31Bits() ? k31BitSmis : 0) | + (internal::HeapSandboxIsEnabled() ? kHeapSandbox : 0); + return Initialize(kBuildConfiguration); + } /** * Allows the host application to provide a callback which can be used @@ -9112,17 +10163,16 @@ class V8_EXPORT V8 { * V8 needs to be given those external files during startup. There are * three ways to do this: * - InitializeExternalStartupData(const char*) - * This will look in the given directory for files "natives_blob.bin" - * and "snapshot_blob.bin" - which is what the default build calls them. - * - InitializeExternalStartupData(const char*, const char*) - * As above, but will directly use the two given file names. - * - Call SetNativesDataBlob, SetNativesDataBlob. - * This will read the blobs from the given data structures and will + * This will look in the given directory for the file "snapshot_blob.bin". + * - InitializeExternalStartupDataFromFile(const char*) + * As above, but will directly use the given file name. + * - Call SetSnapshotDataBlob. + * This will read the blobs from the given data structure and will * not perform any file IO. */ static void InitializeExternalStartupData(const char* directory_path); - static void InitializeExternalStartupData(const char* natives_blob, - const char* snapshot_blob); + static void InitializeExternalStartupDataFromFile(const char* snapshot_blob); + /** * Sets the v8::Platform to use. This should be invoked before V8 is * initialized. @@ -9155,9 +10205,8 @@ class V8_EXPORT V8 { * \param context The third argument passed to the Linux signal handler, which * points to a ucontext_t structure. */ - V8_DEPRECATE_SOON("Use TryHandleWebAssemblyTrapPosix", - static bool TryHandleSignal(int signal_number, void* info, - void* context)); + V8_DEPRECATED("Use TryHandleWebAssemblyTrapPosix") + static bool TryHandleSignal(int signal_number, void* info, void* context); #endif // V8_OS_POSIX /** @@ -9182,9 +10231,35 @@ class V8_EXPORT V8 { UnhandledExceptionCallback unhandled_exception_callback); #endif + /** + * Get statistics about the shared memory usage. + */ + static void GetSharedMemoryStatistics(SharedMemoryStatistics* statistics); + + /** + * Notifies V8 that the process is cross-origin-isolated, which enables + * defining the SharedArrayBuffer function on the global object of Contexts. + */ + V8_DEPRECATED( + "Use the command line argument --enable-sharedarraybuffer-per-context " + "together with SetSharedArrayBufferConstructorEnabledCallback") + static void SetIsCrossOriginIsolated(); + private: V8(); + enum BuildConfigurationFeatures { + kPointerCompression = 1 << 0, + k31BitSmis = 1 << 1, + kHeapSandbox = 1 << 2, + }; + + /** + * Checks that the embedder build configuration is compatible with + * the V8 binary and if so initializes V8. + */ + static bool Initialize(int build_config); + static internal::Address* GlobalizeReference(internal::Isolate* isolate, internal::Address* handle); static internal::Address* GlobalizeTracedReference(internal::Isolate* isolate, @@ -9212,9 +10287,6 @@ class V8_EXPORT V8 { const char* label); static Value* Eternalize(Isolate* isolate, Value* handle); - static void RegisterExternallyReferencedObject(internal::Address* location, - internal::Isolate* isolate); - template friend class PersistentValueMapBase; @@ -9222,6 +10294,8 @@ class V8_EXPORT V8 { static void ToLocalEmpty(); static void InternalFieldOutOfBounds(int index); template + friend class BasicTracedReference; + template friend class Global; template friend class Local; template @@ -9230,6 +10304,9 @@ class V8_EXPORT V8 { friend class Maybe; template friend class TracedGlobal; + friend class TracedReferenceBase; + template + friend class TracedReference; template friend class WeakCallbackInfo; template friend class Eternal; @@ -9240,6 +10317,11 @@ class V8_EXPORT V8 { /** * Helper class to create a snapshot data blob. + * + * The Isolate used by a SnapshotCreator is owned by it, and will be entered + * and exited by the constructor and destructor, respectively; The destructor + * will also destroy the Isolate. Experimental language features, including + * those available by default, are not available while creating a snapshot. */ class V8_EXPORT SnapshotCreator { public: @@ -9268,6 +10350,10 @@ class V8_EXPORT SnapshotCreator { SnapshotCreator(const intptr_t* external_references = nullptr, StartupData* existing_blob = nullptr); + /** + * Destroy the snapshot creator, and exit and dispose of the Isolate + * associated with it. + */ ~SnapshotCreator(); /** @@ -9298,12 +10384,6 @@ class V8_EXPORT SnapshotCreator { SerializeInternalFieldsCallback callback = SerializeInternalFieldsCallback()); - /** - * Add a template to be included in the snapshot blob. - * \returns the index of the template in the snapshot blob. - */ - size_t AddTemplate(Local