Skip to content

Upgrade v8 to 7.8.279.19 (#1526) #1527

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

Merged
merged 1 commit into from
Nov 26, 2019
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
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.7.299.11",
"v8Version": "7.8.279.19",
"ndkRevision": "20.0.5594570",
"mksnapshotParams": "--profile_deserialization --turbo_instruction_scheduling --target_os=android --no-native-code-counters"
}
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ class V8_PLATFORM_EXPORT TracingController

TracingController();
~TracingController() override;

// Takes ownership of |trace_buffer|.
void Initialize(TraceBuffer* trace_buffer);
#ifdef V8_USE_PERFETTO
// Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides
Expand Down
15 changes: 11 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 @@ -63,8 +63,8 @@ struct SmiTagging<4> {

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

static const uint32_t kNumIsolateDataSlots = 4;

// IsolateData layout guarantees.
static const int kIsolateEmbedderDataOffset = 0;
static const int kExternalMemoryOffset =
kNumIsolateDataSlots * kApiSystemPointerSize;
static const int kExternalMemoryLimitOffset =
kExternalMemoryOffset + kApiInt64Size;
static const int kExternalMemoryAtLastMarkCompactOffset =
kExternalMemoryLimitOffset + kApiInt64Size;
static const int kIsolateRootsOffset =
static const int kIsolateFastCCallCallerFpOffset =
kExternalMemoryAtLastMarkCompactOffset + kApiInt64Size;
static const int kIsolateFastCCallCallerPcOffset =
kIsolateFastCCallCallerFpOffset + kApiSystemPointerSize;
static const int kIsolateStackGuardOffset =
kIsolateFastCCallCallerPcOffset + kApiSystemPointerSize;
static const int kIsolateRootsOffset =
kIsolateStackGuardOffset + 7 * kApiSystemPointerSize;

static const int kUndefinedValueRootIndex = 4;
static const int kTheHoleValueRootIndex = 5;
Expand All @@ -177,7 +184,7 @@ class Internals {

static const int kFirstNonstringType = 0x40;
static const int kOddballType = 0x43;
static const int kForeignType = 0x47;
static const int kForeignType = 0x46;
static const int kJSSpecialApiObjectType = 0x410;
static const int kJSApiObjectType = 0x420;
static const int kJSObjectType = 0x421;
Expand Down
8 changes: 0 additions & 8 deletions test-app/runtime/src/main/cpp/include/v8-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,6 @@ class Platform {
*/
virtual void DumpWithoutCrashing() {}

/**
* Lets the embedder to add crash keys.
*/
virtual void AddCrashKey(int id, const char* name, uintptr_t value) {
// "noop" is a valid implementation if the embedder doesn't care to log
// additional data for crashes.
}

protected:
/**
* Default implementation of current wall-clock time in milliseconds
Expand Down
117 changes: 39 additions & 78 deletions test-app/runtime/src/main/cpp/include/v8-profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ namespace v8 {
class HeapGraphNode;
struct HeapStatsUpdate;

typedef uint32_t SnapshotObjectId;

using NativeObject = void*;
using SnapshotObjectId = uint32_t;

struct CpuProfileDeoptFrame {
int script_id;
size_t position;
};

namespace internal {
class CpuProfile;
} // namespace internal

} // namespace v8

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

namespace v8 {

// TickSample captures the information collected for each sample.
struct V8_EXPORT TickSample {
// Internal profiling (with --prof + tools/$OS-tick-processor) wants to
// include the runtime function we're calling. Externally exposed tick
// samples don't care.
enum RecordCEntryFrame { kIncludeCEntryFrame, kSkipCEntryFrame };

TickSample()
: state(OTHER),
pc(nullptr),
external_callback_entry(nullptr),
frames_count(0),
has_external_callback(false),
update_stats(true) {}

/**
* Initialize a tick sample from the isolate.
* \param isolate The isolate.
* \param state Execution state.
* \param record_c_entry_frame Include or skip the runtime function.
* \param update_stats Whether update the sample to the aggregated stats.
* \param use_simulator_reg_state When set to true and V8 is running under a
* simulator, the method will use the simulator
* register state rather than the one provided
* with |state| argument. Otherwise the method
* will use provided register |state| as is.
*/
void Init(Isolate* isolate, const v8::RegisterState& state,
RecordCEntryFrame record_c_entry_frame, bool update_stats,
bool use_simulator_reg_state = true);
/**
* Get a call stack sample from the isolate.
* \param isolate The isolate.
* \param state Register state.
* \param record_c_entry_frame Include or skip the runtime function.
* \param frames Caller allocated buffer to store stack frames.
* \param frames_limit Maximum number of frames to capture. The buffer must
* be large enough to hold the number of frames.
* \param sample_info The sample info is filled up by the function
* provides number of actual captured stack frames and
* the current VM state.
* \param use_simulator_reg_state When set to true and V8 is running under a
* simulator, the method will use the simulator
* register state rather than the one provided
* with |state| argument. Otherwise the method
* will use provided register |state| as is.
* \note GetStackSample is thread and signal safe and should only be called
* when the JS thread is paused or interrupted.
* Otherwise the behavior is undefined.
*/
static bool GetStackSample(Isolate* isolate, v8::RegisterState* state,
RecordCEntryFrame record_c_entry_frame,
void** frames, size_t frames_limit,
v8::SampleInfo* sample_info,
bool use_simulator_reg_state = true);
StateTag state; // The state of the VM.
void* pc; // Instruction pointer.
union {
void* tos; // Top stack value (*sp).
void* external_callback_entry;
};
static const unsigned kMaxFramesCountLog2 = 8;
static const unsigned kMaxFramesCount = (1 << kMaxFramesCountLog2) - 1;
void* stack[kMaxFramesCount]; // Call stack.
unsigned frames_count : kMaxFramesCountLog2; // Number of captured frames.
bool has_external_callback : 1;
bool update_stats : 1; // Whether the sample should update aggregated stats.
};

/**
* CpuProfileNode represents a node in a call graph.
*/
Expand Down Expand Up @@ -307,6 +242,15 @@ enum CpuProfilingNamingMode {
kDebugNaming,
};

enum CpuProfilingLoggingMode {
// Enables logging when a profile is active, and disables logging when all
// profiles are detached.
kLazyLogging,
// Enables logging for the lifetime of the CpuProfiler. Calls to
// StartRecording are faster, at the expense of runtime overhead.
kEagerLogging,
};

/**
* Optional profiling attributes.
*/
Expand All @@ -328,21 +272,25 @@ class V8_EXPORT CpuProfilingOptions {
* zero, the sampling interval will be equal to
* the profiler's sampling interval.
*/
CpuProfilingOptions(CpuProfilingMode mode = kLeafNodeLineNumbers,
unsigned max_samples = kNoSampleLimit,
int sampling_interval_us = 0)
: mode_(mode),
max_samples_(max_samples),
sampling_interval_us_(sampling_interval_us) {}
CpuProfilingOptions(
CpuProfilingMode mode = kLeafNodeLineNumbers,
unsigned max_samples = kNoSampleLimit, int sampling_interval_us = 0,
MaybeLocal<Context> filter_context = MaybeLocal<Context>());

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

private:
friend class internal::CpuProfile;

bool has_filter_context() const { return !filter_context_.IsEmpty(); }
void* raw_filter_context() const;

CpuProfilingMode mode_;
unsigned max_samples_;
int sampling_interval_us_;
CopyablePersistentTraits<Context>::CopyablePersistent filter_context_;
};

/**
Expand All @@ -357,7 +305,8 @@ class V8_EXPORT CpuProfiler {
* |Dispose| method.
*/
static CpuProfiler* New(Isolate* isolate,
CpuProfilingNamingMode = kDebugNaming);
CpuProfilingNamingMode = kDebugNaming,
CpuProfilingLoggingMode = kLazyLogging);

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

/**
* Returns the NativeObject that can be used for querying the
* |HeapSnapshot|.
*/
virtual NativeObject GetNativeObject() { return nullptr; }

Node(const Node&) = delete;
Node& operator=(const Node&) = delete;
};
Expand Down Expand Up @@ -860,6 +815,12 @@ class V8_EXPORT HeapProfiler {
*/
SnapshotObjectId GetObjectId(Local<Value> value);

/**
* Returns SnapshotObjectId for a native object referenced by |value| if it
* has been seen by the heap profiler, kUnknownObjectId otherwise.
*/
SnapshotObjectId GetObjectId(NativeObject value);

/**
* Returns heap object with given SnapshotObjectId if the object is alive,
* otherwise empty handle is returned.
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 7
#define V8_BUILD_NUMBER 299
#define V8_PATCH_LEVEL 11
#define V8_MINOR_VERSION 8
#define V8_BUILD_NUMBER 279
#define V8_PATCH_LEVEL 19

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