Reviewers: Yang,

Message:
PTAL

Description:
Fixed a couple of failing DCHECK(has_pending_exception()).

BUG=chromium:491062
LOG=N

Please review this at https://codereview.chromium.org/1151373002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+15, -11 lines):
  M src/debug.cc
  M src/runtime/runtime-debug.cc
  M test/mjsunit/mjsunit.status
  A + test/mjsunit/regress/regress-crbug-491062.js


Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index b5e81c55cb239042c63d7147b2b3c56ba4ba7f9e..85fdb14f36e6de4ca1939ff4eeecefa82c451786 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<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: src/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index 660fc7ffa2b1055010db4f37751b3a297c8b2e26..cdafdd2271ea0f51b1b0831cc65e240adcbb2a74 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -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: test/mjsunit/mjsunit.status
diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
index 1b831d44d896d7d9ed3649ec9bda47ba7c061896..cef7825eb869928d44fe2eb607aaa8b546a8718a 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]],
Index: test/mjsunit/regress/regress-crbug-491062.js
diff --git a/test/mjsunit/harmony/regress/regress-crbug-465671.js b/test/mjsunit/regress/regress-crbug-491062.js
similarity index 56%
copy from test/mjsunit/harmony/regress/regress-crbug-465671.js
copy to test/mjsunit/regress/regress-crbug-491062.js
index 24f4d054755bc241d87ad774787d595aad6c0657..e16f85b1eb87ac991fdcb65c7cc7527de807608a 100644
--- a/test/mjsunit/harmony/regress/regress-crbug-465671.js
+++ b/test/mjsunit/regress/regress-crbug-491062.js
@@ -2,15 +2,21 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

-// Flags: --harmony-arrow-functions
+// Flags: --allow-natives-syntax --stack-limit=32

-// This used to trigger crash because of an unhandled stack overflow.
+function g() {}
+
+var count = 0;
 function f() {
-  var a = [10];
   try {
     f();
   } catch(e) {
-    a.map(v => v + 1);
+    print(e.stack);
+  }
+  if (count < 50) {
+    count++;
+    %DebugGetLoadedScripts();
   }
 }
 f();
+g();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to