Skip to content

Commit 5382c0e

Browse files
authored
Merge pull request #1527 from NativeScript/darind/v8-7.8.279.19
Upgrade v8 to 7.8.279.19 (#1526)
2 parents 3fe42f7 + 433f751 commit 5382c0e

File tree

33 files changed

+59364
-57694
lines changed

33 files changed

+59364
-57694
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"v8Version": "7.7.299.11",
2+
"v8Version": "7.8.279.19",
33
"ndkRevision": "20.0.5594570",
44
"mksnapshotParams": "--profile_deserialization --turbo_instruction_scheduling --target_os=android --no-native-code-counters"
55
}

test-app/runtime/src/main/cpp/include/libplatform/v8-tracing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ class V8_PLATFORM_EXPORT TracingController
244244

245245
TracingController();
246246
~TracingController() override;
247+
248+
// Takes ownership of |trace_buffer|.
247249
void Initialize(TraceBuffer* trace_buffer);
248250
#ifdef V8_USE_PERFETTO
249251
// Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides

test-app/runtime/src/main/cpp/include/v8-internal.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ struct SmiTagging<4> {
6363

6464
V8_INLINE static int SmiToInt(const internal::Address value) {
6565
int shift_bits = kSmiTagSize + kSmiShiftSize;
66-
// Shift down (requires >> to be sign extending).
67-
return static_cast<int>(static_cast<intptr_t>(value)) >> shift_bits;
66+
// Truncate and shift down (requires >> to be sign extending).
67+
return static_cast<int32_t>(static_cast<uint32_t>(value)) >> shift_bits;
6868
}
6969
V8_INLINE static constexpr bool IsValidSmi(intptr_t value) {
7070
// Is value in range [kSmiMinValue, kSmiMaxValue].
@@ -152,15 +152,22 @@ class Internals {
152152

153153
static const uint32_t kNumIsolateDataSlots = 4;
154154

155+
// IsolateData layout guarantees.
155156
static const int kIsolateEmbedderDataOffset = 0;
156157
static const int kExternalMemoryOffset =
157158
kNumIsolateDataSlots * kApiSystemPointerSize;
158159
static const int kExternalMemoryLimitOffset =
159160
kExternalMemoryOffset + kApiInt64Size;
160161
static const int kExternalMemoryAtLastMarkCompactOffset =
161162
kExternalMemoryLimitOffset + kApiInt64Size;
162-
static const int kIsolateRootsOffset =
163+
static const int kIsolateFastCCallCallerFpOffset =
163164
kExternalMemoryAtLastMarkCompactOffset + kApiInt64Size;
165+
static const int kIsolateFastCCallCallerPcOffset =
166+
kIsolateFastCCallCallerFpOffset + kApiSystemPointerSize;
167+
static const int kIsolateStackGuardOffset =
168+
kIsolateFastCCallCallerPcOffset + kApiSystemPointerSize;
169+
static const int kIsolateRootsOffset =
170+
kIsolateStackGuardOffset + 7 * kApiSystemPointerSize;
164171

165172
static const int kUndefinedValueRootIndex = 4;
166173
static const int kTheHoleValueRootIndex = 5;
@@ -177,7 +184,7 @@ class Internals {
177184

178185
static const int kFirstNonstringType = 0x40;
179186
static const int kOddballType = 0x43;
180-
static const int kForeignType = 0x47;
187+
static const int kForeignType = 0x46;
181188
static const int kJSSpecialApiObjectType = 0x410;
182189
static const int kJSApiObjectType = 0x420;
183190
static const int kJSObjectType = 0x421;

test-app/runtime/src/main/cpp/include/v8-platform.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,6 @@ class Platform {
439439
*/
440440
virtual void DumpWithoutCrashing() {}
441441

442-
/**
443-
* Lets the embedder to add crash keys.
444-
*/
445-
virtual void AddCrashKey(int id, const char* name, uintptr_t value) {
446-
// "noop" is a valid implementation if the embedder doesn't care to log
447-
// additional data for crashes.
448-
}
449-
450442
protected:
451443
/**
452444
* Default implementation of current wall-clock time in milliseconds

test-app/runtime/src/main/cpp/include/v8-profiler.h

Lines changed: 39 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ namespace v8 {
1818
class HeapGraphNode;
1919
struct HeapStatsUpdate;
2020

21-
typedef uint32_t SnapshotObjectId;
22-
21+
using NativeObject = void*;
22+
using SnapshotObjectId = uint32_t;
2323

2424
struct CpuProfileDeoptFrame {
2525
int script_id;
2626
size_t position;
2727
};
2828

29+
namespace internal {
30+
class CpuProfile;
31+
} // namespace internal
32+
2933
} // namespace v8
3034

3135
#ifdef V8_OS_WIN
@@ -48,75 +52,6 @@ template class V8_EXPORT std::vector<v8::CpuProfileDeoptInfo>;
4852

4953
namespace v8 {
5054

51-
// TickSample captures the information collected for each sample.
52-
struct V8_EXPORT TickSample {
53-
// Internal profiling (with --prof + tools/$OS-tick-processor) wants to
54-
// include the runtime function we're calling. Externally exposed tick
55-
// samples don't care.
56-
enum RecordCEntryFrame { kIncludeCEntryFrame, kSkipCEntryFrame };
57-
58-
TickSample()
59-
: state(OTHER),
60-
pc(nullptr),
61-
external_callback_entry(nullptr),
62-
frames_count(0),
63-
has_external_callback(false),
64-
update_stats(true) {}
65-
66-
/**
67-
* Initialize a tick sample from the isolate.
68-
* \param isolate The isolate.
69-
* \param state Execution state.
70-
* \param record_c_entry_frame Include or skip the runtime function.
71-
* \param update_stats Whether update the sample to the aggregated stats.
72-
* \param use_simulator_reg_state When set to true and V8 is running under a
73-
* simulator, the method will use the simulator
74-
* register state rather than the one provided
75-
* with |state| argument. Otherwise the method
76-
* will use provided register |state| as is.
77-
*/
78-
void Init(Isolate* isolate, const v8::RegisterState& state,
79-
RecordCEntryFrame record_c_entry_frame, bool update_stats,
80-
bool use_simulator_reg_state = true);
81-
/**
82-
* Get a call stack sample from the isolate.
83-
* \param isolate The isolate.
84-
* \param state Register state.
85-
* \param record_c_entry_frame Include or skip the runtime function.
86-
* \param frames Caller allocated buffer to store stack frames.
87-
* \param frames_limit Maximum number of frames to capture. The buffer must
88-
* be large enough to hold the number of frames.
89-
* \param sample_info The sample info is filled up by the function
90-
* provides number of actual captured stack frames and
91-
* the current VM state.
92-
* \param use_simulator_reg_state When set to true and V8 is running under a
93-
* simulator, the method will use the simulator
94-
* register state rather than the one provided
95-
* with |state| argument. Otherwise the method
96-
* will use provided register |state| as is.
97-
* \note GetStackSample is thread and signal safe and should only be called
98-
* when the JS thread is paused or interrupted.
99-
* Otherwise the behavior is undefined.
100-
*/
101-
static bool GetStackSample(Isolate* isolate, v8::RegisterState* state,
102-
RecordCEntryFrame record_c_entry_frame,
103-
void** frames, size_t frames_limit,
104-
v8::SampleInfo* sample_info,
105-
bool use_simulator_reg_state = true);
106-
StateTag state; // The state of the VM.
107-
void* pc; // Instruction pointer.
108-
union {
109-
void* tos; // Top stack value (*sp).
110-
void* external_callback_entry;
111-
};
112-
static const unsigned kMaxFramesCountLog2 = 8;
113-
static const unsigned kMaxFramesCount = (1 << kMaxFramesCountLog2) - 1;
114-
void* stack[kMaxFramesCount]; // Call stack.
115-
unsigned frames_count : kMaxFramesCountLog2; // Number of captured frames.
116-
bool has_external_callback : 1;
117-
bool update_stats : 1; // Whether the sample should update aggregated stats.
118-
};
119-
12055
/**
12156
* CpuProfileNode represents a node in a call graph.
12257
*/
@@ -307,6 +242,15 @@ enum CpuProfilingNamingMode {
307242
kDebugNaming,
308243
};
309244

245+
enum CpuProfilingLoggingMode {
246+
// Enables logging when a profile is active, and disables logging when all
247+
// profiles are detached.
248+
kLazyLogging,
249+
// Enables logging for the lifetime of the CpuProfiler. Calls to
250+
// StartRecording are faster, at the expense of runtime overhead.
251+
kEagerLogging,
252+
};
253+
310254
/**
311255
* Optional profiling attributes.
312256
*/
@@ -328,21 +272,25 @@ class V8_EXPORT CpuProfilingOptions {
328272
* zero, the sampling interval will be equal to
329273
* the profiler's sampling interval.
330274
*/
331-
CpuProfilingOptions(CpuProfilingMode mode = kLeafNodeLineNumbers,
332-
unsigned max_samples = kNoSampleLimit,
333-
int sampling_interval_us = 0)
334-
: mode_(mode),
335-
max_samples_(max_samples),
336-
sampling_interval_us_(sampling_interval_us) {}
275+
CpuProfilingOptions(
276+
CpuProfilingMode mode = kLeafNodeLineNumbers,
277+
unsigned max_samples = kNoSampleLimit, int sampling_interval_us = 0,
278+
MaybeLocal<Context> filter_context = MaybeLocal<Context>());
337279

338280
CpuProfilingMode mode() const { return mode_; }
339281
unsigned max_samples() const { return max_samples_; }
340282
int sampling_interval_us() const { return sampling_interval_us_; }
341283

342284
private:
285+
friend class internal::CpuProfile;
286+
287+
bool has_filter_context() const { return !filter_context_.IsEmpty(); }
288+
void* raw_filter_context() const;
289+
343290
CpuProfilingMode mode_;
344291
unsigned max_samples_;
345292
int sampling_interval_us_;
293+
CopyablePersistentTraits<Context>::CopyablePersistent filter_context_;
346294
};
347295

348296
/**
@@ -357,7 +305,8 @@ class V8_EXPORT CpuProfiler {
357305
* |Dispose| method.
358306
*/
359307
static CpuProfiler* New(Isolate* isolate,
360-
CpuProfilingNamingMode = kDebugNaming);
308+
CpuProfilingNamingMode = kDebugNaming,
309+
CpuProfilingLoggingMode = kLazyLogging);
361310

362311
/**
363312
* Synchronously collect current stack sample in all profilers attached to
@@ -798,6 +747,12 @@ class V8_EXPORT EmbedderGraph {
798747
*/
799748
virtual const char* NamePrefix() { return nullptr; }
800749

750+
/**
751+
* Returns the NativeObject that can be used for querying the
752+
* |HeapSnapshot|.
753+
*/
754+
virtual NativeObject GetNativeObject() { return nullptr; }
755+
801756
Node(const Node&) = delete;
802757
Node& operator=(const Node&) = delete;
803758
};
@@ -860,6 +815,12 @@ class V8_EXPORT HeapProfiler {
860815
*/
861816
SnapshotObjectId GetObjectId(Local<Value> value);
862817

818+
/**
819+
* Returns SnapshotObjectId for a native object referenced by |value| if it
820+
* has been seen by the heap profiler, kUnknownObjectId otherwise.
821+
*/
822+
SnapshotObjectId GetObjectId(NativeObject value);
823+
863824
/**
864825
* Returns heap object with given SnapshotObjectId if the object is alive,
865826
* otherwise empty handle is returned.

test-app/runtime/src/main/cpp/include/v8-version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// NOTE these macros are used by some of the tool scripts and the build
1010
// system so their names cannot be changed without changing the scripts.
1111
#define V8_MAJOR_VERSION 7
12-
#define V8_MINOR_VERSION 7
13-
#define V8_BUILD_NUMBER 299
14-
#define V8_PATCH_LEVEL 11
12+
#define V8_MINOR_VERSION 8
13+
#define V8_BUILD_NUMBER 279
14+
#define V8_PATCH_LEVEL 19
1515

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

0 commit comments

Comments
 (0)