| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e60dc1d commit 008ac37
20 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ | |||
| 38 | 38 | ||
| 39 | 39 | # Reset this number to 0 on major V8 upgrades. | |
| 40 | 40 | # Increment by one for each non-official patch applied to deps/v8. | |
| 41 | - 'v8_embedder_string': '-node.20', | ||
| 41 | + 'v8_embedder_string': '-node.21', | ||
| 42 | 42 | ||
| 43 | 43 | ##### V8 defaults for Node.js ##### | |
| 44 | 44 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -152,22 +152,15 @@ class Internals { | |||
| 152 | 152 | ||
| 153 | 153 | static const uint32_t kNumIsolateDataSlots = 4; | |
| 154 | 154 | ||
| 155 | - // IsolateData layout guarantees. | ||
| 156 | 155 | static const int kIsolateEmbedderDataOffset = 0; | |
| 157 | 156 | static const int kExternalMemoryOffset = | |
| 158 | 157 | kNumIsolateDataSlots * kApiSystemPointerSize; | |
| 159 | 158 | static const int kExternalMemoryLimitOffset = | |
| 160 | 159 | kExternalMemoryOffset + kApiInt64Size; | |
| 161 | 160 | static const int kExternalMemoryAtLastMarkCompactOffset = | |
| 162 | 161 | kExternalMemoryLimitOffset + kApiInt64Size; | |
| 163 | - static const int kIsolateFastCCallCallerFpOffset = | ||
| 164 | - kExternalMemoryAtLastMarkCompactOffset + kApiInt64Size; | ||
| 165 | - static const int kIsolateFastCCallCallerPcOffset = | ||
| 166 | - kIsolateFastCCallCallerFpOffset + kApiSystemPointerSize; | ||
| 167 | - static const int kIsolateStackGuardOffset = | ||
| 168 | - kIsolateFastCCallCallerPcOffset + kApiSystemPointerSize; | ||
| 169 | 162 | static const int kIsolateRootsOffset = | |
| 170 | - kIsolateStackGuardOffset + 7 * kApiSystemPointerSize; | ||
| 163 | + kExternalMemoryAtLastMarkCompactOffset + kApiInt64Size; | ||
| 171 | 164 | ||
| 172 | 165 | static const int kUndefinedValueRootIndex = 4; | |
| 173 | 166 | static const int kTheHoleValueRootIndex = 5; | |
@@ -186,7 +179,7 @@ class Internals { | |||
| 186 | 179 | ||
| 187 | 180 | static const int kFirstNonstringType = 0x40; | |
| 188 | 181 | static const int kOddballType = 0x43; | |
| 189 | - static const int kForeignType = 0x46; | ||
| 182 | + static const int kForeignType = 0x47; | ||
| 190 | 183 | static const int kJSSpecialApiObjectType = 0x410; | |
| 191 | 184 | static const int kJSApiObjectType = 0x420; | |
| 192 | 185 | static const int kJSObjectType = 0x421; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -439,6 +439,14 @@ class Platform { | |||
| 439 | 439 | */ | |
| 440 | 440 | virtual void DumpWithoutCrashing() {} | |
| 441 | 441 | ||
| 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 | + | ||
| 442 | 450 | protected: | |
| 443 | 451 | /** | |
| 444 | 452 | * Default implementation of current wall-clock time in milliseconds | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,8 +18,8 @@ namespace v8 { | |||
| 18 | 18 | class HeapGraphNode; | |
| 19 | 19 | struct HeapStatsUpdate; | |
| 20 | 20 | ||
| 21 | - using NativeObject = void*; | ||
| 22 | - using SnapshotObjectId = uint32_t; | ||
| 21 | + typedef uint32_t SnapshotObjectId; | ||
| 22 | + | ||
| 23 | 23 | ||
| 24 | 24 | struct CpuProfileDeoptFrame { | |
| 25 | 25 | int script_id; | |
@@ -272,10 +272,12 @@ class V8_EXPORT CpuProfilingOptions { | |||
| 272 | 272 | * zero, the sampling interval will be equal to | |
| 273 | 273 | * the profiler's sampling interval. | |
| 274 | 274 | */ | |
| 275 | - CpuProfilingOptions( | ||
| 276 | - CpuProfilingMode mode = kLeafNodeLineNumbers, | ||
| 277 | - unsigned max_samples = kNoSampleLimit, int sampling_interval_us = 0, | ||
| 278 | - MaybeLocal<Context> filter_context = MaybeLocal<Context>()); | ||
| 275 | + CpuProfilingOptions(CpuProfilingMode mode = kLeafNodeLineNumbers, | ||
| 276 | + unsigned max_samples = kNoSampleLimit, | ||
| 277 | + int sampling_interval_us = 0) | ||
| 278 | + : mode_(mode), | ||
| 279 | + max_samples_(max_samples), | ||
| 280 | + sampling_interval_us_(sampling_interval_us) {} | ||
| 279 | 281 | ||
| 280 | 282 | CpuProfilingMode mode() const { return mode_; } | |
| 281 | 283 | unsigned max_samples() const { return max_samples_; } | |
@@ -284,13 +286,12 @@ class V8_EXPORT CpuProfilingOptions { | |||
| 284 | 286 | private: | |
| 285 | 287 | friend class internal::CpuProfile; | |
| 286 | 288 | ||
| 287 | - bool has_filter_context() const { return !filter_context_.IsEmpty(); } | ||
| 289 | + bool has_filter_context() const; | ||
| 288 | 290 | void* raw_filter_context() const; | |
| 289 | 291 | ||
| 290 | 292 | CpuProfilingMode mode_; | |
| 291 | 293 | unsigned max_samples_; | |
| 292 | 294 | int sampling_interval_us_; | |
| 293 | - CopyablePersistentTraits<Context>::CopyablePersistent filter_context_; | ||
| 294 | 295 | }; | |
| 295 | 296 | ||
| 296 | 297 | /** | |
@@ -752,12 +753,6 @@ class V8_EXPORT EmbedderGraph { | |||
| 752 | 753 | */ | |
| 753 | 754 | virtual const char* NamePrefix() { return nullptr; } | |
| 754 | 755 | ||
| 755 | - /** | ||
| 756 | - * Returns the NativeObject that can be used for querying the | ||
| 757 | - * |HeapSnapshot|. | ||
| 758 | - */ | ||
| 759 | - virtual NativeObject GetNativeObject() { return nullptr; } | ||
| 760 | - | ||
| 761 | 756 | Node(const Node&) = delete; | |
| 762 | 757 | Node& operator=(const Node&) = delete; | |
| 763 | 758 | }; | |
@@ -820,12 +815,6 @@ class V8_EXPORT HeapProfiler { | |||
| 820 | 815 | */ | |
| 821 | 816 | SnapshotObjectId GetObjectId(Local<Value> value); | |
| 822 | 817 | ||
| 823 | - /** | ||
| 824 | - * Returns SnapshotObjectId for a native object referenced by |value| if it | ||
| 825 | - * has been seen by the heap profiler, kUnknownObjectId otherwise. | ||
| 826 | - */ | ||
| 827 | - SnapshotObjectId GetObjectId(NativeObject value); | ||
| 828 | - | ||
| 829 | 818 | /** | |
| 830 | 819 | * Returns heap object with given SnapshotObjectId if the object is alive, | |
| 831 | 820 | * otherwise empty handle is returned. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2094,7 +2094,6 @@ struct SampleInfo { | |||
| 2094 | 2094 | StateTag vm_state; // Current VM state. | |
| 2095 | 2095 | void* external_callback_entry; // External callback address if VM is | |
| 2096 | 2096 | // executing an external callback. | |
| 2097 | - void* top_context; // Incumbent native context address. | ||
| 2098 | 2097 | }; | |
| 2099 | 2098 | ||
| 2100 | 2099 | struct MemoryRange { | |
@@ -7561,9 +7560,8 @@ class V8_EXPORT EmbedderHeapTracer { | |||
| 7561 | 7560 | * overriden to fill a |TraceSummary| that is used by V8 to schedule future | |
| 7562 | 7561 | * garbage collections. | |
| 7563 | 7562 | */ | |
| 7564 | - V8_DEPRECATE_SOON("Use version with parameter.", | ||
| 7565 | - virtual void TraceEpilogue()) {} | ||
| 7566 | - virtual void TraceEpilogue(TraceSummary* trace_summary); | ||
| 7563 | + virtual void TraceEpilogue() {} | ||
| 7564 | + virtual void TraceEpilogue(TraceSummary* trace_summary) { TraceEpilogue(); } | ||
| 7567 | 7565 | ||
| 7568 | 7566 | /** | |
| 7569 | 7567 | * Called upon entering the final marking pause. No more incremental marking | |
@@ -7835,7 +7833,6 @@ class V8_EXPORT Isolate { | |||
| 7835 | 7833 | class V8_EXPORT SuppressMicrotaskExecutionScope { | |
| 7836 | 7834 | public: | |
| 7837 | 7835 | explicit SuppressMicrotaskExecutionScope(Isolate* isolate); | |
| 7838 | - explicit SuppressMicrotaskExecutionScope(MicrotaskQueue* microtask_queue); | ||
| 7839 | 7836 | ~SuppressMicrotaskExecutionScope(); | |
| 7840 | 7837 | ||
| 7841 | 7838 | // Prevent copying of Scope objects. | |
@@ -7846,8 +7843,13 @@ class V8_EXPORT Isolate { | |||
| 7846 | 7843 | ||
| 7847 | 7844 | private: | |
| 7848 | 7845 | internal::Isolate* const isolate_; | |
| 7849 | - internal::MicrotaskQueue* const microtask_queue_; | ||
| 7850 | 7846 | internal::Address previous_stack_height_; | |
| 7847 | + static_assert(sizeof(internal::Address) == | ||
| 7848 | + sizeof(internal::MicrotaskQueue*) && | ||
| 7849 | + alignof(internal::Address) == | ||
| 7850 | + alignof(internal::MicrotaskQueue*), | ||
| 7851 | + "The previous_stack_height_ field can replace the " | ||
| 7852 | + "microtask_queue_ field ABI-wise"); | ||
| 7851 | 7853 | ||
| 7852 | 7854 | friend class internal::ThreadLocalTop; | |
| 7853 | 7855 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8183,14 +8183,13 @@ Isolate::AllowJavascriptExecutionScope::~AllowJavascriptExecutionScope() { | |||
| 8183 | 8183 | ||
| 8184 | 8184 | Isolate::SuppressMicrotaskExecutionScope::SuppressMicrotaskExecutionScope( | |
| 8185 | 8185 | Isolate* isolate) | |
| 8186 | - : isolate_(reinterpret_cast<i::Isolate*>(isolate)), | ||
| 8187 | - microtask_queue_(isolate_->default_microtask_queue()) { | ||
| 8186 | + : isolate_(reinterpret_cast<i::Isolate*>(isolate)) { | ||
| 8188 | 8187 | isolate_->thread_local_top()->IncrementCallDepth(this); | |
| 8189 | - microtask_queue_->IncrementMicrotasksSuppressions(); | ||
| 8188 | + isolate_->default_microtask_queue()->IncrementMicrotasksSuppressions(); | ||
| 8190 | 8189 | } | |
| 8191 | 8190 | ||
| 8192 | 8191 | Isolate::SuppressMicrotaskExecutionScope::~SuppressMicrotaskExecutionScope() { | |
| 8193 | - microtask_queue_->DecrementMicrotasksSuppressions(); | ||
| 8192 | + isolate_->default_microtask_queue()->DecrementMicrotasksSuppressions(); | ||
| 8194 | 8193 | isolate_->thread_local_top()->DecrementCallDepth(this); | |
| 8195 | 8194 | } | |
| 8196 | 8195 | ||
@@ -9975,25 +9974,12 @@ CpuProfiler* CpuProfiler::New(Isolate* isolate, CpuProfilingNamingMode mode) { | |||
| 9975 | 9974 | return New(isolate, mode, kLazyLogging); | |
| 9976 | 9975 | } | |
| 9977 | 9976 | ||
| 9978 | - CpuProfilingOptions::CpuProfilingOptions(CpuProfilingMode mode, | ||
| 9979 | - unsigned max_samples, | ||
| 9980 | - int sampling_interval_us, | ||
| 9981 | - MaybeLocal<Context> filter_context) | ||
| 9982 | - : mode_(mode), | ||
| 9983 | - max_samples_(max_samples), | ||
| 9984 | - sampling_interval_us_(sampling_interval_us) { | ||
| 9985 | - if (!filter_context.IsEmpty()) { | ||
| 9986 | - Local<Context> local_filter_context = filter_context.ToLocalChecked(); | ||
| 9987 | - filter_context_.Reset(local_filter_context->GetIsolate(), | ||
| 9988 | - local_filter_context); | ||
| 9989 | - } | ||
| 9977 | + bool CpuProfilingOptions::has_filter_context() const { | ||
| 9978 | + return false; | ||
| 9990 | 9979 | } | |
| 9991 | 9980 | ||
| 9992 | 9981 | void* CpuProfilingOptions::raw_filter_context() const { | |
| 9993 | - return reinterpret_cast<void*>( | ||
| 9994 | - i::Context::cast(*Utils::OpenPersistent(filter_context_)) | ||
| 9995 | - .native_context() | ||
| 9996 | - .address()); | ||
| 9982 | + return nullptr; | ||
| 9997 | 9983 | } | |
| 9998 | 9984 | ||
| 9999 | 9985 | void CpuProfiler::Dispose() { delete reinterpret_cast<i::CpuProfiler*>(this); } | |
@@ -10265,10 +10251,6 @@ SnapshotObjectId HeapProfiler::GetObjectId(Local<Value> value) { | |||
| 10265 | 10251 | return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(obj); | |
| 10266 | 10252 | } | |
| 10267 | 10253 | ||
| 10268 | - SnapshotObjectId HeapProfiler::GetObjectId(NativeObject value) { | ||
| 10269 | - return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(value); | ||
| 10270 | - } | ||
| 10271 | - | ||
| 10272 | 10254 | Local<Value> HeapProfiler::FindObjectById(SnapshotObjectId id) { | |
| 10273 | 10255 | i::Handle<i::Object> obj = | |
| 10274 | 10256 | reinterpret_cast<i::HeapProfiler*>(this)->FindHeapObjectById(id); | |
@@ -10401,17 +10383,6 @@ void EmbedderHeapTracer::TracePrologue(TraceFlags flags) { | |||
| 10401 | 10383 | #endif | |
| 10402 | 10384 | } | |
| 10403 | 10385 | ||
| 10404 | - void EmbedderHeapTracer::TraceEpilogue(TraceSummary* trace_summary) { | ||
| 10405 | - #if __clang__ | ||
| 10406 | - #pragma clang diagnostic push | ||
| 10407 | - #pragma clang diagnostic ignored "-Wdeprecated" | ||
| 10408 | - #endif | ||
| 10409 | - TraceEpilogue(); | ||
| 10410 | - #if __clang__ | ||
| 10411 | - #pragma clang diagnostic pop | ||
| 10412 | - #endif | ||
| 10413 | - } | ||
| 10414 | - | ||
| 10415 | 10386 | void EmbedderHeapTracer::FinalizeTracing() { | |
| 10416 | 10387 | if (isolate_) { | |
| 10417 | 10388 | i::Isolate* isolate = reinterpret_cast<i::Isolate*>(isolate_); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -111,27 +111,21 @@ class IsolateData final { | |||
| 111 | 111 | Address* builtins() { return builtins_; } | |
| 112 | 112 | ||
| 113 | 113 | private: | |
| 114 | - // Static layout definition. | ||
| 115 | - // | ||
| 116 | - // Note: The location of fields within IsolateData is significant. The | ||
| 117 | - // closer they are to the value of kRootRegister (i.e.: isolate_root()), the | ||
| 118 | - // cheaper it is to access them. See also: https://crbug.com/993264. | ||
| 119 | - // The recommend guideline is to put frequently-accessed fields close to the | ||
| 120 | - // beginning of IsolateData. | ||
| 114 | + // Static layout definition. | ||
| 121 | 115 | #define FIELDS(V) \ | |
| 122 | 116 | V(kEmbedderDataOffset, Internals::kNumIsolateDataSlots* kSystemPointerSize) \ | |
| 123 | 117 | V(kExternalMemoryOffset, kInt64Size) \ | |
| 124 | 118 | V(kExternalMemoryLlimitOffset, kInt64Size) \ | |
| 125 | 119 | V(kExternalMemoryAtLastMarkCompactOffset, kInt64Size) \ | |
| 126 | - V(kFastCCallCallerFPOffset, kSystemPointerSize) \ | ||
| 127 | - V(kFastCCallCallerPCOffset, kSystemPointerSize) \ | ||
| 128 | - V(kStackGuardOffset, StackGuard::kSizeInBytes) \ | ||
| 129 | 120 | V(kRootsTableOffset, RootsTable::kEntriesCount* kSystemPointerSize) \ | |
| 130 | 121 | V(kExternalReferenceTableOffset, ExternalReferenceTable::kSizeInBytes) \ | |
| 131 | 122 | V(kThreadLocalTopOffset, ThreadLocalTop::kSizeInBytes) \ | |
| 132 | 123 | V(kBuiltinEntryTableOffset, Builtins::builtin_count* kSystemPointerSize) \ | |
| 133 | 124 | V(kBuiltinsTableOffset, Builtins::builtin_count* kSystemPointerSize) \ | |
| 134 | 125 | V(kVirtualCallTargetRegisterOffset, kSystemPointerSize) \ | |
| 126 | + V(kFastCCallCallerFPOffset, kSystemPointerSize) \ | ||
| 127 | + V(kFastCCallCallerPCOffset, kSystemPointerSize) \ | ||
| 128 | + V(kStackGuardOffset, StackGuard::kSizeInBytes) \ | ||
| 135 | 129 | V(kStackIsIterableOffset, kUInt8Size) \ | |
| 136 | 130 | /* This padding aligns IsolateData size by 8 bytes. */ \ | |
| 137 | 131 | V(kPaddingOffset, \ | |
@@ -159,17 +153,6 @@ class IsolateData final { | |||
| 159 | 153 | // Caches the amount of external memory registered at the last MC. | |
| 160 | 154 | int64_t external_memory_at_last_mark_compact_ = 0; | |
| 161 | 155 | ||
| 162 | - // Stores the state of the caller for TurboAssembler::CallCFunction so that | ||
| 163 | - // the sampling CPU profiler can iterate the stack during such calls. These | ||
| 164 | - // are stored on IsolateData so that they can be stored to with only one move | ||
| 165 | - // instruction in compiled code. | ||
| 166 | - Address fast_c_call_caller_fp_ = kNullAddress; | ||
| 167 | - Address fast_c_call_caller_pc_ = kNullAddress; | ||
| 168 | - | ||
| 169 | - // Fields related to the system and JS stack. In particular, this contains the | ||
| 170 | - // stack limit used by stack checks in generated code. | ||
| 171 | - StackGuard stack_guard_; | ||
| 172 | - | ||
| 173 | 156 | RootsTable roots_; | |
| 174 | 157 | ||
| 175 | 158 | ExternalReferenceTable external_reference_table_; | |
@@ -189,6 +172,17 @@ class IsolateData final { | |||
| 189 | 172 | // ia32 (otherwise the arguments adaptor call runs out of registers). | |
| 190 | 173 | void* virtual_call_target_register_ = nullptr; | |
| 191 | 174 | ||
| 175 | + // Stores the state of the caller for TurboAssembler::CallCFunction so that | ||
| 176 | + // the sampling CPU profiler can iterate the stack during such calls. These | ||
| 177 | + // are stored on IsolateData so that they can be stored to with only one move | ||
| 178 | + // instruction in compiled code. | ||
| 179 | + Address fast_c_call_caller_fp_ = kNullAddress; | ||
| 180 | + Address fast_c_call_caller_pc_ = kNullAddress; | ||
| 181 | + | ||
| 182 | + // Fields related to the system and JS stack. In particular, this contains the | ||
| 183 | + // stack limit used by stack checks in generated code. | ||
| 184 | + StackGuard stack_guard_; | ||
| 185 | + | ||
| 192 | 186 | // Whether the SafeStackFrameIterator can successfully iterate the current | |
| 193 | 187 | // stack. Only valid values are 0 or 1. | |
| 194 | 188 | uint8_t stack_is_iterable_ = 1; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2924,14 +2924,6 @@ void Isolate::CheckIsolateLayout() { | |||
| 2924 | 2924 | CHECK_EQ(OFFSET_OF(Isolate, isolate_data_), 0); | |
| 2925 | 2925 | CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, isolate_data_.embedder_data_)), | |
| 2926 | 2926 | Internals::kIsolateEmbedderDataOffset); | |
| 2927 | - CHECK_EQ(static_cast<int>( | ||
| 2928 | - OFFSET_OF(Isolate, isolate_data_.fast_c_call_caller_fp_)), | ||
| 2929 | - Internals::kIsolateFastCCallCallerFpOffset); | ||
| 2930 | - CHECK_EQ(static_cast<int>( | ||
| 2931 | - OFFSET_OF(Isolate, isolate_data_.fast_c_call_caller_pc_)), | ||
| 2932 | - Internals::kIsolateFastCCallCallerPcOffset); | ||
| 2933 | - CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, isolate_data_.stack_guard_)), | ||
| 2934 | - Internals::kIsolateStackGuardOffset); | ||
| 2935 | 2927 | CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, isolate_data_.roots_)), | |
| 2936 | 2928 | Internals::kIsolateRootsOffset); | |
| 2937 | 2929 | CHECK_EQ(Internals::kExternalMemoryOffset % 8, 0); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,8 +133,8 @@ enum InstanceType : uint16_t { | |||
| 133 | 133 | ||
| 134 | 134 | // "Data", objects that cannot contain non-map-word pointers to heap | |
| 135 | 135 | // objects. | |
| 136 | - FOREIGN_TYPE, | ||
| 137 | 136 | BYTE_ARRAY_TYPE, | |
| 137 | + FOREIGN_TYPE, | ||
| 138 | 138 | BYTECODE_ARRAY_TYPE, | |
| 139 | 139 | FREE_SPACE_TYPE, | |
| 140 | 140 | FIXED_DOUBLE_ARRAY_TYPE, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,8 +67,8 @@ namespace internal { | |||
| 67 | 67 | \ | |
| 68 | 68 | V(MAP_TYPE) \ | |
| 69 | 69 | V(CODE_TYPE) \ | |
| 70 | - V(FOREIGN_TYPE) \ | ||
| 71 | 70 | V(BYTE_ARRAY_TYPE) \ | |
| 71 | + V(FOREIGN_TYPE) \ | ||
| 72 | 72 | V(BYTECODE_ARRAY_TYPE) \ | |
| 73 | 73 | V(FREE_SPACE_TYPE) \ | |
| 74 | 74 | \ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments