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

Side by Side Diff: src/debug/debug.cc

Issue 2519853002: [debugger] step-next across yield should not leave the generator. (Closed)
Patch Set: Created 4 years 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/debug/debug.h ('k') | src/interpreter/interpreter.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/debug/debug.h" 5 #include "src/debug/debug.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 Handle<DebugInfo> debug_info(candidates[i]->GetDebugInfo()); 1423 Handle<DebugInfo> debug_info(candidates[i]->GetDebugInfo());
1424 FindBreakablePositions(debug_info, start_position, end_position, 1424 FindBreakablePositions(debug_info, start_position, end_position,
1425 STATEMENT_ALIGNED, positions); 1425 STATEMENT_ALIGNED, positions);
1426 } 1426 }
1427 return true; 1427 return true;
1428 } 1428 }
1429 UNREACHABLE(); 1429 UNREACHABLE();
1430 return false; 1430 return false;
1431 } 1431 }
1432 1432
1433 void Debug::RecordAsyncFunction(Handle<JSGeneratorObject> generator_object) { 1433 void Debug::RecordGenerator(Handle<JSGeneratorObject> generator_object) {
1434 if (last_step_action() <= StepOut) return; 1434 if (last_step_action() <= StepOut) return;
1435 if (!IsAsyncFunction(generator_object->function()->shared()->kind())) return; 1435
1436 if (last_step_action() == StepNext) {
1437 // Only consider this generator a step-next target if not stepping in.
1438 JavaScriptFrameIterator stack_iterator(isolate_);
1439 JavaScriptFrame* frame = stack_iterator.frame();
1440 if (frame->UnpaddedFP() < thread_local_.target_fp_) return;
1441 }
1442
1436 DCHECK(!has_suspended_generator()); 1443 DCHECK(!has_suspended_generator());
1437 thread_local_.suspended_generator_ = *generator_object; 1444 thread_local_.suspended_generator_ = *generator_object;
1438 ClearStepping(); 1445 ClearStepping();
1439 } 1446 }
1440 1447
1441 class SharedFunctionInfoFinder { 1448 class SharedFunctionInfoFinder {
1442 public: 1449 public:
1443 explicit SharedFunctionInfoFinder(int target_position) 1450 explicit SharedFunctionInfoFinder(int target_position)
1444 : current_candidate_(NULL), 1451 : current_candidate_(NULL),
1445 current_candidate_closure_(NULL), 1452 current_candidate_closure_(NULL),
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
2617 } 2624 }
2618 2625
2619 2626
2620 void LockingCommandMessageQueue::Clear() { 2627 void LockingCommandMessageQueue::Clear() {
2621 base::LockGuard<base::Mutex> lock_guard(&mutex_); 2628 base::LockGuard<base::Mutex> lock_guard(&mutex_);
2622 queue_.Clear(); 2629 queue_.Clear();
2623 } 2630 }
2624 2631
2625 } // namespace internal 2632 } // namespace internal
2626 } // namespace v8 2633 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug/debug.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698