Commit 1c024bac authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

Remove source position wrangling for generator fns in ScopeIterator

ScopeIterator was changed to re-parse the whole script instead of
just a single function. The CL in question went through a few
iterations. At one point, it was necessary to wrangle the source
position of generator functions  to correctly identify their
closure scope. This is no longer necessary and this CL removes
the manual source position adjustment.

Change-Id: If1a61ed32a903997b70a62cd464198f3dffa385a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1792162
Auto-Submit: Simon Zünd <szuend@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63604}
parent db22d8be
...@@ -643,14 +643,7 @@ int ScopeIterator::GetSourcePosition() { ...@@ -643,14 +643,7 @@ int ScopeIterator::GetSourcePosition() {
DCHECK(!generator_.is_null()); DCHECK(!generator_.is_null());
SharedFunctionInfo::EnsureSourcePositionsAvailable( SharedFunctionInfo::EnsureSourcePositionsAvailable(
isolate_, handle(generator_->function().shared(), isolate_)); isolate_, handle(generator_->function().shared(), isolate_));
// The source position of a generator function is equal to the return generator_->source_position();
// start_position() of its scope. This would fail the search
// in the {ScopeChainRetriever}, which *requires* a
// smaller then comparison for correct scopes when hitting break
// points at function literals.
// To fix this, we nudge the source position of the generator
// by 1, so the scope of the generator function is correctly found.
return generator_->source_position() + 1;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment