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

Unified Diff: src/debug/debug-scopes.cc

Issue 1785403002: [runtime] split up loops with HandleScopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: adding loop var type Created 4 years, 9 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
« src/builtins.cc ('K') | « src/d8.cc ('k') | src/debug/liveedit.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug-scopes.cc
diff --git a/src/debug/debug-scopes.cc b/src/debug/debug-scopes.cc
index 047574ae9cf179aa5f37c04422d9cca0aa02c738..c84b788f3f95aa595160702ab992e2dae0b74c8f 100644
--- a/src/debug/debug-scopes.cc
+++ b/src/debug/debug-scopes.cc
@@ -643,23 +643,25 @@ bool ScopeIterator::SetLocalVariableValue(Handle<String> variable_name,
bool default_result = false;
// Parameters.
- for (int i = 0; i < scope_info->ParameterCount(); ++i) {
- HandleScope scope(isolate_);
- if (String::Equals(handle(scope_info->ParameterName(i)), variable_name)) {
- frame->SetParameterValue(i, *new_value);
- // Argument might be shadowed in heap context, don't stop here.
- default_result = true;
- }
- }
+ FOR_WITH_HANDLE_SCOPE(
+ isolate_, int, i = 0, i, i < scope_info->ParameterCount(), ++i, {
+ if (String::Equals(handle(scope_info->ParameterName(i)),
+ variable_name)) {
+ frame->SetParameterValue(i, *new_value);
+ // Argument might be shadowed in heap context, don't stop here.
+ default_result = true;
+ }
+ });
// Stack locals.
- for (int i = 0; i < scope_info->StackLocalCount(); ++i) {
- HandleScope scope(isolate_);
- if (String::Equals(handle(scope_info->StackLocalName(i)), variable_name)) {
- frame->SetExpression(scope_info->StackLocalIndex(i), *new_value);
- return true;
- }
- }
+ FOR_WITH_HANDLE_SCOPE(
+ isolate_, int, i = 0, i, i < scope_info->StackLocalCount(), ++i, {
+ if (String::Equals(handle(scope_info->StackLocalName(i)),
+ variable_name)) {
+ frame->SetExpression(scope_info->StackLocalIndex(i), *new_value);
+ return true;
+ }
+ });
if (scope_info->HasContext()) {
// Context locals.
@@ -699,13 +701,15 @@ bool ScopeIterator::SetBlockVariableValue(Handle<String> variable_name,
Handle<ScopeInfo> scope_info = CurrentScopeInfo();
JavaScriptFrame* frame = GetFrame();
- for (int i = 0; i < scope_info->StackLocalCount(); ++i) {
- HandleScope scope(isolate_);
- if (String::Equals(handle(scope_info->StackLocalName(i)), variable_name)) {
- frame->SetExpression(scope_info->StackLocalIndex(i), *new_value);
- return true;
- }
- }
+ FOR_WITH_HANDLE_SCOPE(
+ isolate_, int, i = 0, i, i < scope_info->StackLocalCount(), ++i, {
+ HandleScope scope(isolate_);
+ if (String::Equals(handle(scope_info->StackLocalName(i)),
+ variable_name)) {
+ frame->SetExpression(scope_info->StackLocalIndex(i), *new_value);
+ return true;
+ }
+ });
if (HasContext()) {
Handle<Context> context = CurrentContext();
« src/builtins.cc ('K') | « src/d8.cc ('k') | src/debug/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698