LGTM. Too bad.

On Fri, Oct 24, 2008 at 8:40 AM,  <[EMAIL PROTECTED]> wrote:
> Reviewers: Kasper Lund,
>
> Description:
> Reverted r576 as it caused a regression.
>
> TBR=kasperl
>
> Please review this at http://codereview.chromium.org/7970
>
> SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
>
> Affected files:
>  M     src/execution.cc
>  M     src/top.h
>  M     src/top.cc
>
>
> Index: src/top.cc
> ===================================================================
> --- src/top.cc  (revision 576)
> +++ src/top.cc  (working copy)
> @@ -101,7 +101,7 @@
>   clear_pending_exception();
>   clear_scheduled_exception();
>   thread_local_.save_context_ = NULL;
> -  thread_local_.pending_external_caught_exception_ = false;
> +  thread_local_.catcher_ = NULL;
>  }
>
>
> @@ -607,7 +607,7 @@
>
>
>  Failure* Top::ReThrow(Object* exception, MessageLocation* location) {
> -  // Set the exception being re-thrown.
> +  // Set the exception beeing re-thrown.
>   set_pending_exception(exception);
>   return Failure::Exception();
>  }
> @@ -789,8 +789,9 @@
>   // 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
>   // necessary.
> -  thread_local_.pending_external_caught_exception_ = is_caught_externally;
> +  thread_local_.catcher_ = NULL;
>   if (is_caught_externally) {
> +    thread_local_.catcher_ = thread_local_.try_catch_handler_;
>     thread_local_.try_catch_handler_->exception_ =
>       reinterpret_cast<void*>(*exception_handle);
>     if (!message_obj.is_null()) {
> Index: src/top.h
> ===================================================================
> --- src/top.h   (revision 576)
> +++ src/top.h   (working copy)
> @@ -53,9 +53,7 @@
>   bool external_caught_exception_;
>   v8::TryCatch* try_catch_handler_;
>   SaveContext* save_context_;
> -  // Flag indicating that the try_catch_handler_ contains an exception to
> be
> -  // caught.
> -  bool pending_external_caught_exception_;
> +  v8::TryCatch* catcher_;
>
>   // Stack.
>   Address c_entry_fp_;  // the frame pointer of the top c entry frame
> @@ -146,20 +144,10 @@
>     thread_local_.scheduled_exception_ = Heap::the_hole_value();
>   }
>
> -  // Propagate the external caught exception flag. If there is no external
> -  // caught exception always clear the TryCatch handler as it might contain
> -  // an exception object from a throw which was bypassed by a finally block
> -  // doing an explicit return/break/continue.
> -  static void propagate_external_caught() {
> -    if (has_pending_exception()) {
> -      thread_local_.external_caught_exception_ =
> -          thread_local_.pending_external_caught_exception_;
> -    } else {
> -      if (thread_local_.try_catch_handler_ != NULL) {
> -        thread_local_.try_catch_handler_->Reset();
> -      }
> -    }
> -    thread_local_.pending_external_caught_exception_ = false;
> +  static void setup_external_caught() {
> +    thread_local_.external_caught_exception_ =
> +        (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
> Index: src/execution.cc
> ===================================================================
> --- src/execution.cc    (revision 576)
> +++ src/execution.cc    (working copy)
> @@ -91,10 +91,12 @@
>   value->Verify();
>  #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();
>   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
>   // the global context.  Note: We have to mark the global context here
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/v8-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to