Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
6.4.0
==

## What's New

- [Upgrade v8 to 7.9.317.31 (#1526)](https://github.com/NativeScript/android-runtime/issues/1555)

6.3.0
==

Expand All @@ -24,7 +31,7 @@
- [Upgrade android gradle plugin to the latest 3.5.1 version (#1502)](https://github.com/NativeScript/android-runtime/issues/1502)
- [support snapshot libs out of the box (#1496)](https://github.com/NativeScript/android-runtime/pull/1496)
- [Upgrade v8 to 7.7.299.11 (#1478)](https://github.com/NativeScript/android-runtime/issues/1478)

## Bug Fixes
- [Console.log in worker makes chrome debugging crash (#1511)](https://github.com/NativeScript/android-runtime/issues/1511)
- [fix searching for merge assets folder on windows (#1503)](https://github.com/NativeScript/android-runtime/pull/1503)
Expand Down
2 changes: 1 addition & 1 deletion build-artifacts/project-template-gradle/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"v8Version": "7.8.279.19",
"v8Version": "7.9.317.31",
"ndkRevision": "20.0.5594570",
"mksnapshotParams": "--profile_deserialization --turbo_instruction_scheduling --target_os=android --no-native-code-counters"
}
6 changes: 0 additions & 6 deletions test-app/runtime/src/main/cpp/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "NetworkDomainCallbackHandlers.h"
#include "sys/system_properties.h"
#include "ManualInstrumentation.h"
#include <natives_blob.h>
#include <snapshot_blob.h>

#ifdef APPLICATION_IN_DEBUG
Expand Down Expand Up @@ -472,11 +471,6 @@ Isolate* Runtime::PrepareV8Runtime(const string& filesPath, const string& native

m_startupData = new StartupData();

auto* nativesBlobStartupData = new StartupData();
nativesBlobStartupData->data = reinterpret_cast<const char*>(&natives_blob_bin[0]);
nativesBlobStartupData->raw_size = natives_blob_bin_len;
V8::SetNativesDataBlob(nativesBlobStartupData);

void* snapshotPtr = nullptr;
string snapshotPath;
bool snapshotPathExists = false;
Expand Down
11 changes: 6 additions & 5 deletions test-app/runtime/src/main/cpp/include/libplatform/libplatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef V8_LIBPLATFORM_LIBPLATFORM_H_
#define V8_LIBPLATFORM_LIBPLATFORM_H_

#include <memory>

#include "libplatform/libplatform-export.h"
#include "libplatform/v8-tracing.h"
#include "v8-platform.h" // NOLINT(build/include)
Expand Down Expand Up @@ -70,11 +72,10 @@ 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);

} // namespace platform
} // namespace v8
Expand Down
9 changes: 9 additions & 0 deletions test-app/runtime/src/main/cpp/include/v8-inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace Runtime {
namespace API {
class RemoteObject;
class StackTrace;
class StackTraceId;
}
}
namespace Schema {
Expand Down Expand Up @@ -229,12 +230,20 @@ class V8_EXPORT V8InspectorClient {
struct V8_EXPORT V8StackTraceId {
uintptr_t id;
std::pair<int64_t, int64_t> debugger_id;
bool should_pause = false;

V8StackTraceId();
V8StackTraceId(const V8StackTraceId&) = default;
V8StackTraceId(uintptr_t id, const std::pair<int64_t, int64_t> debugger_id);
V8StackTraceId(uintptr_t id, const std::pair<int64_t, int64_t> debugger_id,
bool should_pause);
explicit V8StackTraceId(const StringView&);
V8StackTraceId& operator=(const V8StackTraceId&) = default;
V8StackTraceId& operator=(V8StackTraceId&&) noexcept = default;
~V8StackTraceId() = default;

bool IsInvalid() const;
std::unique_ptr<StringBuffer> ToString();
};

class V8_EXPORT V8Inspector {
Expand Down
11 changes: 7 additions & 4 deletions test-app/runtime/src/main/cpp/include/v8-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ using PlatformSmiTagging = SmiTagging<kApiInt32Size>;
using PlatformSmiTagging = SmiTagging<kApiTaggedSize>;
#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<int>(PlatformSmiTagging::kSmiMinValue);
Expand Down Expand Up @@ -327,14 +329,11 @@ class Internals {
#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;

V8_INLINE static internal::Address GetRootFromOnHeapAddress(
internal::Address addr) {
return (addr + kPtrComprIsolateRootBias) &
-static_cast<intptr_t>(kPtrComprIsolateRootAlignment);
return addr & -static_cast<intptr_t>(kPtrComprIsolateRootAlignment);
}

V8_INLINE static internal::Address DecompressTaggedAnyField(
Expand Down Expand Up @@ -381,6 +380,10 @@ V8_EXPORT internal::Isolate* IsolateFromNeverReadOnlySpaceObject(Address obj);
// 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
} // namespace v8

Expand Down
18 changes: 7 additions & 11 deletions test-app/runtime/src/main/cpp/include/v8-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,20 +367,18 @@ class Platform {
* |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;
V8_DEPRECATED("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;
V8_DEPRECATED("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
Expand All @@ -390,10 +388,8 @@ class Platform {
* 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)) {
V8_DEPRECATED("Use a taskrunner acquired by GetForegroundTaskRunner instead.")
virtual void CallIdleOnForegroundThread(Isolate* isolate, IdleTask* task) {
// This must be overriden if |IdleTasksEnabled()|.
abort();
}
Expand Down
45 changes: 26 additions & 19 deletions test-app/runtime/src/main/cpp/include/v8-profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#define V8_V8_PROFILER_H_

#include <limits.h>
#include <memory>
#include <unordered_set>
#include <vector>

#include "v8.h" // NOLINT(build/include)

/**
Expand Down Expand Up @@ -143,9 +145,8 @@ class V8_EXPORT CpuProfileNode {
unsigned GetHitCount() const;

/** Returns function entry UID. */
V8_DEPRECATE_SOON(
"Use GetScriptId, GetLineNumber, and GetColumnNumber instead.",
unsigned GetCallUid() const);
V8_DEPRECATED("Use GetScriptId, GetLineNumber, and GetColumnNumber instead.")
unsigned GetCallUid() const;

/** Returns id of the node. The id is unique within the tree */
unsigned GetNodeId() const;
Expand Down Expand Up @@ -370,20 +371,6 @@ class V8_EXPORT CpuProfiler {
*/
CpuProfile* StopProfiling(Local<String> 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.
Expand Down Expand Up @@ -989,7 +976,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
Expand Down Expand Up @@ -1022,10 +1010,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:
Expand All @@ -1037,9 +1027,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:
Expand Down
6 changes: 3 additions & 3 deletions test-app/runtime/src/main/cpp/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// 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 19
#define V8_MINOR_VERSION 9
#define V8_BUILD_NUMBER 317
#define V8_PATCH_LEVEL 31

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
Loading