From 62b56507cce3c57a2e1aebce6d34f29b3b64e762 Mon Sep 17 00:00:00 2001 From: ishell Date: Tue, 26 May 2015 03:06:47 -0700 Subject: [PATCH] Fixed a couple of failing DCHECK(has_pending_exception()). BUG=chromium:491062 LOG=N Review URL: https://codereview.chromium.org/1151373002 Cr-Commit-Position: refs/heads/master@{#28617} --- src/debug.cc | 8 +------- src/runtime/runtime-debug.cc | 1 + test/mjsunit/mjsunit.status | 3 +++ test/mjsunit/regress/regress-crbug-491062.js | 22 ++++++++++++++++++++++ 4 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 test/mjsunit/regress/regress-crbug-491062.js diff --git a/src/debug.cc b/src/debug.cc index b5e81c5..85fdb14 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -608,13 +608,7 @@ bool Debug::CompileDebuggerScript(Isolate* isolate, int index) { source_code, script_name, 0, 0, ScriptOriginOptions(), Handle(), context, NULL, NULL, ScriptCompiler::kNoCompileOptions, NATIVES_CODE, false); - - // Silently ignore stack overflows during compilation. - if (function_info.is_null()) { - DCHECK(isolate->has_pending_exception()); - isolate->clear_pending_exception(); - return false; - } + if (function_info.is_null()) return false; // Execute the shared function in the debugger context. Handle function = diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc index 660fc7f..cdafdd2 100644 --- a/src/runtime/runtime-debug.cc +++ b/src/runtime/runtime-debug.cc @@ -2747,6 +2747,7 @@ RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) { Handle instances; { DebugScope debug_scope(isolate->debug()); + if (debug_scope.failed()) return isolate->heap()->exception(); // Fill the script objects. instances = isolate->debug()->GetLoadedScripts(); } diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status index 1b831d4..cef7825 100644 --- a/test/mjsunit/mjsunit.status +++ b/test/mjsunit/mjsunit.status @@ -177,6 +177,9 @@ # Issue 488: this test sometimes times out. 'array-constructor': [PASS, TIMEOUT], + # Run only on fast architectures, contains no architecture dependent code. + 'regress/regress-crbug-491062': [PASS, ['arch != ia32 and arch != x64', SKIP], NO_VARIANTS], + # Very slow on ARM and MIPS, contains no architecture dependent code. 'unicode-case-overoptimization': [PASS, NO_VARIANTS, ['arch == arm or arch == android_arm or arch == android_arm64 or arch == mipsel or arch == mips64el or arch == mips', TIMEOUT]], 'regress/regress-3976': [PASS, NO_VARIANTS, ['arch == arm or arch == android_arm or arch == android_arm64 or arch == mipsel or arch == mips64el or arch == mips', SKIP]], diff --git a/test/mjsunit/regress/regress-crbug-491062.js b/test/mjsunit/regress/regress-crbug-491062.js new file mode 100644 index 0000000..e16f85b --- /dev/null +++ b/test/mjsunit/regress/regress-crbug-491062.js @@ -0,0 +1,22 @@ +// 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: --allow-natives-syntax --stack-limit=32 + +function g() {} + +var count = 0; +function f() { + try { + f(); + } catch(e) { + print(e.stack); + } + if (count < 50) { + count++; + %DebugGetLoadedScripts(); + } +} +f(); +g(); -- 2.7.4