Commit 04cc9cff authored by ager@chromium.org's avatar ager@chromium.org

Revert the exception propagation fix. It leads to crashes because

Top::external_caught_exception_ and Top::try_catch_handler_ are no
longer in sync.  Pulling it out until I have the time to fix it.
Review URL: http://codereview.chromium.org/42117

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1497 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 60d83a78
......@@ -823,36 +823,16 @@ void Top::TraceException(bool flag) {
bool Top::optional_reschedule_exception(bool is_bottom_call) {
// Allways reschedule out of memory exceptions.
if (!is_out_of_memory()) {
// Never reschedule the exception if this is the bottom call.
bool clear_exception = is_bottom_call;
// If the exception is externally caught, clear it if there are no
// JavaScript frames on the way to the C++ frame that has the
// external handler.
if (thread_local_.external_caught_exception_) {
ASSERT(thread_local_.try_catch_handler_ != NULL);
Address external_handler_address =
reinterpret_cast<Address>(thread_local_.try_catch_handler_);
JavaScriptFrameIterator it;
if (it.done() || (it.frame()->sp() > external_handler_address)) {
clear_exception = true;
}
}
// Clear the exception if needed.
if (clear_exception) {
thread_local_.external_caught_exception_ = false;
clear_pending_exception();
return false;
}
if (!is_out_of_memory() &&
(thread_local_.external_caught_exception_ || is_bottom_call)) {
thread_local_.external_caught_exception_ = false;
clear_pending_exception();
return false;
} else {
thread_local_.scheduled_exception_ = pending_exception();
clear_pending_exception();
return true;
}
// Reschedule the exception.
thread_local_.scheduled_exception_ = pending_exception();
clear_pending_exception();
return true;
}
......
......@@ -158,12 +158,10 @@ class Top {
}
static void setup_external_caught() {
if (!thread_local_.external_caught_exception_) {
thread_local_.external_caught_exception_ =
has_pending_exception() &&
(thread_local_.catcher_ != NULL) &&
(thread_local_.try_catch_handler_ == thread_local_.catcher_);
}
thread_local_.external_caught_exception_ =
(!thread_local_.pending_exception_->IsTheHole()) &&
(thread_local_.catcher_ != NULL) &&
(Top::thread_local_.try_catch_handler_ == Top::thread_local_.catcher_);
}
// Tells whether the current context has experienced an out of memory
......
......@@ -39,11 +39,3 @@ test-spaces/LargeObjectSpace: PASS || FAIL
# BUG(240): Test seems flaky on ARM.
test-api/RegExpInterruption: SKIP
# BUG(271): After exception propagation changes that compares pointers
# into the stack, these tests fail on the arm simulator (but pass on
# the arm hardware) because the JS stack is not combined with the C
# stack in the simulator. Disabling while we consider how to solve
# the issue for the simulator.
test-api/ExceptionOrder: PASS || FAIL
test-api/TryCatchInTryFinally: PASS || FAIL
......@@ -1722,8 +1722,7 @@ v8::Handle<Value> CCatcher(const v8::Arguments& args) {
if (args.Length() < 1) return v8::Boolean::New(false);
v8::HandleScope scope;
v8::TryCatch try_catch;
Local<Value> result = v8::Script::Compile(args[0]->ToString())->Run();
CHECK(!try_catch.HasCaught() || result.IsEmpty());
v8::Script::Compile(args[0]->ToString())->Run();
return v8::Boolean::New(try_catch.HasCaught());
}
......@@ -1760,11 +1759,7 @@ THREADED_TEST(APIThrowTryCatch) {
// Test that a try-finally block doesn't shadow a try-catch block
// when setting up an external handler.
//
// TODO(271): This should be a threaded test. It was disabled for the
// thread tests because it fails on the ARM simulator. Should be made
// threadable again when the simulator issue is resolved.
TEST(TryCatchInTryFinally) {
THREADED_TEST(TryCatchInTryFinally) {
v8::HandleScope scope;
Local<ObjectTemplate> templ = ObjectTemplate::New();
templ->Set(v8_str("CCatcher"),
......@@ -1811,9 +1806,8 @@ TEST(APIThrowMessageAndVerboseTryCatch) {
LocalContext context(0, templ);
v8::TryCatch try_catch;
try_catch.SetVerbose(true);
Local<Value> result = CompileRun("ThrowFromC();");
CompileRun("ThrowFromC();");
CHECK(try_catch.HasCaught());
CHECK(result.IsEmpty());
CHECK(message_received);
v8::V8::RemoveMessageListeners(check_message);
}
......@@ -1859,7 +1853,6 @@ v8::Handle<Value> CThrowCountDown(const v8::Arguments& args) {
int expected = args[3]->Int32Value();
if (try_catch.HasCaught()) {
CHECK_EQ(expected, count);
CHECK(result.IsEmpty());
CHECK(!i::Top::has_scheduled_exception());
} else {
CHECK_NE(expected, count);
......@@ -1917,11 +1910,7 @@ THREADED_TEST(EvalInTryFinally) {
// Each entry is an activation, either JS or C. The index is the count at that
// level. Stars identify activations with exception handlers, the @ identifies
// the exception handler that should catch the exception.
//
// TODO(271): This should be a threaded test. It was disabled for the
// thread tests because it fails on the ARM simulator. Should be made
// threadable again when the simulator issue is resolved.
TEST(ExceptionOrder) {
THREADED_TEST(ExceptionOrder) {
v8::HandleScope scope;
Local<ObjectTemplate> templ = ObjectTemplate::New();
templ->Set(v8_str("check"), v8::FunctionTemplate::New(JSCheck));
......
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