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

Unified Diff: src/runtime.cc

Issue 22198002: Fix step in positions (include various calls and exclude current pc point), add a test (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: extend test Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/execution.cc ('k') | test/mjsunit/debug-stepin-positions.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 6164e6631fa47c49cba7e59419a4806951ddc0d3..9c9371d85e39777707f8ce4e6d5e6fa8913add72 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -12011,8 +12011,15 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetStepInPositions) {
JavaScriptFrameIterator frame_it(isolate, id);
JavaScriptFrame* frame = frame_it.frame();
+ Handle<JSFunction> fun =
+ Handle<JSFunction>(frame->function());
Handle<SharedFunctionInfo> shared =
- Handle<SharedFunctionInfo>(frame->function()->shared());
+ Handle<SharedFunctionInfo>(fun->shared());
+
+ if (!isolate->debug()->EnsureDebugInfo(shared, fun)) {
+ return isolate->heap()->undefined_value();
+ }
+
Handle<DebugInfo> debug_info = Debug::GetDebugInfo(shared);
int len = 0;
@@ -12025,12 +12032,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetStepInPositions) {
int current_statement_pos = break_location_iterator.statement_position();
while (!break_location_iterator.Done()) {
- if (break_location_iterator.IsStepInLocation(isolate)) {
- Smi* position_value = Smi::FromInt(break_location_iterator.position());
- JSObject::SetElement(array, len,
- Handle<Object>(position_value, isolate),
- NONE, kNonStrictMode);
- len++;
+ if (break_location_iterator.pc() > frame->pc()) {
+ if (break_location_iterator.IsStepInLocation(isolate)) {
+ Smi* position_value = Smi::FromInt(break_location_iterator.position());
+ JSObject::SetElement(array, len,
+ Handle<Object>(position_value, isolate),
+ NONE, kNonStrictMode);
+ len++;
+ }
}
// Advance iterator.
break_location_iterator.Next();
« no previous file with comments | « src/execution.cc ('k') | test/mjsunit/debug-stepin-positions.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698