diff options
Diffstat (limited to 'deps/v8/src/inspector/v8-profiler-agent-impl.cc')
-rw-r--r-- | deps/v8/src/inspector/v8-profiler-agent-impl.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/deps/v8/src/inspector/v8-profiler-agent-impl.cc b/deps/v8/src/inspector/v8-profiler-agent-impl.cc index f14815fdc4b..1e16218e1ce 100644 --- a/deps/v8/src/inspector/v8-profiler-agent-impl.cc +++ b/deps/v8/src/inspector/v8-profiler-agent-impl.cc @@ -34,7 +34,7 @@ namespace { String16 resourceNameToUrl(V8InspectorImpl* inspector, v8::Local<v8::String> v8Name) { - String16 name = toProtocolString(v8Name); + String16 name = toProtocolString(inspector->isolate(), v8Name); if (!inspector) return name; std::unique_ptr<StringBuffer> url = inspector->client()->resourceNameToUrl(toStringView(name)); @@ -66,7 +66,7 @@ std::unique_ptr<protocol::Profiler::ProfileNode> buildInspectorObjectFor( v8::HandleScope handleScope(isolate); auto callFrame = protocol::Runtime::CallFrame::create() - .setFunctionName(toProtocolString(node->GetFunctionName())) + .setFunctionName(toProtocolString(isolate, node->GetFunctionName())) .setScriptId(String16::fromInteger(node->GetScriptId())) .setUrl(resourceNameToUrl(inspector, node->GetScriptResourceName())) .setLineNumber(node->GetLineNumber() - 1) @@ -337,6 +337,7 @@ Response coverageToProtocol( out_result) { std::unique_ptr<protocol::Array<protocol::Profiler::ScriptCoverage>> result = protocol::Array<protocol::Profiler::ScriptCoverage>::create(); + v8::Isolate* isolate = inspector->isolate(); for (size_t i = 0; i < coverage.ScriptCount(); i++) { v8::debug::Coverage::ScriptData script_data = coverage.GetScriptData(i); v8::Local<v8::debug::Script> script = script_data.GetScript(); @@ -366,6 +367,7 @@ Response coverageToProtocol( functions->addItem( protocol::Profiler::FunctionCoverage::create() .setFunctionName(toProtocolString( + isolate, function_data.Name().FromMaybe(v8::Local<v8::String>()))) .setRanges(std::move(ranges)) .setIsBlockCoverage(function_data.HasBlockCoverage()) @@ -374,7 +376,7 @@ Response coverageToProtocol( String16 url; v8::Local<v8::String> name; if (script->SourceURL().ToLocal(&name) && name->Length()) { - url = toProtocolString(name); + url = toProtocolString(isolate, name); } else if (script->Name().ToLocal(&name) && name->Length()) { url = resourceNameToUrl(inspector, name); } @@ -416,6 +418,7 @@ typeProfileToProtocol(V8InspectorImpl* inspector, const v8::debug::TypeProfile& type_profile) { std::unique_ptr<protocol::Array<protocol::Profiler::ScriptTypeProfile>> result = protocol::Array<protocol::Profiler::ScriptTypeProfile>::create(); + v8::Isolate* isolate = inspector->isolate(); for (size_t i = 0; i < type_profile.ScriptCount(); i++) { v8::debug::TypeProfile::ScriptData script_data = type_profile.GetScriptData(i); @@ -428,10 +431,11 @@ typeProfileToProtocol(V8InspectorImpl* inspector, std::unique_ptr<protocol::Array<protocol::Profiler::TypeObject>> types = protocol::Array<protocol::Profiler::TypeObject>::create(); for (const auto& type : entry.Types()) { - types->addItem(protocol::Profiler::TypeObject::create() - .setName(toProtocolString( - type.FromMaybe(v8::Local<v8::String>()))) - .build()); + types->addItem( + protocol::Profiler::TypeObject::create() + .setName(toProtocolString( + isolate, type.FromMaybe(v8::Local<v8::String>()))) + .build()); } entries->addItem(protocol::Profiler::TypeProfileEntry::create() .setOffset(entry.SourcePosition()) @@ -441,7 +445,7 @@ typeProfileToProtocol(V8InspectorImpl* inspector, String16 url; v8::Local<v8::String> name; if (script->SourceURL().ToLocal(&name) && name->Length()) { - url = toProtocolString(name); + url = toProtocolString(isolate, name); } else if (script->Name().ToLocal(&name) && name->Length()) { url = resourceNameToUrl(inspector, name); } |