Commit 51207093 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[debug] remove break_id

The break id is no longer used.

Bug: v8:5530
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ib07046d66497cbd5e01a8a1248afd890180200bf
Reviewed-on: https://chromium-review.googlesource.com/1172136Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55074}
parent 9056c46a
...@@ -10050,7 +10050,6 @@ void debug::GlobalLexicalScopeNames( ...@@ -10050,7 +10050,6 @@ void debug::GlobalLexicalScopeNames(
void debug::SetReturnValue(v8::Isolate* v8_isolate, void debug::SetReturnValue(v8::Isolate* v8_isolate,
v8::Local<v8::Value> value) { v8::Local<v8::Value> value) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
if (!isolate->debug()->break_id()) return;
isolate->debug()->set_return_value(*Utils::OpenHandle(*value)); isolate->debug()->set_return_value(*Utils::OpenHandle(*value));
} }
......
...@@ -336,8 +336,6 @@ void DebugFeatureTracker::Track(DebugFeatureTracker::Feature feature) { ...@@ -336,8 +336,6 @@ void DebugFeatureTracker::Track(DebugFeatureTracker::Feature feature) {
// Threading support. // Threading support.
void Debug::ThreadInit() { void Debug::ThreadInit() {
thread_local_.break_count_ = 0;
thread_local_.break_id_ = 0;
thread_local_.break_frame_id_ = StackFrame::NO_ID; thread_local_.break_frame_id_ = StackFrame::NO_ID;
thread_local_.last_step_action_ = StepNone; thread_local_.last_step_action_ = StepNone;
thread_local_.last_statement_position_ = kNoSourcePosition; thread_local_.last_statement_position_ = kNoSourcePosition;
...@@ -2012,15 +2010,15 @@ void Debug::PrintBreakLocation() { ...@@ -2012,15 +2010,15 @@ void Debug::PrintBreakLocation() {
DebugScope::DebugScope(Debug* debug) DebugScope::DebugScope(Debug* debug)
: debug_(debug), : debug_(debug),
prev_(debug->debugger_entry()), prev_(reinterpret_cast<DebugScope*>(
base::Relaxed_Load(&debug->thread_local_.current_debug_scope_))),
no_termination_exceptons_(debug_->isolate_, no_termination_exceptons_(debug_->isolate_,
StackGuard::TERMINATE_EXECUTION) { StackGuard::TERMINATE_EXECUTION) {
// Link recursive debugger entry. // Link recursive debugger entry.
base::Relaxed_Store(&debug_->thread_local_.current_debug_scope_, base::Relaxed_Store(&debug_->thread_local_.current_debug_scope_,
reinterpret_cast<base::AtomicWord>(this)); reinterpret_cast<base::AtomicWord>(this));
// Store the previous break id, frame id and return value. // Store the previous frame id and return value.
break_id_ = debug_->break_id();
break_frame_id_ = debug_->break_frame_id(); break_frame_id_ = debug_->break_frame_id();
// Create the new break info. If there is no proper frames there is no break // Create the new break info. If there is no proper frames there is no break
...@@ -2029,7 +2027,6 @@ DebugScope::DebugScope(Debug* debug) ...@@ -2029,7 +2027,6 @@ DebugScope::DebugScope(Debug* debug)
bool has_frames = !it.done(); bool has_frames = !it.done();
debug_->thread_local_.break_frame_id_ = debug_->thread_local_.break_frame_id_ =
has_frames ? it.frame()->id() : StackFrame::NO_ID; has_frames ? it.frame()->id() : StackFrame::NO_ID;
debug_->SetNextBreakId();
debug_->UpdateState(); debug_->UpdateState();
} }
...@@ -2042,7 +2039,6 @@ DebugScope::~DebugScope() { ...@@ -2042,7 +2039,6 @@ DebugScope::~DebugScope() {
// Restore to the previous break state. // Restore to the previous break state.
debug_->thread_local_.break_frame_id_ = break_frame_id_; debug_->thread_local_.break_frame_id_ = break_frame_id_;
debug_->thread_local_.break_id_ = break_id_;
debug_->UpdateState(); debug_->UpdateState();
} }
......
...@@ -317,7 +317,7 @@ class Debug { ...@@ -317,7 +317,7 @@ class Debug {
void Iterate(RootVisitor* v); void Iterate(RootVisitor* v);
void InitThread(const ExecutionAccess& lock) { ThreadInit(); } void InitThread(const ExecutionAccess& lock) { ThreadInit(); }
bool CheckExecutionState() { return is_active() && break_id() != 0; } bool CheckExecutionState() { return is_active(); }
void StartSideEffectCheckMode(); void StartSideEffectCheckMode();
void StopSideEffectCheckMode(); void StopSideEffectCheckMode();
...@@ -332,11 +332,6 @@ class Debug { ...@@ -332,11 +332,6 @@ class Debug {
bool PerformSideEffectCheckForObject(Handle<Object> object); bool PerformSideEffectCheckForObject(Handle<Object> object);
// Flags and states. // Flags and states.
DebugScope* debugger_entry() {
return reinterpret_cast<DebugScope*>(
base::Relaxed_Load(&thread_local_.current_debug_scope_));
}
inline bool is_active() const { return is_active_; } inline bool is_active() const { return is_active_; }
inline bool in_debug_scope() const { inline bool in_debug_scope() const {
return !!base::Relaxed_Load(&thread_local_.current_debug_scope_); return !!base::Relaxed_Load(&thread_local_.current_debug_scope_);
...@@ -349,7 +344,6 @@ class Debug { ...@@ -349,7 +344,6 @@ class Debug {
bool break_points_active() const { return break_points_active_; } bool break_points_active() const { return break_points_active_; }
StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; } StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; }
int break_id() { return thread_local_.break_id_; }
Handle<Object> return_value_handle(); Handle<Object> return_value_handle();
Object* return_value() { return thread_local_.return_value_; } Object* return_value() { return thread_local_.return_value_; }
...@@ -393,9 +387,6 @@ class Debug { ...@@ -393,9 +387,6 @@ class Debug {
void UpdateState(); void UpdateState();
void UpdateHookOnFunctionCall(); void UpdateHookOnFunctionCall();
void Unload(); void Unload();
void SetNextBreakId() {
thread_local_.break_id_ = ++thread_local_.break_count_;
}
// Return the number of virtual frames below debugger entry. // Return the number of virtual frames below debugger entry.
int CurrentFrameCount(); int CurrentFrameCount();
...@@ -503,12 +494,6 @@ class Debug { ...@@ -503,12 +494,6 @@ class Debug {
// Top debugger entry. // Top debugger entry.
base::AtomicWord current_debug_scope_; base::AtomicWord current_debug_scope_;
// Counter for generating next break id.
int break_count_;
// Current break id.
int break_id_;
// Frame id for the frame of the current break. // Frame id for the frame of the current break.
StackFrame::Id break_frame_id_; StackFrame::Id break_frame_id_;
...@@ -578,7 +563,6 @@ class DebugScope BASE_EMBEDDED { ...@@ -578,7 +563,6 @@ class DebugScope BASE_EMBEDDED {
Debug* debug_; Debug* debug_;
DebugScope* prev_; // Previous scope if entered recursively. DebugScope* prev_; // Previous scope if entered recursively.
StackFrame::Id break_frame_id_; // Previous break frame id. StackFrame::Id break_frame_id_; // Previous break frame id.
int break_id_; // Previous break id.
PostponeInterruptsScope no_termination_exceptons_; PostponeInterruptsScope no_termination_exceptons_;
}; };
......
...@@ -191,10 +191,6 @@ class DebugEventCounter : public v8::debug::DebugDelegate { ...@@ -191,10 +191,6 @@ class DebugEventCounter : public v8::debug::DebugDelegate {
public: public:
void BreakProgramRequested(v8::Local<v8::Context>, void BreakProgramRequested(v8::Local<v8::Context>,
const std::vector<v8::debug::BreakpointId>&) { const std::vector<v8::debug::BreakpointId>&) {
v8::internal::Debug* debug = CcTest::i_isolate()->debug();
// When hitting a debug event listener there must be a break set.
CHECK_NE(debug->break_id(), 0);
break_point_hit_count++; break_point_hit_count++;
// Perform a full deoptimization when the specified number of // Perform a full deoptimization when the specified number of
// breaks have been hit. // breaks have been hit.
...@@ -217,10 +213,6 @@ class DebugEventBreakPointCollectGarbage : public v8::debug::DebugDelegate { ...@@ -217,10 +213,6 @@ class DebugEventBreakPointCollectGarbage : public v8::debug::DebugDelegate {
public: public:
void BreakProgramRequested(v8::Local<v8::Context>, void BreakProgramRequested(v8::Local<v8::Context>,
const std::vector<v8::debug::BreakpointId>&) { const std::vector<v8::debug::BreakpointId>&) {
v8::internal::Debug* debug = CcTest::i_isolate()->debug();
// When hitting a debug event listener there must be a break set.
CHECK_NE(debug->break_id(), 0);
// Perform a garbage collection when break point is hit and continue. Based // Perform a garbage collection when break point is hit and continue. Based
// on the number of break points hit either scavenge or mark compact // on the number of break points hit either scavenge or mark compact
// collector is used. // collector is used.
...@@ -241,10 +233,6 @@ class DebugEventBreak : public v8::debug::DebugDelegate { ...@@ -241,10 +233,6 @@ class DebugEventBreak : public v8::debug::DebugDelegate {
public: public:
void BreakProgramRequested(v8::Local<v8::Context>, void BreakProgramRequested(v8::Local<v8::Context>,
const std::vector<v8::debug::BreakpointId>&) { const std::vector<v8::debug::BreakpointId>&) {
v8::internal::Debug* debug = CcTest::i_isolate()->debug();
// When hitting a debug event listener there must be a break set.
CHECK_NE(debug->break_id(), 0);
// Count the number of breaks. // Count the number of breaks.
break_point_hit_count++; break_point_hit_count++;
...@@ -271,9 +259,6 @@ class DebugEventBreakMax : public v8::debug::DebugDelegate { ...@@ -271,9 +259,6 @@ class DebugEventBreakMax : public v8::debug::DebugDelegate {
const std::vector<v8::debug::BreakpointId>&) { const std::vector<v8::debug::BreakpointId>&) {
v8::Isolate* v8_isolate = CcTest::isolate(); v8::Isolate* v8_isolate = CcTest::isolate();
v8::internal::Isolate* isolate = CcTest::i_isolate(); v8::internal::Isolate* isolate = CcTest::i_isolate();
v8::internal::Debug* debug = isolate->debug();
// When hitting a debug event listener there must be a break set.
CHECK_NE(debug->break_id(), 0);
if (break_point_hit_count < max_break_point_hit_count) { if (break_point_hit_count < max_break_point_hit_count) {
// Count the number of breaks. // Count the number of breaks.
break_point_hit_count++; break_point_hit_count++;
......
...@@ -25,7 +25,6 @@ function listener(event, exec_state, event_data, data) { ...@@ -25,7 +25,6 @@ function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return; if (event != Debug.DebugEvent.Break) return;
++break_count; ++break_count;
try { try {
var break_id = exec_state.break_id;
var frame_count = exec_state.frameCount(); var frame_count = exec_state.frameCount();
assertEquals(expected_frames.length, frame_count, 'frame count'); assertEquals(expected_frames.length, frame_count, 'frame count');
......
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