Chromium Code Reviews

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

Issue 1785403002: [runtime] split up loops with HandleScopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix left-over variable Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/runtime/runtime-scopes.cc
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc
index a09dee15f357596a21af7a1bbd309500c96310ca..de0d66a74e4e1287798bf99f9707919850f9d8ce 100644
--- a/src/runtime/runtime-scopes.cc
+++ b/src/runtime/runtime-scopes.cc
@@ -103,8 +103,7 @@ RUNTIME_FUNCTION(Runtime_DeclareGlobals) {
// Traverse the name/value pairs and set the properties.
int length = pairs->length();
- for (int i = 0; i < length; i += 2) {
- HandleScope scope(isolate);
+ FOR_WITH_HANDLE_SCOPE(isolate, int, i = 0, i, i < length, i += 2, {
Handle<String> name(String::cast(pairs->get(i)));
Handle<Object> initial_value(pairs->get(i + 1), isolate);
@@ -143,7 +142,7 @@ RUNTIME_FUNCTION(Runtime_DeclareGlobals) {
static_cast<PropertyAttributes>(attr),
is_var, is_const, is_function);
if (isolate->has_pending_exception()) return result;
- }
+ });
return isolate->heap()->undefined_value();
}

Powered by Google App Engine