Commit 3ef2f7a8 authored by yangguo's avatar yangguo Committed by Commit bot

[debugger] remove some dead code.

The change removes threading information from the JSON debug API, which
is deprecated anyways.

R=cbruni@chromium.org

Review URL: https://codereview.chromium.org/1924743002

Cr-Commit-Position: refs/heads/master@{#35821}
parent 42c0e2ec
......@@ -894,10 +894,6 @@ ExecutionState.prototype.frameCount = function() {
return %GetFrameCount(this.break_id);
};
ExecutionState.prototype.threadCount = function() {
return %GetThreadCount(this.break_id);
};
ExecutionState.prototype.frame = function(opt_index) {
// If no index supplied return the selected frame.
if (opt_index == null) opt_index = this.selected_frame;
......@@ -2173,28 +2169,6 @@ DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) {
};
DebugCommandProcessor.prototype.threadsRequest_ = function(request, response) {
// Get the number of threads.
var total_threads = this.exec_state_.threadCount();
// Get information for all threads.
var threads = [];
for (var i = 0; i < total_threads; i++) {
var details = %GetThreadDetails(this.exec_state_.break_id, i);
var thread_info = { current: details[0],
id: details[1]
};
threads.push(thread_info);
}
// Create the response body.
response.body = {
totalThreads: total_threads,
threads: threads
};
};
DebugCommandProcessor.prototype.suspendRequest_ = function(request, response) {
response.running = false;
};
......@@ -2360,7 +2334,6 @@ DebugCommandProcessor.prototype.dispatch_ = (function() {
"references": proto.referencesRequest_,
"source": proto.sourceRequest_,
"scripts": proto.scriptsRequest_,
"threads": proto.threadsRequest_,
"suspend": proto.suspendRequest_,
"version": proto.versionRequest_,
"changelive": proto.changeLiveRequest_,
......
......@@ -1529,11 +1529,6 @@ PropertyMirror.prototype.propertyType = function() {
};
PropertyMirror.prototype.insertionIndex = function() {
return %DebugPropertyIndexFromDetails(this.details_);
};
/**
* Returns whether this property has a getter defined through __defineGetter__.
* @return {booolean} True if this property has a getter
......
......@@ -410,50 +410,6 @@ RUNTIME_FUNCTION(Runtime_DebugPropertyAttributesFromDetails) {
}
// Return the property insertion index calculated from the property details.
// args[0]: smi with property details.
RUNTIME_FUNCTION(Runtime_DebugPropertyIndexFromDetails) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 1);
CONVERT_PROPERTY_DETAILS_CHECKED(details, 0);
// TODO(verwaest): Works only for dictionary mode holders.
return Smi::FromInt(details.dictionary_index());
}
// Return property value from named interceptor.
// args[0]: object
// args[1]: property name
RUNTIME_FUNCTION(Runtime_DebugNamedInterceptorPropertyValue) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
RUNTIME_ASSERT(obj->HasNamedInterceptor());
CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
JSObject::GetProperty(obj, name));
return *result;
}
// Return element value from indexed interceptor.
// args[0]: object
// args[1]: index
RUNTIME_FUNCTION(Runtime_DebugIndexedInterceptorElementValue) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
RUNTIME_ASSERT(obj->HasIndexedInterceptor());
CONVERT_NUMBER_CHECKED(uint32_t, index, Uint32, args[1]);
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result, JSReceiver::GetElement(isolate, obj, index));
return *result;
}
RUNTIME_FUNCTION(Runtime_CheckExecutionState) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 1);
......@@ -960,78 +916,6 @@ RUNTIME_FUNCTION(Runtime_DebugPrintScopes) {
}
RUNTIME_FUNCTION(Runtime_GetThreadCount) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]);
RUNTIME_ASSERT(isolate->debug()->CheckExecutionState(break_id));
// Count all archived V8 threads.
int n = 0;
for (ThreadState* thread = isolate->thread_manager()->FirstThreadStateInUse();
thread != NULL; thread = thread->Next()) {
n++;
}
// Total number of threads is current thread and archived threads.
return Smi::FromInt(n + 1);
}
static const int kThreadDetailsCurrentThreadIndex = 0;
static const int kThreadDetailsThreadIdIndex = 1;
static const int kThreadDetailsSize = 2;
// Return an array with thread details
// args[0]: number: break id
// args[1]: number: thread index
//
// The array returned contains the following information:
// 0: Is current thread?
// 1: Thread id
RUNTIME_FUNCTION(Runtime_GetThreadDetails) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]);
RUNTIME_ASSERT(isolate->debug()->CheckExecutionState(break_id));
CONVERT_NUMBER_CHECKED(int, index, Int32, args[1]);
// Allocate array for result.
Handle<FixedArray> details =
isolate->factory()->NewFixedArray(kThreadDetailsSize);
// Thread index 0 is current thread.
if (index == 0) {
// Fill the details.
details->set(kThreadDetailsCurrentThreadIndex,
isolate->heap()->true_value());
details->set(kThreadDetailsThreadIdIndex,
Smi::FromInt(ThreadId::Current().ToInteger()));
} else {
// Find the thread with the requested index.
int n = 1;
ThreadState* thread = isolate->thread_manager()->FirstThreadStateInUse();
while (index != n && thread != NULL) {
thread = thread->Next();
n++;
}
if (thread == NULL) {
return isolate->heap()->undefined_value();
}
// Fill the details.
details->set(kThreadDetailsCurrentThreadIndex,
isolate->heap()->false_value());
details->set(kThreadDetailsThreadIdIndex,
Smi::FromInt(thread->id().ToInteger()));
}
// Convert to JS array and return.
return *isolate->factory()->NewJSArrayWithElements(details);
}
// Sets the disable break state
// args[0]: disable break state
RUNTIME_FUNCTION(Runtime_SetBreakPointsActive) {
......
......@@ -147,9 +147,6 @@ namespace internal {
F(DebugGetProperty, 2, 1) \
F(DebugPropertyTypeFromDetails, 1, 1) \
F(DebugPropertyAttributesFromDetails, 1, 1) \
F(DebugPropertyIndexFromDetails, 1, 1) \
F(DebugNamedInterceptorPropertyValue, 2, 1) \
F(DebugIndexedInterceptorElementValue, 2, 1) \
F(CheckExecutionState, 1, 1) \
F(GetFrameCount, 1, 1) \
F(GetFrameDetails, 2, 1) \
......@@ -160,8 +157,6 @@ namespace internal {
F(GetFunctionScopeDetails, 2, 1) \
F(SetScopeVariableValue, 6, 1) \
F(DebugPrintScopes, 0, 1) \
F(GetThreadCount, 1, 1) \
F(GetThreadDetails, 2, 1) \
F(SetBreakPointsActive, 1, 1) \
F(GetBreakLocations, 2, 1) \
F(SetFunctionBreakPoint, 3, 1) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment