Skip to content

Commit

Permalink
core: update nodejs-mobile v0.3.2
Browse files Browse the repository at this point in the history
Update the libnode binaries to v0.3.2 release.
Update the libnode headers.
  • Loading branch information
jaimecbernardo committed Nov 1, 2020
1 parent 8f21926 commit 7b78448
Show file tree
Hide file tree
Showing 73 changed files with 5,453 additions and 85 deletions.
Binary file modified libs/android/libnode/bin/arm64-v8a/libnode.so.gz
Binary file not shown.
Binary file modified libs/android/libnode/bin/armeabi-v7a/libnode.so.gz
Binary file not shown.
Binary file modified libs/android/libnode/bin/x86/libnode.so.gz
Binary file not shown.
Binary file modified libs/android/libnode/bin/x86_64/libnode.so.gz
Binary file not shown.
21 changes: 18 additions & 3 deletions libs/android/libnode/include/node/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

# 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.35',
'v8_embedder_string': '-node.44',

##### V8 defaults for Node.js #####

Expand All @@ -55,6 +55,9 @@
# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,

# Sets -dOBJECT_PRINT.
'v8_enable_object_print%': 1,

# https://github.com/nodejs/node/pull/22920/files#r222779926
'v8_enable_handle_zapping': 0,

Expand Down Expand Up @@ -235,7 +238,10 @@
'RuntimeLibrary': '<(MSVC_runtimeType)',
'RuntimeTypeInfo': 'false',
}
}
},
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '3', # stop gyp from defaulting to -Os
},
}
},

Expand Down Expand Up @@ -315,8 +321,9 @@
'cflags+': [
'-fno-omit-frame-pointer',
'-fsanitize=address',
'-DLEAK_SANITIZER'
'-fsanitize-address-use-after-scope',
],
'defines': [ 'LEAK_SANITIZER', 'V8_USE_ADDRESS_SANITIZER' ],
'cflags!': [ '-fomit-frame-pointer' ],
'ldflags': [ '-fsanitize=address' ],
}],
Expand Down Expand Up @@ -510,6 +517,14 @@
['target_arch=="x64"', {
'xcode_settings': {'ARCHS': ['x86_64']},
}],
['target_arch=="arm64"', {
'xcode_settings': {
'ARCHS': ['arm64'],
'OTHER_LDFLAGS!': [
'-Wl,-no_pie',
],
},
}],
['clang==1', {
'xcode_settings': {
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
Expand Down
9 changes: 5 additions & 4 deletions libs/android/libnode/include/node/config.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'asan': 0,
'build_v8_with_gn': 'false',
'coverage': 'false',
'dcheck_always_on': 0,
'debug_nghttp2': 'false',
'debug_node': 'false',
'enable_lto': 'false',
Expand All @@ -18,7 +19,7 @@
'icu_small': 'false',
'is_debug': 0,
'llvm_version': '0.0',
'napi_build_version': '5',
'napi_build_version': '7',
'node_byteorder': 'little',
'node_debug_lib': 'false',
'node_enable_d8': 'false',
Expand All @@ -27,7 +28,6 @@
'node_no_browser_globals': 'false',
'node_prefix': '/',
'node_release_urlbase': '',
'node_report': 'true',
'node_shared': 'true',
'node_shared_brotli': 'false',
'node_shared_cares': 'false',
Expand All @@ -41,8 +41,6 @@
'node_use_bundled_v8': 'true',
'node_use_dtrace': 'false',
'node_use_etw': 'false',
'node_use_large_pages': 'false',
'node_use_large_pages_script_lld': 'false',
'node_use_node_code_cache': 'false',
'node_use_node_snapshot': 'false',
'node_use_openssl': 'true',
Expand All @@ -52,11 +50,14 @@
'openssl_fips': '',
'openssl_is_fips': 'false',
'openssl_no_asm': 1,
'ossfuzz': 'false',
'shlib_suffix': 'so',
'target_arch': 'arm64',
'v8_enable_gdbjit': 0,
'v8_enable_i18n_support': 0,
'v8_enable_inspector': 0,
'v8_enable_lite_mode': 0,
'v8_enable_object_print': 1,
'v8_no_strict_aliasing': 1,
'v8_optimized_debug': 1,
'v8_promise_internal_field_count': 1,
Expand Down
34 changes: 31 additions & 3 deletions libs/android/libnode/include/node/js_native_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// This file needs to be compatible with C compilers.
#include <stddef.h> // NOLINT(modernize-deprecated-headers)
#include <stdbool.h> // NOLINT(modernize-deprecated-headers)
#include "js_native_api_types.h"

// Use INT_MAX, this should only be consumed by the pre-processor anyway.
#define NAPI_VERSION_EXPERIMENTAL 2147483647
Expand All @@ -18,15 +17,20 @@
// 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 5
#define NAPI_VERSION 7
#endif
#endif

#include "js_native_api_types.h"

// If you need __declspec(dllimport), either include <node_api.h> 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
Expand Down Expand Up @@ -478,7 +482,7 @@ NAPI_EXTERN napi_status napi_add_finalizer(napi_env env,

#endif // NAPI_VERSION >= 5

#ifdef NAPI_EXPERIMENTAL
#if NAPI_VERSION >= 6

// BigInt
NAPI_EXTERN napi_status napi_create_bigint_int64(napi_env env,
Expand Down Expand Up @@ -506,6 +510,15 @@ NAPI_EXTERN napi_status napi_get_value_bigint_words(napi_env env,
size_t* word_count,
uint64_t* words);

// Object
NAPI_EXTERN napi_status
napi_get_all_property_names(napi_env env,
napi_value object,
napi_key_collection_mode key_mode,
napi_key_filter key_filter,
napi_key_conversion key_conversion,
napi_value* result);

// Instance data
NAPI_EXTERN napi_status napi_set_instance_data(napi_env env,
void* data,
Expand All @@ -514,14 +527,29 @@ NAPI_EXTERN napi_status napi_set_instance_data(napi_env env,

NAPI_EXTERN napi_status 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_is_detached_arraybuffer(napi_env env,
napi_value value,
bool* result);
#endif // NAPI_VERSION >= 7

#ifdef NAPI_EXPERIMENTAL
// 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_check_object_type_tag(napi_env env,
napi_value value,
const napi_type_tag* type_tag,
bool* result);
#endif // NAPI_EXPERIMENTAL

EXTERN_C_END
Expand Down
28 changes: 28 additions & 0 deletions libs/android/libnode/include/node/js_native_api_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,32 @@ typedef struct {
napi_status error_code;
} napi_extended_error_info;

#if NAPI_VERSION >= 6
typedef enum {
napi_key_include_prototypes,
napi_key_own_only
} napi_key_collection_mode;

typedef enum {
napi_key_all_properties = 0,
napi_key_writable = 1,
napi_key_enumerable = 1 << 1,
napi_key_configurable = 1 << 2,
napi_key_skip_strings = 1 << 3,
napi_key_skip_symbols = 1 << 4
} napi_key_filter;

typedef enum {
napi_key_keep_numbers,
napi_key_numbers_to_strings
} napi_key_conversion;
#endif // NAPI_VERSION >= 6

#ifdef NAPI_EXPERIMENTAL
typedef struct {
uint64_t lower;
uint64_t upper;
} napi_type_tag;
#endif // NAPI_EXPERIMENTAL

#endif // SRC_JS_NATIVE_API_TYPES_H_
Loading

0 comments on commit 7b78448

Please sign in to comment.