Lines Matching full:vm
50 void DFXJSNApi::DumpHeapSnapshot(const EcmaVM *vm, int dumpFormat, in DumpHeapSnapshot() argument
54 DumpHeapSnapshot(vm, dumpFormat, &stream, nullptr, isVmMode, isPrivate); in DumpHeapSnapshot()
57 void DFXJSNApi::DumpHeapSnapshot(const EcmaVM *vm, int dumpFormat, Stream *stream, Progress *progre… in DumpHeapSnapshot() argument
62 const_cast<EcmaVM *>(vm)); in DumpHeapSnapshot()
64 ecmascript::HeapProfilerInterface::Destroy(const_cast<EcmaVM *>(vm)); in DumpHeapSnapshot()
67 void DFXJSNApi::DumpHeapSnapshot([[maybe_unused]] const EcmaVM *vm, [[maybe_unused]] int dumpFormat, in DumpHeapSnapshot() argument
72 DFXJSNApi::StopCpuProfilerForFile(vm); in DumpHeapSnapshot()
74 auto &options = const_cast<EcmaVM *>(vm)->GetJSOptions(); in DumpHeapSnapshot()
81 vm->GetJSThread()->SetStackTraceFd(stackTraceFd); in DumpHeapSnapshot()
91 DumpHeapSnapshot(vm, dumpFormat, &stream, nullptr, isVmMode, isPrivate); in DumpHeapSnapshot()
95 bool DFXJSNApi::BuildNativeAndJsStackTrace(const EcmaVM *vm, std::string &stackTraceStr) in BuildNativeAndJsStackTrace() argument
98 …std::vector<JsFrameInfo> jf = ecmascript::JsStackInfo::BuildJsStackInfo(vm->GetAssociatedJSThread(… in BuildNativeAndJsStackTrace()
110 stackTraceStr = ecmascript::JsStackInfo::BuildJsStackTrace(vm->GetAssociatedJSThread(), true); in BuildNativeAndJsStackTrace()
117 bool DFXJSNApi::BuildJsStackTrace(const EcmaVM *vm, std::string &stackTraceStr) in BuildJsStackTrace() argument
119 stackTraceStr = ecmascript::JsStackInfo::BuildJsStackTrace(vm->GetAssociatedJSThread(), false); in BuildJsStackTrace()
126 bool DFXJSNApi::StartHeapTracking(const EcmaVM *vm, double timeInterval, bool isVmMode, in StartHeapTracking() argument
131 const_cast<EcmaVM *>(vm)); in StartHeapTracking()
135 bool DFXJSNApi::UpdateHeapTracking(const EcmaVM *vm, Stream *stream) in UpdateHeapTracking() argument
139 const_cast<EcmaVM *>(vm)); in UpdateHeapTracking()
143 bool DFXJSNApi::StopHeapTracking(const EcmaVM *vm, const std::string &filePath, bool newThread) in StopHeapTracking() argument
146 return StopHeapTracking(vm, &stream, nullptr, newThread); in StopHeapTracking()
149 bool DFXJSNApi::StopHeapTracking(const EcmaVM *vm, Stream* stream, Progress *progress, bool newThre… in StopHeapTracking() argument
154 const_cast<EcmaVM *>(vm)); in StopHeapTracking()
156 ecmascript::HeapProfilerInterface::Destroy(const_cast<EcmaVM *>(vm)); in StopHeapTracking()
160 void DFXJSNApi::PrintStatisticResult(const EcmaVM *vm) in PrintStatisticResult() argument
162 ecmascript::GCStats gcstats(vm->GetHeap()); in PrintStatisticResult()
166 void DFXJSNApi::StartRuntimeStat(EcmaVM *vm) in StartRuntimeStat() argument
168 vm->SetRuntimeStatEnable(true); in StartRuntimeStat()
171 void DFXJSNApi::StopRuntimeStat(EcmaVM *vm) in StopRuntimeStat() argument
173 vm->SetRuntimeStatEnable(false); in StopRuntimeStat()
176 size_t DFXJSNApi::GetArrayBufferSize(const EcmaVM *vm) in GetArrayBufferSize() argument
178 return vm->GetHeap()->GetArrayBufferSize(); in GetArrayBufferSize()
181 size_t DFXJSNApi::GetHeapTotalSize(const EcmaVM *vm) in GetHeapTotalSize() argument
183 return vm->GetHeap()->GetCommittedSize(); in GetHeapTotalSize()
186 size_t DFXJSNApi::GetHeapUsedSize(const EcmaVM *vm) in GetHeapUsedSize() argument
188 return vm->GetHeap()->GetHeapObjectSize(); in GetHeapUsedSize()
191 void DFXJSNApi::NotifyApplicationState(EcmaVM *vm, bool inBackground) in NotifyApplicationState() argument
193 const_cast<ecmascript::Heap *>(vm->GetHeap())->ChangeGCParams(inBackground); in NotifyApplicationState()
196 void DFXJSNApi::NotifyIdleTime(const EcmaVM *vm, int idleMicroSec) in NotifyIdleTime() argument
198 const_cast<ecmascript::Heap *>(vm->GetHeap())->TriggerIdleCollection(idleMicroSec); in NotifyIdleTime()
201 void DFXJSNApi::NotifyMemoryPressure(EcmaVM *vm, bool inHighMemoryPressure) in NotifyMemoryPressure() argument
203 const_cast<ecmascript::Heap *>(vm->GetHeap())->NotifyMemoryPressure(inHighMemoryPressure); in NotifyMemoryPressure()
206 void DFXJSNApi::StartCpuProfilerForFile(const EcmaVM *vm, const std::string &fileName, const int in… in StartCpuProfilerForFile() argument
208 if (vm == nullptr) { in StartCpuProfilerForFile()
211 CpuProfiler *profiler = vm->GetProfiler(); in StartCpuProfilerForFile()
213 profiler = new CpuProfiler(vm, interval); in StartCpuProfilerForFile()
214 const_cast<EcmaVM *>(vm)->SetProfiler(profiler); in StartCpuProfilerForFile()
219 void DFXJSNApi::StopCpuProfilerForFile(const EcmaVM *vm) in StopCpuProfilerForFile() argument
221 if (vm == nullptr) { in StopCpuProfilerForFile()
224 CpuProfiler *profiler = vm->GetProfiler(); in StopCpuProfilerForFile()
231 const_cast<EcmaVM *>(vm)->SetProfiler(nullptr); in StopCpuProfilerForFile()
234 void DFXJSNApi::StartCpuProfilerForInfo(const EcmaVM *vm, const int interval) in StartCpuProfilerForInfo() argument
236 if (vm == nullptr) { in StartCpuProfilerForInfo()
239 CpuProfiler *profiler = vm->GetProfiler(); in StartCpuProfilerForInfo()
241 profiler = new CpuProfiler(vm, interval); in StartCpuProfilerForInfo()
242 const_cast<EcmaVM *>(vm)->SetProfiler(profiler); in StartCpuProfilerForInfo()
247 std::unique_ptr<ProfileInfo> DFXJSNApi::StopCpuProfilerForInfo(const EcmaVM *vm) in StopCpuProfilerForInfo() argument
249 if (vm == nullptr) { in StopCpuProfilerForInfo()
252 CpuProfiler *profiler = vm->GetProfiler(); in StopCpuProfilerForInfo()
262 const_cast<EcmaVM *>(vm)->SetProfiler(nullptr); in StopCpuProfilerForInfo()
266 void DFXJSNApi::SetCpuSamplingInterval(const EcmaVM *vm, int interval) in SetCpuSamplingInterval() argument
269 if (vm == nullptr) { in SetCpuSamplingInterval()
272 CpuProfiler *profiler = vm->GetProfiler(); in SetCpuSamplingInterval()
274 profiler = new CpuProfiler(vm, interval); in SetCpuSamplingInterval()
275 const_cast<EcmaVM *>(vm)->SetProfiler(profiler); in SetCpuSamplingInterval()
282 bool DFXJSNApi::SuspendVM(const EcmaVM *vm) in SuspendVM() argument
284 … ecmascript::VmThreadControl* vmThreadControl = vm->GetAssociatedJSThread()->GetVmThreadControl(); in SuspendVM()
288 void DFXJSNApi::ResumeVM(const EcmaVM *vm) in ResumeVM() argument
290 … ecmascript::VmThreadControl* vmThreadControl = vm->GetAssociatedJSThread()->GetVmThreadControl(); in ResumeVM()
294 bool DFXJSNApi::IsSuspended(const EcmaVM *vm) in IsSuspended() argument
296 … ecmascript::VmThreadControl* vmThreadControl = vm->GetAssociatedJSThread()->GetVmThreadControl(); in IsSuspended()
300 bool DFXJSNApi::CheckSafepoint(const EcmaVM *vm) in CheckSafepoint() argument
302 ecmascript::JSThread* thread = vm->GetJSThread(); in CheckSafepoint()
308 EcmaVM *vm; in BuildJsStackInfoList() local
310 vm = const_cast<EcmaVM*>(hostVm); in BuildJsStackInfoList()
312 vm = hostVm->GetWorkerVm(tid); in BuildJsStackInfoList()
313 if (vm == nullptr) { in BuildJsStackInfoList()
318 jsFrames = ecmascript::JsStackInfo::BuildJsStackInfo(vm->GetAssociatedJSThread()); in BuildJsStackInfoList()