Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: src/objects.cc

Issue 2238893002: [debugger] separate break point info from code instrumentation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 18472 matching lines...) Expand 10 before | Expand all | Expand 10 after
18483 BreakPointInfo::cast(break_points()->get(i)); 18483 BreakPointInfo::cast(break_points()->get(i));
18484 if (break_point_info->source_position() == source_position) { 18484 if (break_point_info->source_position() == source_position) {
18485 return break_point_info; 18485 return break_point_info;
18486 } 18486 }
18487 } 18487 }
18488 } 18488 }
18489 } 18489 }
18490 return isolate->heap()->undefined_value(); 18490 return isolate->heap()->undefined_value();
18491 } 18491 }
18492 18492
18493 // Clear a break point at the specified source_position. 18493 bool DebugInfo::ClearBreakPoint(Handle<DebugInfo> debug_info,
18494 void DebugInfo::ClearBreakPoint(Handle<DebugInfo> debug_info,
18495 int source_position,
18496 Handle<Object> break_point_object) { 18494 Handle<Object> break_point_object) {
18497 Isolate* isolate = debug_info->GetIsolate(); 18495 Isolate* isolate = debug_info->GetIsolate();
18498 Handle<Object> break_point_info( 18496 if (debug_info->break_points()->IsUndefined(isolate)) return false;
18499 debug_info->GetBreakPointInfo(source_position), isolate); 18497
18500 if (break_point_info->IsUndefined(isolate)) return; 18498 for (int i = 0; i < debug_info->break_points()->length(); i++) {
18501 BreakPointInfo::ClearBreakPoint( 18499 if (debug_info->break_points()->get(i)->IsUndefined(isolate)) continue;
18502 Handle<BreakPointInfo>::cast(break_point_info), 18500 Handle<BreakPointInfo> break_point_info = Handle<BreakPointInfo>(
18503 break_point_object); 18501 BreakPointInfo::cast(debug_info->break_points()->get(i)), isolate);
18502 if (BreakPointInfo::HasBreakPointObject(break_point_info,
18503 break_point_object)) {
18504 BreakPointInfo::ClearBreakPoint(break_point_info, break_point_object);
18505 return true;
18506 }
18507 }
18508 return false;
18504 } 18509 }
18505 18510
18506 void DebugInfo::SetBreakPoint(Handle<DebugInfo> debug_info, int source_position, 18511 void DebugInfo::SetBreakPoint(Handle<DebugInfo> debug_info, int source_position,
18507 int statement_position,
18508 Handle<Object> break_point_object) { 18512 Handle<Object> break_point_object) {
18509 Isolate* isolate = debug_info->GetIsolate(); 18513 Isolate* isolate = debug_info->GetIsolate();
18510 Handle<Object> break_point_info( 18514 Handle<Object> break_point_info(
18511 debug_info->GetBreakPointInfo(source_position), isolate); 18515 debug_info->GetBreakPointInfo(source_position), isolate);
18512 if (!break_point_info->IsUndefined(isolate)) { 18516 if (!break_point_info->IsUndefined(isolate)) {
18513 BreakPointInfo::SetBreakPoint( 18517 BreakPointInfo::SetBreakPoint(
18514 Handle<BreakPointInfo>::cast(break_point_info), 18518 Handle<BreakPointInfo>::cast(break_point_info),
18515 break_point_object); 18519 break_point_object);
18516 return; 18520 return;
18517 } 18521 }
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
19252 for (PrototypeIterator iter(isolate, this, kStartAtReceiver, 19256 for (PrototypeIterator iter(isolate, this, kStartAtReceiver,
19253 PrototypeIterator::END_AT_NULL); 19257 PrototypeIterator::END_AT_NULL);
19254 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) { 19258 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) {
19255 if (iter.GetCurrent<Object>()->IsJSProxy()) return true; 19259 if (iter.GetCurrent<Object>()->IsJSProxy()) return true;
19256 } 19260 }
19257 return false; 19261 return false;
19258 } 19262 }
19259 19263
19260 } // namespace internal 19264 } // namespace internal
19261 } // namespace v8 19265 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698