Code Monkey home page Code Monkey logo

jsruntimehost's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jsruntimehost's Issues

V8 startup snapshot

V8 allows (looks more mandatory) to use snap shots. Basically, it's the content of V8 memory after code parsing. It should be faster to load. Can we use it with Babylon.js instead of providing .js files? is it faster? lower footprint?

URLSearchParams constructor implementation is incomplete

Describe the bug
URLSearchParams constructor is partially implemented, it does not support sequence of pairs and records. eg:

const params1 = new URLSearchParams([["foo", "1"], ["bar", "2"]]); (sequence of pairs)
const params2 = new URLSearchParams({ "foo": "1", "bar": "2" }); (records)

Expected behavior
Same behavior as the javascript URLSearchParams constructor

Other

  • Platform: Win32, Android, iOS

V8 warning propagation

V8 headers have some unused parameters

v8.h:599:54: error: unused parameter 'source' [-Werror,-Wunused-parameter]
    V8_INLINE static void Copy(const Persistent<S, M>& source,

Because of how it's included in env.h


Any project needing env.h with V8 will have build errors because of warnings_as_error CMake macro.
This didn't happen before because of the use of template (I think)
So, for (many) dependent project, a check is needed that looks like this in cmake:

# V8 and V8Inspector have unused parameters. Unable to set warning as error.
if(NOT NAPI_JAVASCRIPT_ENGINE STREQUAL "V8")
    warnings_as_errors(NativeOptimizations)
endif()

Is there a way to get more recent v8.h with fixed warning? Is it possible to remove v8.h to be included in env.h? Is it better to move that V8 check into warnings_as_errors CMake function?

UWP isn't currently able to work with V8

When building against UWP, while using V8 as the JavaScript engine, this code will not function properly. It appears that the reason for this is because the V8 files needed aren't being copied. If they are manually copied, things will work though debugging is still broken. A separate issue has been filed for that (#61)

When using UWP and V8, V8 debugging doesn't work

When building against UWP, while using V8, V8 debugging will not work. The projects will still build as long as the JSRUNTIMEHOST_CORE_APPRUNTIME_V8_INSPECTOR is disabled when the initial cmake project files are built.

Reported error has no details when script loading fails

When loading a script, if the loading fails due to a parse error or some other error, the error output is not detailed enough to determine what is wrong. Here is an example when running Chakra:

Microsoft C++ exception: UnifiedRegex::ParseError at memory location 0x0000005DEC96B6B0.
Microsoft C++ exception: ParseExceptionObject at memory location 0x0000005DEC968ED0.
Uncaught Error: Unknown failure

It is possible to figure out the problem by stopping at the first exception, but it would be much better if the error message included the line number and what failed.

V8 profiling

Following update on node-api, profile V8 to check for performance regression, in particular the use of private_key.
Spheres test in UnitTests can be a start.

I think more CPP tests that test a specific part of JSEngine<->CPP communication layer is the way to go.
From what I've seen so far, still with UnitTests, is most time taken by bgfx.

URL constructor implementation is incomplete

Describe the bug
URL constructor is partially implemented, it only supports one argument and the url parsing is limited. We should move the parsing to UrlLib and use platform specific functions to parse the URL and get the parts.

Expected behavior
Same behavior as the javascript URL constructor

Other

  • Platform: Win32, Android, iOS

Unit test for setTimeout is failing intermittently on Android CI

The should call the given functions in the correct order test sometimes fails on Android on CI. No other setTimeout tests are failing. Never seen this test fail locally or other platforms either.

Raw log from the CI:

2023-02-16T21:43:38.9335290Z ##[section]Starting: Dump logcat from Test Results
2023-02-16T21:43:38.9347900Z ==============================================================================
2023-02-16T21:43:38.9348570Z Task         : Command line
2023-02-16T21:43:38.9348980Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2023-02-16T21:43:38.9349570Z Version      : 2.212.0
2023-02-16T21:43:38.9350110Z Author       : Microsoft Corporation
2023-02-16T21:43:38.9350420Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2023-02-16T21:43:38.9350820Z ==============================================================================
2023-02-16T21:43:39.2302390Z Generating script.
2023-02-16T21:43:39.2324190Z ========================== Starting Command Output ===========================
2023-02-16T21:43:39.2364560Z [command]/bin/bash --noprofile --norc /Users/runner/work/_temp/8a7a4a30-3378-498d-86f3-55d1e932ead6.sh
2023-02-16T21:43:39.2996660Z cat ./app/build/outputs/androidTest-results/connected/Pixel_API_27(AVD) - 8.1.0/logcat-com.jsruntimehost.unittests.Main-javaScriptTests.txt
2023-02-16T21:43:39.3094560Z 02-16 21:43:28.283  3170  3186 I TestRunner: started: javaScriptTests(com.jsruntimehost.unittests.Main)
2023-02-16T21:43:39.3098240Z 02-16 21:43:28.288  1830  1849 W zygote64: kill(-2693, 9) failed: No such process
2023-02-16T21:43:39.3099290Z 02-16 21:43:28.311  3170  3186 D JavaScriptCore.Version: 250230.2.1
2023-02-16T21:43:39.3100350Z 02-16 21:43:28.338  1830  1849 W zygote64: kill(-2693, 9) failed: No such process
2023-02-16T21:43:39.3102700Z 02-16 21:43:28.338  1830  1849 I zygote64: Successfully killed process cgroup uid 10055 pid 2693 in 98ms
2023-02-16T21:43:39.3104410Z 02-16 21:43:28.474  1397  1427 D         : HostConnection::get() New Host Connection established 0x72e773c2c180, tid 1427
2023-02-16T21:43:39.3105670Z 02-16 21:43:28.669  3170  3199 D NetworkSecurityConfig: No Network Security Config specified, using platform default
2023-02-16T21:43:39.3106900Z 02-16 21:43:28.879  3170  3175 I zygote64: Do partial code cache collection, code=29KB, data=21KB
2023-02-16T21:43:39.3108100Z 02-16 21:43:28.883  3170  3175 I zygote64: After code cache collection, code=29KB, data=21KB
2023-02-16T21:43:39.3109910Z 02-16 21:43:28.883  3170  3175 I zygote64: Increasing code cache capacity to 128KB
2023-02-16T21:43:39.3111180Z 02-16 21:43:28.992  3170  3190 I JsRuntimeHost: Passed: XMLHTTPRequest should have readyState=4 when load ends
2023-02-16T21:43:39.3112410Z 02-16 21:43:29.081  3170  3190 I JsRuntimeHost: Passed: XMLHTTPRequest should have status=200 for a file that exists
2023-02-16T21:43:39.3113590Z 02-16 21:43:29.387  3170  3190 I JsRuntimeHost: Passed: XMLHTTPRequest should load URLs with escaped unicode characters
2023-02-16T21:43:39.3115260Z 02-16 21:43:29.417  3170  3190 I JsRuntimeHost: Passed: XMLHTTPRequest should load URLs with unescaped unicode characters
2023-02-16T21:43:39.3116950Z 02-16 21:43:29.437  3170  3190 I JsRuntimeHost: Passed: XMLHTTPRequest should load URLs with unescaped unicode characters and spaces
2023-02-16T21:43:39.3118640Z 02-16 21:43:29.523  3170  3190 I JsRuntimeHost: Passed: XMLHTTPRequest should have status=404 for a file that does not exist
2023-02-16T21:43:39.3121140Z 02-16 21:43:29.527  3170  3190 I JsRuntimeHost: Passed: XMLHTTPRequest should throw something when opening //
2023-02-16T21:43:39.3123510Z 02-16 21:43:29.529  3170  3190 I JsRuntimeHost: Passed: XMLHTTPRequest should throw something when opening a url with no scheme
2023-02-16T21:43:39.3125700Z 02-16 21:43:29.530  3170  3190 I JsRuntimeHost: Passed: XMLHTTPRequest should throw something when sending before opening
2023-02-16T21:43:39.3127440Z 02-16 21:43:29.532  3170  3190 I JsRuntimeHost: Passed: setTimeout should return an id greater than zero
2023-02-16T21:43:39.3131050Z 02-16 21:43:29.533  3170  3190 I JsRuntimeHost: Passed: setTimeout should return an id greater than zero when given an undefined function
2023-02-16T21:43:39.3132740Z 02-16 21:43:29.547  3170  3190 I JsRuntimeHost: Passed: setTimeout should call the given function after the given delay
2023-02-16T21:43:39.3135050Z 02-16 21:43:29.591  3170  3190 I JsRuntimeHost: Passed: setTimeout should call the given nested function after the given delay
2023-02-16T21:43:39.3137750Z 02-16 21:43:29.606  3170  3190 I JsRuntimeHost: Passed: setTimeout should call the given function after the given delay when the delay is a string representing a valid number
2023-02-16T21:43:39.3140580Z 02-16 21:43:29.611  3170  3190 I JsRuntimeHost: Passed: setTimeout should call the given function after zero milliseconds when the delay is a string representing an invalid number
2023-02-16T21:43:39.3142190Z 02-16 21:43:29.615  3170  3190 I JsRuntimeHost: Passed: setTimeout should call the given function after other tasks execute when the given delay is zero
2023-02-16T21:43:39.3145340Z 02-16 21:43:29.620  3170  3190 I JsRuntimeHost: Passed: setTimeout should call the given function after other tasks execute when the given delay is undefined
2023-02-16T21:43:39.3147050Z 02-16 21:43:29.777  3210  3210 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2023-02-16T21:43:39.3149280Z 02-16 21:43:29.778  1710  1710 I /system/bin/tombstoned: received crash request for pid 3170
2023-02-16T21:43:39.3150500Z 02-16 21:43:29.778  3210  3210 I crash_dump64: performing dump of process 3170 (target tid = 3195)
2023-02-16T21:43:39.3152810Z 02-16 21:43:30.207  1710  1710 E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_00
2023-02-16T21:43:39.3153930Z 02-16 21:43:30.277  1686  1686 I Zygote  : Process 3170 exited due to signal (6)
2023-02-16T21:43:39.3156480Z 02-16 21:43:30.289  1830  3217 W Binder  : Outgoing transactions from this process must be FLAG_ONEWAY
2023-02-16T21:43:39.3157650Z 02-16 21:43:30.289  1830  3217 W Binder  : java.lang.Throwable
2023-02-16T21:43:39.3159110Z 02-16 21:43:30.289  1830  3217 W Binder  : 	at android.os.BinderProxy.transact(Binder.java:752)
2023-02-16T21:43:39.3162010Z 02-16 21:43:30.289  1830  3217 W Binder  : 	at android.app.IInstrumentationWatcher$Stub$Proxy.instrumentationFinished(IInstrumentationWatcher.java:160)
2023-02-16T21:43:39.3165880Z 02-16 21:43:30.289  1830  3217 W Binder  : 	at com.android.server.am.InstrumentationReporter$MyThread.run(InstrumentationReporter.java:86)
2023-02-16T21:43:39.3168170Z 02-16 21:43:30.289  1830  1849 W zygote64: kill(-3170, 9) failed: No such process
2023-02-16T21:43:39.3169640Z 02-16 21:43:30.289  3161  3161 D AndroidRuntime: Shutting down VM
2023-02-16T21:43:39.3170690Z 02-16 21:43:30.290  1830  1849 I zygote64: Successfully killed process cgroup uid 10060 pid 3170 in 6ms
2023-02-16T21:43:39.3171880Z 02-16 21:43:30.745  3226  3226 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
2023-02-16T21:43:39.3173740Z 02-16 21:43:30.802  3226  3226 W app_process: Unexpected CPU variant for X86 using defaults: x86_64
2023-02-16T21:43:39.3175060Z 02-16 21:43:30.804  3226  3226 I app_process: The ClassLoaderContext is a special shared library.
2023-02-16T21:43:39.3177350Z 02-16 21:43:30.840  3226  3226 D AndroidRuntime: Calling main entry com.android.commands.pm.Pm
2023-02-16T21:43:39.3178590Z 02-16 21:43:30.854  3226  3234 W MessageQueue: Handler (android.os.Handler) {d92c569} sending message to a Handler on a dead thread
2023-02-16T21:43:39.3180090Z 02-16 21:43:30.854  3226  3234 W MessageQueue: java.lang.IllegalStateException: Handler (android.os.Handler) {d92c569} sending message to a Handler on a dead thread
2023-02-16T21:43:39.3181530Z 02-16 21:43:30.854  3226  3234 W MessageQueue: 	at android.os.MessageQueue.enqueueMessage(MessageQueue.java:545)
2023-02-16T21:43:39.3182850Z 02-16 21:43:30.854  3226  3234 W MessageQueue: 	at android.os.Handler.enqueueMessage(Handler.java:662)
2023-02-16T21:43:39.3184130Z 02-16 21:43:30.854  3226  3234 W MessageQueue: 	at android.os.Handler.sendMessageAtTime(Handler.java:631)
2023-02-16T21:43:39.3185760Z 02-16 21:43:30.854  3226  3234 W MessageQueue: 	at android.os.Handler.sendMessageDelayed(Handler.java:601)
2023-02-16T21:43:39.3187600Z 02-16 21:43:30.854  3226  3234 W MessageQueue: 	at android.os.Handler.post(Handler.java:357)
2023-02-16T21:43:39.3188840Z 02-16 21:43:30.854  3226  3234 W MessageQueue: 	at android.os.ResultReceiver$MyResultReceiver.send(ResultReceiver.java:57)
2023-02-16T21:43:39.3190780Z 02-16 21:43:30.854  3226  3234 W MessageQueue: 	at com.android.internal.os.IResultReceiver$Stub.onTransact(IResultReceiver.java:58)
2023-02-16T21:43:39.3192300Z 02-16 21:43:30.854  3226  3234 W MessageQueue: 	at android.os.Binder.execTransact(Binder.java:697)
2023-02-16T21:43:39.3193500Z 02-16 21:43:30.856  3226  3226 I app_process: System.exit called, status: 0
2023-02-16T21:43:39.3194520Z 02-16 21:43:30.856  3226  3226 I AndroidRuntime: VM exiting with result code 0.
2023-02-16T21:43:39.3213420Z ##[section]Finishing: Dump logcat from Test Results

Websocket error message parameter missing from callback

Describe the bug
Websocket error callback and close callback don't take in any parameters.

Expected behavior
An error message should be passed down from the source of the error into the error message callback. A close reason and close code should be passed into the close callback.

Other

  • Platform: Win32, Android, iOS

V8 inspector agent crashes on shutdown after attaching debugger when running unit tests

Describe the bug
The unit tests crash on shutdown after attaching a debugger (e.g., with ChromeDevTools).

To Reproduce
Steps to reproduce the behavior:

  1. Set waitForDebugger to true in tests.js.
  2. Run the unit tests.
  3. Attach the V8 debugger using Chrome about://inspect.
  4. Continue when the debugger; statement hits.
  5. Unit tests crashes after completing the tests

Call Stack

<unknown> 0x000071421b6815bf
<unknown> 0x000071421b6837bd
<unknown> 0x000071421b683a29
std::__ndk1::default_delete::operator()(v8_inspector::V8InspectorSession *) const memory:2338
std::__ndk1::unique_ptr::reset(v8_inspector::V8InspectorSession *) memory:2593
std::__ndk1::unique_ptr::~unique_ptr() memory:2547
Babylon::V8NodeInspector::~V8NodeInspector() V8InspectorAgent.cpp:183
Babylon::V8NodeInspector::~V8NodeInspector() V8InspectorAgent.cpp:183
std::__ndk1::default_delete::operator()(Babylon::V8NodeInspector *) const memory:2338
std::__ndk1::unique_ptr::reset(Babylon::V8NodeInspector *) memory:2593
Babylon::AgentImpl::Stop() V8InspectorAgent.cpp:417
Babylon::V8InspectorAgent::stop() V8InspectorAgent.cpp:667
Babylon::AppRuntime::RunEnvironmentTier(const char *) AppRuntime_V8.cpp:91
Babylon::AppRuntime::RunPlatformTier() AppRuntime_Android.cpp:10
$_1::operator()() const AppRuntime.cpp:12
decltype(std::__ndk1::forward<Babylon::AppRuntime::AppRuntime(std::__ndk1::function<void (std::exception const&)>)::$_1&>(fp)()) std::__ndk1::__invoke<Babylon::AppRuntime::AppRuntime(std::__ndk1::function<void (std::exception const&)>)::$_1&>(Babylon::AppRuntime::AppRuntime(std::__ndk1::function<void (std::exception const&)>)::$_1&) type_traits:3501
std::__ndk1::__invoke_void_return_wrapper::__call<…>($_1 &) __functional_base:348
std::__ndk1::__function::__alloc_func::operator()() functional:1540
std::__ndk1::__function::__func::operator()() functional:1714
std::__ndk1::__function::__value_func::operator()() const functional:1867
std::__ndk1::function::operator()() const functional:2473
decltype(std::__ndk1::forward<std::__ndk1::function<void ()> >(fp)()) std::__ndk1::__invoke<std::__ndk1::function<void ()> >(std::__ndk1::function<void ()>&&) type_traits:3501
std::__ndk1::__thread_execute<…>(std::__ndk1::tuple<…> &, std::__ndk1::__tuple_indices<…>) thread:273
std::__ndk1::__thread_proxy<…>(void *) thread:283
__pthread_start(void *) 0x00007142b5480f3c
__start_thread 0x00007142b542fc8e
__bionic_clone 0x00007142b542e516

Expected behavior
The unit tests to exit cleanly.

Other

  • Platform: Android

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.