Commit 050e8880 authored by ishell's avatar ishell Committed by Commit bot

A couple of other "stack overflow" vs. "has_pending_exception()" issues fixed.

BUG=chromium:471659, chromium:494158
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#28816}
parent 06c706d8
...@@ -2466,7 +2466,7 @@ bool Genesis::InstallExperimentalNatives() { ...@@ -2466,7 +2466,7 @@ bool Genesis::InstallExperimentalNatives() {
#undef INSTALL_EXPERIMENTAL_NATIVES #undef INSTALL_EXPERIMENTAL_NATIVES
} }
CallUtilsFunction(isolate(), "PostExperimentals"); if (!CallUtilsFunction(isolate(), "PostExperimentals")) return false;
InstallExperimentalNativeFunctions(); InstallExperimentalNativeFunctions();
InstallExperimentalBuiltinFunctionIds(); InstallExperimentalBuiltinFunctionIds();
......
...@@ -1018,6 +1018,10 @@ void Shell::InitializeDebugger(Isolate* isolate) { ...@@ -1018,6 +1018,10 @@ void Shell::InitializeDebugger(Isolate* isolate) {
Handle<ObjectTemplate> global_template = CreateGlobalTemplate(isolate); Handle<ObjectTemplate> global_template = CreateGlobalTemplate(isolate);
utility_context_.Reset(isolate, utility_context_.Reset(isolate,
Context::New(isolate, NULL, global_template)); Context::New(isolate, NULL, global_template));
if (utility_context_.IsEmpty()) {
printf("Failed to initialize debugger\n");
Shell::Exit(1);
}
#endif // !V8_SHARED #endif // !V8_SHARED
} }
......
...@@ -637,8 +637,8 @@ bool Debug::CompileDebuggerScript(Isolate* isolate, int index) { ...@@ -637,8 +637,8 @@ bool Debug::CompileDebuggerScript(Isolate* isolate, int index) {
if (maybe_exception.ToHandle(&exception)) { if (maybe_exception.ToHandle(&exception)) {
isolate->set_pending_exception(*exception); isolate->set_pending_exception(*exception);
MessageHandler::ReportMessage(isolate, NULL, message); MessageHandler::ReportMessage(isolate, NULL, message);
isolate->clear_pending_exception();
} }
DCHECK(!maybe_exception.is_null());
return false; return false;
} }
......
...@@ -945,16 +945,22 @@ void ReportBootstrappingException(Handle<Object> exception, ...@@ -945,16 +945,22 @@ void ReportBootstrappingException(Handle<Object> exception,
// builtins, print the actual source here so that line numbers match. // builtins, print the actual source here so that line numbers match.
if (location->script()->source()->IsString()) { if (location->script()->source()->IsString()) {
Handle<String> src(String::cast(location->script()->source())); Handle<String> src(String::cast(location->script()->source()));
PrintF("Failing script:\n"); PrintF("Failing script:");
int len = src->length(); int len = src->length();
int line_number = 1; if (len == 0) {
PrintF("%5d: ", line_number); PrintF(" <not available>\n");
for (int i = 0; i < len; i++) { } else {
uint16_t character = src->Get(i); PrintF("\n");
PrintF("%c", character); int line_number = 1;
if (character == '\n' && i < len - 2) { PrintF("%5d: ", line_number);
PrintF("%5d: ", ++line_number); for (int i = 0; i < len; i++) {
uint16_t character = src->Get(i);
PrintF("%c", character);
if (character == '\n' && i < len - 2) {
PrintF("%5d: ", ++line_number);
}
} }
PrintF("\n");
} }
} }
#endif #endif
......
...@@ -121,11 +121,13 @@ RUNTIME_FUNCTION(Runtime_StringReplaceOneCharWithString) { ...@@ -121,11 +121,13 @@ RUNTIME_FUNCTION(Runtime_StringReplaceOneCharWithString) {
if (isolate->has_pending_exception()) return isolate->heap()->exception(); if (isolate->has_pending_exception()) return isolate->heap()->exception();
subject = String::Flatten(subject); subject = String::Flatten(subject);
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( if (StringReplaceOneCharWithString(isolate, subject, search, replace, &found,
isolate, result, kRecursionLimit).ToHandle(&result)) {
StringReplaceOneCharWithString(isolate, subject, search, replace, &found, return *result;
kRecursionLimit)); }
return *result; if (isolate->has_pending_exception()) return isolate->heap()->exception();
// In case of empty handle and no pending exception we have stack overflow.
return isolate->StackOverflow();
} }
......
...@@ -178,9 +178,6 @@ ...@@ -178,9 +178,6 @@
# Issue 488: this test sometimes times out. # Issue 488: this test sometimes times out.
'array-constructor': [PASS, TIMEOUT], '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. # 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]], '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]], '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]],
......
...@@ -2,15 +2,19 @@ ...@@ -2,15 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --stack-size=70 // Flags: --stack-size=100
"a".replace(/a/g, ""); "a".replace(/a/g, "");
var count = 0;
function test() { function test() {
try { try {
test(); test();
} catch(e) { } catch(e) {
"b".replace(/(b)/g, new []); if (count < 50) {
count++;
"b".replace(/(b)/g, new []);
}
} }
} }
......
// 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: --stack-size=100
var s = "0123456789ABCDEF";
for (var i = 0; i < 16; i++) s += s;
var count = 0;
function f() {
try {
f();
if (count < 10) {
f();
}
} catch(e) {
s.replace("+", "-");
}
count++;
}
f();
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --allow-natives-syntax --stack-limit=32 // Flags: --allow-natives-syntax --stack-size=100
function g() {} function g() {}
...@@ -13,7 +13,7 @@ function f() { ...@@ -13,7 +13,7 @@ function f() {
} catch(e) { } catch(e) {
print(e.stack); print(e.stack);
} }
if (count < 50) { if (count < 100) {
count++; count++;
%DebugGetLoadedScripts(); %DebugGetLoadedScripts();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment