OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 StackFrame::Id id = isolate->debug()->break_frame_id(); | 450 StackFrame::Id id = isolate->debug()->break_frame_id(); |
451 if (id == StackFrame::NO_ID) { | 451 if (id == StackFrame::NO_ID) { |
452 // If there is no JavaScript stack frame count is 0. | 452 // If there is no JavaScript stack frame count is 0. |
453 return Smi::FromInt(0); | 453 return Smi::FromInt(0); |
454 } | 454 } |
455 | 455 |
456 for (JavaScriptFrameIterator it(isolate, id); !it.done(); it.Advance()) { | 456 for (JavaScriptFrameIterator it(isolate, id); !it.done(); it.Advance()) { |
457 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); | 457 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); |
458 it.frame()->Summarize(&frames); | 458 it.frame()->Summarize(&frames); |
459 for (int i = frames.length() - 1; i >= 0; i--) { | 459 for (int i = frames.length() - 1; i >= 0; i--) { |
460 // Omit functions from native scripts. | 460 // Omit functions from native and extension scripts. |
461 if (!frames[i].function()->IsFromNativeScript()) n++; | 461 if (frames[i].function()->IsSubjectToDebugging()) n++; |
462 } | 462 } |
463 } | 463 } |
464 return Smi::FromInt(n); | 464 return Smi::FromInt(n); |
465 } | 465 } |
466 | 466 |
467 | 467 |
468 class FrameInspector { | 468 class FrameInspector { |
469 public: | 469 public: |
470 FrameInspector(JavaScriptFrame* frame, int inlined_jsframe_index, | 470 FrameInspector(JavaScriptFrame* frame, int inlined_jsframe_index, |
471 Isolate* isolate) | 471 Isolate* isolate) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 | 576 |
577 | 577 |
578 // Advances the iterator to the frame that matches the index and returns the | 578 // Advances the iterator to the frame that matches the index and returns the |
579 // inlined frame index, or -1 if not found. Skips native JS functions. | 579 // inlined frame index, or -1 if not found. Skips native JS functions. |
580 int Runtime::FindIndexedNonNativeFrame(JavaScriptFrameIterator* it, int index) { | 580 int Runtime::FindIndexedNonNativeFrame(JavaScriptFrameIterator* it, int index) { |
581 int count = -1; | 581 int count = -1; |
582 for (; !it->done(); it->Advance()) { | 582 for (; !it->done(); it->Advance()) { |
583 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); | 583 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); |
584 it->frame()->Summarize(&frames); | 584 it->frame()->Summarize(&frames); |
585 for (int i = frames.length() - 1; i >= 0; i--) { | 585 for (int i = frames.length() - 1; i >= 0; i--) { |
586 // Omit functions from native scripts. | 586 // Omit functions from native and extension scripts. |
587 if (frames[i].function()->IsFromNativeScript()) continue; | 587 if (!frames[i].function()->IsSubjectToDebugging()) continue; |
588 if (++count == index) return i; | 588 if (++count == index) return i; |
589 } | 589 } |
590 } | 590 } |
591 return -1; | 591 return -1; |
592 } | 592 } |
593 | 593 |
594 | 594 |
595 // Return an array with frame details | 595 // Return an array with frame details |
596 // args[0]: number: break id | 596 // args[0]: number: break id |
597 // args[1]: number: frame index | 597 // args[1]: number: frame index |
(...skipping 2599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3197 return Smi::FromInt(isolate->debug()->is_active()); | 3197 return Smi::FromInt(isolate->debug()->is_active()); |
3198 } | 3198 } |
3199 | 3199 |
3200 | 3200 |
3201 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 3201 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
3202 UNIMPLEMENTED(); | 3202 UNIMPLEMENTED(); |
3203 return NULL; | 3203 return NULL; |
3204 } | 3204 } |
3205 } // namespace internal | 3205 } // namespace internal |
3206 } // namespace v8 | 3206 } // namespace v8 |
OLD | NEW |