Fixed a couple of failing DCHECK(has_pending_exception()).
authorishell <ishell@chromium.org>
Tue, 26 May 2015 10:06:47 +0000 (03:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 26 May 2015 10:06:54 +0000 (10:06 +0000)
BUG=chromium:491062
LOG=N

Review URL: https://codereview.chromium.org/1151373002

Cr-Commit-Position: refs/heads/master@{#28617}

src/debug.cc
src/runtime/runtime-debug.cc
test/mjsunit/mjsunit.status
test/mjsunit/regress/regress-crbug-491062.js [new file with mode: 0644]

index b5e81c5..85fdb14 100644 (file)
@@ -608,13 +608,7 @@ bool Debug::CompileDebuggerScript(Isolate* isolate, int index) {
       source_code, script_name, 0, 0, ScriptOriginOptions(), Handle<Object>(),
       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<JSFunction> function =
index 660fc7f..cdafdd2 100644 (file)
@@ -2747,6 +2747,7 @@ RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) {
   Handle<FixedArray> instances;
   {
     DebugScope debug_scope(isolate->debug());
+    if (debug_scope.failed()) return isolate->heap()->exception();
     // Fill the script objects.
     instances = isolate->debug()->GetLoadedScripts();
   }
index 1b831d4..cef7825 100644 (file)
   # 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 (file)
index 0000000..e16f85b
--- /dev/null
@@ -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();