Commit 8813d15d authored by ager@chromium.org's avatar ager@chromium.org

Revert revision 593. This was a cleanup change but it caused layout

test regressions.

Review URL: http://codereview.chromium.org/8827

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@615 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1706231d
...@@ -91,10 +91,12 @@ static Handle<Object> Invoke(bool construct, ...@@ -91,10 +91,12 @@ static Handle<Object> Invoke(bool construct,
value->Verify(); value->Verify();
#endif #endif
// Update the pending exception and external caught flag and return the value. // Update the pending exception flag and return the value.
*has_pending_exception = value->IsException(); *has_pending_exception = value->IsException();
ASSERT(*has_pending_exception == Top::has_pending_exception()); ASSERT(*has_pending_exception == Top::has_pending_exception());
Top::propagate_external_caught(); if (*has_pending_exception) {
Top::setup_external_caught();
}
// If the pending exception is OutOfMemoryException set out_of_memory in // If the pending exception is OutOfMemoryException set out_of_memory in
// the global context. Note: We have to mark the global context here // the global context. Note: We have to mark the global context here
......
...@@ -101,7 +101,7 @@ void Top::InitializeThreadLocal() { ...@@ -101,7 +101,7 @@ void Top::InitializeThreadLocal() {
clear_pending_exception(); clear_pending_exception();
clear_scheduled_exception(); clear_scheduled_exception();
thread_local_.save_context_ = NULL; thread_local_.save_context_ = NULL;
thread_local_.pending_external_caught_exception_ = false; thread_local_.catcher_ = NULL;
} }
...@@ -607,7 +607,7 @@ Failure* Top::Throw(Object* exception, MessageLocation* location) { ...@@ -607,7 +607,7 @@ Failure* Top::Throw(Object* exception, MessageLocation* location) {
Failure* Top::ReThrow(Object* exception, MessageLocation* location) { Failure* Top::ReThrow(Object* exception, MessageLocation* location) {
// Set the exception being re-thrown. // Set the exception beeing re-thrown.
set_pending_exception(exception); set_pending_exception(exception);
return Failure::Exception(); return Failure::Exception();
} }
...@@ -789,8 +789,9 @@ void Top::DoThrow(Object* exception, ...@@ -789,8 +789,9 @@ void Top::DoThrow(Object* exception,
// If the exception is caught externally, we store it in the // If the exception is caught externally, we store it in the
// try/catch handler. The C code can find it later and process it if // try/catch handler. The C code can find it later and process it if
// necessary. // necessary.
thread_local_.pending_external_caught_exception_ = is_caught_externally; thread_local_.catcher_ = NULL;
if (is_caught_externally) { if (is_caught_externally) {
thread_local_.catcher_ = thread_local_.try_catch_handler_;
thread_local_.try_catch_handler_->exception_ = thread_local_.try_catch_handler_->exception_ =
reinterpret_cast<void*>(*exception_handle); reinterpret_cast<void*>(*exception_handle);
if (!message_obj.is_null()) { if (!message_obj.is_null()) {
......
...@@ -53,9 +53,7 @@ class ThreadLocalTop BASE_EMBEDDED { ...@@ -53,9 +53,7 @@ class ThreadLocalTop BASE_EMBEDDED {
bool external_caught_exception_; bool external_caught_exception_;
v8::TryCatch* try_catch_handler_; v8::TryCatch* try_catch_handler_;
SaveContext* save_context_; SaveContext* save_context_;
// Flag indicating that the try_catch_handler_ contains an exception to be v8::TryCatch* catcher_;
// caught.
bool pending_external_caught_exception_;
// Stack. // Stack.
Address c_entry_fp_; // the frame pointer of the top c entry frame Address c_entry_fp_; // the frame pointer of the top c entry frame
...@@ -146,16 +144,10 @@ class Top { ...@@ -146,16 +144,10 @@ class Top {
thread_local_.scheduled_exception_ = Heap::the_hole_value(); thread_local_.scheduled_exception_ = Heap::the_hole_value();
} }
// Propagate the external caught exception flag. If there is no external static void setup_external_caught() {
// caught exception always clear the TryCatch handler as it might contain thread_local_.external_caught_exception_ =
// an exception object from a throw which was bypassed by a finally block (thread_local_.catcher_ != NULL) &&
// doing an explicit return/break/continue. (Top::thread_local_.try_catch_handler_ == Top::thread_local_.catcher_);
static void propagate_external_caught() {
if (has_pending_exception()) {
thread_local_.external_caught_exception_ =
thread_local_.pending_external_caught_exception_;
}
thread_local_.pending_external_caught_exception_ = false;
} }
// Tells whether the current context has experienced an out of memory // Tells whether the current context has experienced an out of memory
......
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