diff --git a/BUILD.bazel b/BUILD.bazel index d0b6a9beb7..f9013ae944 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1270,8 +1270,6 @@ filegroup( "src/debug/debug-scopes.h", "src/debug/debug-stack-trace-iterator.cc", "src/debug/debug-stack-trace-iterator.h", - "src/debug/debug-type-profile.cc", - "src/debug/debug-type-profile.h", "src/debug/debug.cc", "src/debug/debug.h", "src/debug/interface-types.h", diff --git a/BUILD.gn b/BUILD.gn index 783a7af691..b822b0be4c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -2949,7 +2949,6 @@ v8_header_set("v8_internal_headers") { "src/debug/debug-scope-iterator.h", "src/debug/debug-scopes.h", "src/debug/debug-stack-trace-iterator.h", - "src/debug/debug-type-profile.h", "src/debug/debug.h", "src/debug/interface-types.h", "src/debug/liveedit-diff.h", @@ -4373,7 +4372,6 @@ v8_source_set("v8_base_without_compiler") { "src/debug/debug-scope-iterator.cc", "src/debug/debug-scopes.cc", "src/debug/debug-stack-trace-iterator.cc", - "src/debug/debug-type-profile.cc", "src/debug/debug.cc", "src/debug/liveedit-diff.cc", "src/debug/liveedit.cc", diff --git a/include/js_protocol-1.3.json b/include/js_protocol-1.3.json index ea573d11a6..a998d4611d 100644 --- a/include/js_protocol-1.3.json +++ b/include/js_protocol-1.3.json @@ -946,34 +946,6 @@ { "name": "url", "type": "string", "description": "JavaScript script name or url." }, { "name": "functions", "type": "array", "items": { "$ref": "FunctionCoverage" }, "description": "Functions contained in the script that has coverage data." } ] - }, - { "id": "TypeObject", - "type": "object", - "description": "Describes a type collected during runtime.", - "properties": [ - { "name": "name", "type": "string", "description": "Name of a type collected with type profiling." } - ], - "experimental": true - }, - { "id": "TypeProfileEntry", - "type": "object", - "description": "Source offset and types for a parameter or return value.", - "properties": [ - { "name": "offset", "type": "integer", "description": "Source offset of the parameter or end of function for return values." }, - { "name": "types", "type": "array", "items": {"$ref": "TypeObject"}, "description": "The types for this parameter or return value."} - ], - "experimental": true - }, - { - "id": "ScriptTypeProfile", - "type": "object", - "description": "Type profile data collected during runtime for a JavaScript script.", - "properties": [ - { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "JavaScript script id." }, - { "name": "url", "type": "string", "description": "JavaScript script name or url." }, - { "name": "entries", "type": "array", "items": { "$ref": "TypeProfileEntry" }, "description": "Type profile entries for parameters and return values of the functions in the script." } - ], - "experimental": true } ], "commands": [ @@ -1024,24 +996,6 @@ { "name": "result", "type": "array", "items": { "$ref": "ScriptCoverage" }, "description": "Coverage data for the current isolate." } ], "description": "Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection." - }, - { - "name": "startTypeProfile", - "description": "Enable type profile.", - "experimental": true - }, - { - "name": "stopTypeProfile", - "description": "Disable type profile. Disabling releases type profile data collected so far.", - "experimental": true - }, - { - "name": "takeTypeProfile", - "returns": [ - { "name": "result", "type": "array", "items": { "$ref": "ScriptTypeProfile" }, "description": "Type profile for all scripts since startTypeProfile() was turned on." } - ], - "description": "Collect type profile.", - "experimental": true } ], "events": [ diff --git a/include/js_protocol.pdl b/include/js_protocol.pdl index 2d56043552..b3b97fa117 100644 --- a/include/js_protocol.pdl +++ b/include/js_protocol.pdl @@ -918,30 +918,6 @@ domain Profiler # Functions contained in the script that has coverage data. array of FunctionCoverage functions - # Describes a type collected during runtime. - experimental type TypeObject extends object - properties - # Name of a type collected with type profiling. - string name - - # Source offset and types for a parameter or return value. - experimental type TypeProfileEntry extends object - properties - # Source offset of the parameter or end of function for return values. - integer offset - # The types for this parameter or return value. - array of TypeObject types - - # Type profile data collected during runtime for a JavaScript script. - experimental type ScriptTypeProfile extends object - properties - # JavaScript script id. - Runtime.ScriptId scriptId - # JavaScript script name or url. - string url - # Type profile entries for parameters and return values of the functions in the script. - array of TypeProfileEntry entries - command disable command enable @@ -976,9 +952,6 @@ domain Profiler # Monotonically increasing time (in seconds) when the coverage update was taken in the backend. number timestamp - # Enable type profile. - experimental command startTypeProfile - command stop returns # Recorded profile. @@ -988,9 +961,6 @@ domain Profiler # executing optimized code. command stopPreciseCoverage - # Disable type profile. Disabling releases type profile data collected so far. - experimental command stopTypeProfile - # Collect coverage data for the current isolate, and resets execution counters. Precise code # coverage needs to have started. command takePreciseCoverage @@ -1000,12 +970,6 @@ domain Profiler # Monotonically increasing time (in seconds) when the coverage update was taken in the backend. number timestamp - # Collect type profile. - experimental command takeTypeProfile - returns - # Type profile for all scripts since startTypeProfile() was turned on. - array of ScriptTypeProfile result - event consoleProfileFinished parameters string id diff --git a/src/baseline/baseline-compiler.cc b/src/baseline/baseline-compiler.cc index eafc384c69..7eb3097cd0 100644 --- a/src/baseline/baseline-compiler.cc +++ b/src/baseline/baseline-compiler.cc @@ -967,14 +967,6 @@ void BaselineCompiler::VisitDefineKeyedOwnPropertyInLiteral() { IndexAsTagged(3)); // slot } -void BaselineCompiler::VisitCollectTypeProfile() { - SaveAccumulatorScope accumulator_scope(&basm_); - CallRuntime(Runtime::kCollectTypeProfile, - IntAsSmi(0), // position - kInterpreterAccumulatorRegister, // value - FeedbackVector()); // feedback vector -} - void BaselineCompiler::VisitAdd() { CallBuiltin( RegisterOperand(0), kInterpreterAccumulatorRegister, Index(1)); diff --git a/src/codegen/compiler.cc b/src/codegen/compiler.cc index ccd5697241..5431deb83e 100644 --- a/src/codegen/compiler.cc +++ b/src/codegen/compiler.cc @@ -3282,8 +3282,6 @@ MaybeHandle CompileScriptOnMainThread( if (!maybe_script.ToHandle(&script)) { script = NewScript(isolate, &parse_info, source, script_details, natives); } - DCHECK_IMPLIES(parse_info.flags().collect_type_profile(), - script->IsUserJavaScript()); DCHECK_EQ(parse_info.flags().is_repl_mode(), script->is_repl_mode()); return Compiler::CompileToplevel(&parse_info, script, isolate, diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc index e9afe672ea..f43199cd37 100644 --- a/src/compiler/bytecode-graph-builder.cc +++ b/src/compiler/bytecode-graph-builder.cc @@ -1672,20 +1672,6 @@ void BytecodeGraphBuilder::VisitDefineKeyedOwnPropertyInLiteral() { environment()->RecordAfterState(node, Environment::kAttachFrameState); } -void BytecodeGraphBuilder::VisitCollectTypeProfile() { - PrepareEagerCheckpoint(); - - Node* position = - jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0)); - Node* value = environment()->LookupAccumulator(); - Node* vector = jsgraph()->Constant(feedback_vector()); - - const Operator* op = javascript()->CallRuntime(Runtime::kCollectTypeProfile); - - Node* node = NewNode(op, position, value, vector); - environment()->RecordAfterState(node, Environment::kAttachFrameState); -} - void BytecodeGraphBuilder::VisitLdaContextSlot() { const Operator* op = javascript()->LoadContext( bytecode_iterator().GetUnsignedImmediateOperand(2), diff --git a/src/debug/debug-coverage.cc b/src/debug/debug-coverage.cc index 623e557fd2..c434cede65 100644 --- a/src/debug/debug-coverage.cc +++ b/src/debug/debug-coverage.cc @@ -605,9 +605,8 @@ std::unique_ptr Coverage::CollectPrecise(Isolate* isolate) { DCHECK(!isolate->is_best_effort_code_coverage()); std::unique_ptr result = Collect(isolate, isolate->code_coverage_mode()); - if (!isolate->is_collecting_type_profile() && - (isolate->is_precise_binary_code_coverage() || - isolate->is_block_binary_code_coverage())) { + if (isolate->is_precise_binary_code_coverage() || + isolate->is_block_binary_code_coverage()) { // We do not have to hold onto feedback vectors for invocations we already // reported. So we can reset the list. isolate->SetFeedbackVectorsForProfilingTools( @@ -766,10 +765,8 @@ void Coverage::SelectMode(Isolate* isolate, debug::CoverageMode mode) { // following coverage recording (without reloads) will be at function // granularity. isolate->debug()->RemoveAllCoverageInfos(); - if (!isolate->is_collecting_type_profile()) { - isolate->SetFeedbackVectorsForProfilingTools( - ReadOnlyRoots(isolate).undefined_value()); - } + isolate->SetFeedbackVectorsForProfilingTools( + ReadOnlyRoots(isolate).undefined_value()); break; case debug::CoverageMode::kBlockBinary: case debug::CoverageMode::kBlockCount: diff --git a/src/debug/debug-interface.cc b/src/debug/debug-interface.cc index 26c88c450b..510e874b1a 100644 --- a/src/debug/debug-interface.cc +++ b/src/debug/debug-interface.cc @@ -14,7 +14,6 @@ #include "src/debug/debug-evaluate.h" #include "src/debug/debug-property-iterator.h" #include "src/debug/debug-stack-trace-iterator.h" -#include "src/debug/debug-type-profile.h" #include "src/debug/debug.h" #include "src/execution/vm-state-inl.h" #include "src/heap/heap.h" @@ -1317,48 +1316,6 @@ void Coverage::SelectMode(Isolate* isolate, CoverageMode mode) { i::Coverage::SelectMode(reinterpret_cast(isolate), mode); } -int TypeProfile::Entry::SourcePosition() const { return entry_->position; } - -std::vector> TypeProfile::Entry::Types() const { - std::vector> result; - for (const internal::Handle& type : entry_->types) { - result.emplace_back(ToApiHandle(type)); - } - return result; -} - -TypeProfile::ScriptData::ScriptData( - size_t index, std::shared_ptr type_profile) - : script_(&type_profile->at(index)), - type_profile_(std::move(type_profile)) {} - -Local