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

Unified Diff: src/debug/debug.cc

Issue 2526763002: [debug] remove obsolete handling for suspended generator objects. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index 87dd50d300dc6e2911674c61bc98fe380a2f302b..a636879fffb92bcffdd2aaf84f52bfb10b349e73 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1176,20 +1176,6 @@ static Address ComputeNewPcForRedirect(Code* new_code, Code* old_code,
}
-// Count the number of continuations at which the current pc offset is at.
-static int ComputeContinuationIndexFromPcOffset(Code* code, int pc_offset) {
- UNREACHABLE();
- return 666;
-}
-
-
-// Find the pc offset for the given continuation index.
-static int ComputePcOffsetFromContinuationIndex(Code* code, int index) {
- UNREACHABLE();
- return 666;
-}
-
-
class RedirectActiveFunctions : public ThreadVisitor {
public:
explicit RedirectActiveFunctions(SharedFunctionInfo* shared)
@@ -1253,7 +1239,6 @@ bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) {
}
List<Handle<JSFunction> > functions;
- List<Handle<JSGeneratorObject> > suspended_generators;
// Flush all optimized code maps. Note that the below heap iteration does not
// cover this, because the given function might have been inlined into code
@@ -1278,10 +1263,6 @@ bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) {
// smarter here and avoid the heap walk.
HeapIterator iterator(isolate_->heap());
HeapObject* obj;
- // Continuation from old-style generators need to be recomputed.
- // TODO(yangguo): Remove code for old-style generators.
- bool find_resumables =
- baseline_exists && IsResumableFunction(shared->kind());
while ((obj = iterator.next())) {
if (obj->IsJSFunction()) {
@@ -1293,25 +1274,12 @@ bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) {
if (baseline_exists && function->shared() == *shared) {
functions.Add(handle(function));
}
- } else if (find_resumables && obj->IsJSGeneratorObject()) {
- // This case handles async functions as well, as they use generator
- // objects for in-progress async function execution.
- JSGeneratorObject* generator_obj = JSGeneratorObject::cast(obj);
- if (!generator_obj->is_suspended()) continue;
- JSFunction* function = generator_obj->function();
- if (!function->Inlines(*shared)) continue;
- int pc_offset = generator_obj->continuation();
- int index =
- ComputeContinuationIndexFromPcOffset(function->code(), pc_offset);
- generator_obj->set_continuation(index);
- suspended_generators.Add(handle(generator_obj));
}
}
}
// We do not need to replace code to debug bytecode.
DCHECK(baseline_exists || functions.is_empty());
- DCHECK(baseline_exists || suspended_generators.is_empty());
// We do not need to recompile to debug bytecode.
if (baseline_exists && !shared->code()->has_debug_break_slots()) {
@@ -1323,12 +1291,6 @@ bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) {
JSFunction::EnsureLiterals(function);
}
- for (Handle<JSGeneratorObject> const generator_obj : suspended_generators) {
- int index = generator_obj->continuation();
- int pc_offset = ComputePcOffsetFromContinuationIndex(shared->code(), index);
- generator_obj->set_continuation(pc_offset);
- }
-
// Update PCs on the stack to point to recompiled code.
RedirectActiveFunctions redirect_visitor(*shared);
redirect_visitor.VisitThread(isolate_, isolate_->thread_local_top());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698