Commit 41a9dea3 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[debug] do not check break points against undefined.

Break points are cleared to empty fixed array, not undefined.

R=jgruber@chromium.org

Change-Id: Id8dcd08ed0aebc5c4f7745982cde48d562af9772
Reviewed-on: https://chromium-review.googlesource.com/904202Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51117}
parent d4f072ce
......@@ -680,7 +680,6 @@ int Debug::FindBreakablePosition(Handle<DebugInfo> debug_info,
void Debug::ApplyBreakPoints(Handle<DebugInfo> debug_info) {
DisallowHeapAllocation no_gc;
if (debug_info->break_points()->IsUndefined(isolate_)) return;
FixedArray* break_points = debug_info->break_points();
for (int i = 0; i < break_points->length(); i++) {
if (break_points->get(i)->IsUndefined(isolate_)) continue;
......
......@@ -45,14 +45,12 @@ bool DebugInfo::HasBreakPoint(int source_position) {
Object* DebugInfo::GetBreakPointInfo(int source_position) {
DCHECK(HasBreakInfo());
Isolate* isolate = GetIsolate();
if (!break_points()->IsUndefined(isolate)) {
for (int i = 0; i < break_points()->length(); i++) {
if (!break_points()->get(i)->IsUndefined(isolate)) {
BreakPointInfo* break_point_info =
BreakPointInfo::cast(break_points()->get(i));
if (break_point_info->source_position() == source_position) {
return break_point_info;
}
for (int i = 0; i < break_points()->length(); i++) {
if (!break_points()->get(i)->IsUndefined(isolate)) {
BreakPointInfo* break_point_info =
BreakPointInfo::cast(break_points()->get(i));
if (break_point_info->source_position() == source_position) {
return break_point_info;
}
}
}
......@@ -63,7 +61,6 @@ bool DebugInfo::ClearBreakPoint(Handle<DebugInfo> debug_info,
Handle<Object> break_point_object) {
DCHECK(debug_info->HasBreakInfo());
Isolate* isolate = debug_info->GetIsolate();
if (debug_info->break_points()->IsUndefined(isolate)) return false;
for (int i = 0; i < debug_info->break_points()->length(); i++) {
if (debug_info->break_points()->get(i)->IsUndefined(isolate)) continue;
......@@ -139,7 +136,6 @@ Handle<Object> DebugInfo::GetBreakPointObjects(int source_position) {
int DebugInfo::GetBreakPointCount() {
DCHECK(HasBreakInfo());
Isolate* isolate = GetIsolate();
if (break_points()->IsUndefined(isolate)) return 0;
int count = 0;
for (int i = 0; i < break_points()->length(); i++) {
if (!break_points()->get(i)->IsUndefined(isolate)) {
......@@ -155,15 +151,13 @@ Handle<Object> DebugInfo::FindBreakPointInfo(
Handle<DebugInfo> debug_info, Handle<Object> break_point_object) {
DCHECK(debug_info->HasBreakInfo());
Isolate* isolate = debug_info->GetIsolate();
if (!debug_info->break_points()->IsUndefined(isolate)) {
for (int i = 0; i < debug_info->break_points()->length(); i++) {
if (!debug_info->break_points()->get(i)->IsUndefined(isolate)) {
Handle<BreakPointInfo> break_point_info = Handle<BreakPointInfo>(
BreakPointInfo::cast(debug_info->break_points()->get(i)), isolate);
if (BreakPointInfo::HasBreakPointObject(break_point_info,
break_point_object)) {
return break_point_info;
}
for (int i = 0; i < debug_info->break_points()->length(); i++) {
if (!debug_info->break_points()->get(i)->IsUndefined(isolate)) {
Handle<BreakPointInfo> break_point_info = Handle<BreakPointInfo>(
BreakPointInfo::cast(debug_info->break_points()->get(i)), isolate);
if (BreakPointInfo::HasBreakPointObject(break_point_info,
break_point_object)) {
return break_point_info;
}
}
}
......
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