Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/v8 10.3.22 perf #1743

Merged
merged 54 commits into from
Mar 28, 2023
Merged

feature/v8 10.3.22 perf #1743

merged 54 commits into from
Mar 28, 2023

Conversation

vmutafov
Copy link
Contributor

  • chore: update v8 version
  • feat: update all archs to use v8 10.3.22
  • feat: use v8 static
  • chore: use api level 21
  • fix: always log console messages and uncomment live sync
  • fix: use min sdk 17
  • refactor: move js to java conversions into separate files
  • perf: use vector pointers for passing parsed method signatures
  • perf: remove instantiations and cache runtime in isolate
  • perf: refactor arrays marshaling
  • perf: update old args converter with array marshaling optimizations and use this converter again tempporarily
  • fix: uncomment abifilters
  • chore: format JsArgConverter
  • chore: format JsArgToArrayConverter.cpp
  • feat: native timer polyfills (feat: native timer polyfills #1733)
  • chore: bump compile sdk (chore: bump compile sdk #1739)
  • fix: memcpy array data for non-direct java bytebuffers (fix: memcpy array data for non-direct java bytebuffers #1740)
  • fix: refactor console.log implementation a bit (fix: refactor console.log implementation a bit #1741)
  • fix: remove free of non-owned jni buffer
  • feat: add console message type prefixes
  • fix: add semicolon after console type
  • build with optimizations

Create a meaningful title

Description

Does your commit message include the wording below to reference a specific issue in this repo?

Related Pull Requests

Does your pull request have unit tests?

@cla-bot cla-bot bot added the cla: yes label Nov 21, 2022
edusperoni and others added 7 commits November 21, 2022 17:24
…older

It's clearer that these files are part of NativeScript if they live in the
same folder as the other NativeScript sources. Otherwise, it's easy to
overlook them when updating the V8 sources and unintentionally delete
them.

The classes are adjusted slightly: moved from the v8_inspector:: namespace
into the tns:: namespace, and the filename casing updated to match the
other NativeScript sources.
Here's a summary of what I copied from my build of v8-buildscripts:

v8-buildscripts/v8/out.v8.x64/gen/src/inspector/protocol → v8_inspector/src/inspector/
v8-buildscripts/v8/third_party/inspector_protocol/crdtp/*.h → v8_inspector/third_party/inspector_protocol/crdtp/
v8-buildscripts/v8/src/inspector/*.h → v8_inspector/src/inspector/
v8-buildscripts/v8/src/inspector/inspector_protocol_config.json → v8_inspector/src/inspector/
v8-buildscripts/v8/src/base/*.h → v8_inspector/src/base/
v8-buildscripts/v8/src/base/platform/*.h → v8_inspector/src/base/platform/
v8-buildscripts/v8/out.v8.x64/gen/include/inspector → include/
v8-buildscripts/v8/src/debug/*.h → v8_inspector/src/debug/
v8-buildscripts/v8/src/common/*.h → v8_inspector/src/common/

I removed all of the remaining inspector source files not covered by the
above. This is both outdated headers that are no longer part of V8, but
also the .cc files - the inspector symbols in those .cc files are provided
by the V8 static library already, so we don't need to recompile them.
Replaced by manually deleting the copy constructor and assignment
operator. This macro has disappeared in newer V8, see V8 commit 3a888a85.
A separate V8Platform for the inspector seems to be no longer needed,
because now the DefaultPlatform supports scheduling tasks.
V8 requires this, and some of the inspector sources we added in the
inspector sources update will not compile without it.
I'm not sure about this, but I think the code was initializing context_
with its own initial value (i.e. nullptr), rather than the isolate's
context. This seemed to trigger an error when sending a message to the
frontend, which this change fixed.
It looks like this was used with a no-longer-existent V8 API,
v8::debug::SetMessageHandler. There may be something similar now with
isolate->AddMessageListener() but it does not receive an exception value.
In any case, it's not currently used, and the commented code no longer
compiles.
There was a mix of public and private members with and without underscore,
and static members that got initialized in the constructor. Consolidate
them all into private members, named consistently with underscore. (Moving
the static members to instance members shouldn't matter much, since this
class is a singleton anyway.)
The method can be made private, as well, because it's not used outside the
class.
ptomato and others added 19 commits March 7, 2023 16:43
Move some methods to be private, and make the context group ID into a
constexpr.
Some of the String16 APIs have been made private, so we should use the
public ones instead. These are encapsulated in two inlined utility
functions at the top of the file, which convert between StringView and
std::string.
This saves having to type out the whole type in order to call its no-arg
constructor.
This is the only remaining usage of PersistentToLocal. We don't need its
capability of dealing with weak persistent references because we never
call SetWeak on the context.
Uncomment the code that starts the inspector, and compile the inspector
client when we are in debug mode. However, comment out the parts that
don't work yet.

At this point, the JsV8InspectorClient compiles, but doesn't do anything.
Console messages used to be implemented with the Log protocol, which is no
longer part of V8. The Runtime protocol provides an equivalent API,
Runtime.consoleAPICalled.

The Runtime protocol is part of the generated public sources, but the V8
inspector's RuntimeAgent is not. So, for now, we make use of V8's private
API, casting V8Inspector* to V8InspectorImpl* and V8InspectorSession* to
V8InspectorSessionImpl* in order to access their methods (for which we
pulled in the corresponding V8 header files in the V8 sources update,
earlier on this branch.)
…d-main

chore: merge main into v8-10.3.22-perf
Restore Console inspector for V8 10.3
This restores the JS functions that were used to implement the DOM and
Network inspector domains. The functions do nothing, but they are present
so that using the corresponding UI features in the inspector doesn't
crash.
Restore DOM and Network callback handlers
@edusperoni edusperoni merged commit 5e767b9 into main Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants