From 3a4d073f1d3ab46134acebd1a636c38896b8e78f Mon Sep 17 00:00:00 2001 From: yangguo Date: Wed, 8 Apr 2015 04:14:56 -0700 Subject: [PATCH] Create result array of %DebugGetLoadedScripts outside the debug context. R=jarin@chromium.org BUG=chromium:474297 LOG=N Review URL: https://codereview.chromium.org/1062143002 Cr-Commit-Position: refs/heads/master@{#27659} --- src/runtime/runtime-debug.cc | 9 ++++++--- test/mjsunit/regress/regress-crbug-474297.js | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 test/mjsunit/regress/regress-crbug-474297.js diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc index a3db178..51e7b70 100644 --- a/src/runtime/runtime-debug.cc +++ b/src/runtime/runtime-debug.cc @@ -2338,9 +2338,12 @@ RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) { HandleScope scope(isolate); DCHECK(args.length() == 0); - DebugScope debug_scope(isolate->debug()); - // Fill the script objects. - Handle instances = isolate->debug()->GetLoadedScripts(); + Handle instances; + { + DebugScope debug_scope(isolate->debug()); + // Fill the script objects. + instances = isolate->debug()->GetLoadedScripts(); + } // Convert the script objects to proper JS objects. for (int i = 0; i < instances->length(); i++) { diff --git a/test/mjsunit/regress/regress-crbug-474297.js b/test/mjsunit/regress/regress-crbug-474297.js new file mode 100644 index 0000000..3169c28 --- /dev/null +++ b/test/mjsunit/regress/regress-crbug-474297.js @@ -0,0 +1,7 @@ +// Copyright 2015 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --gc-interval=33 --expose-gc --allow-natives-syntax + +%DebugGetLoadedScripts(); -- 2.7.4