OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 } | 848 } |
849 clear_pending_message(); | 849 clear_pending_message(); |
850 } | 850 } |
851 | 851 |
852 | 852 |
853 void Top::TraceException(bool flag) { | 853 void Top::TraceException(bool flag) { |
854 FLAG_trace_exception = flag; | 854 FLAG_trace_exception = flag; |
855 } | 855 } |
856 | 856 |
857 | 857 |
858 bool Top::OptionalRescheduleException(bool is_bottom_call, | 858 bool Top::OptionalRescheduleException(bool is_bottom_call) { |
859 bool force_clear_catchable) { | |
860 // Allways reschedule out of memory exceptions. | 859 // Allways reschedule out of memory exceptions. |
861 if (!is_out_of_memory()) { | 860 if (!is_out_of_memory()) { |
862 bool is_termination_exception = | 861 bool is_termination_exception = |
863 pending_exception() == Heap::termination_exception(); | 862 pending_exception() == Heap::termination_exception(); |
864 | 863 |
865 // Do not reschedule the exception if this is the bottom call or | 864 // Do not reschedule the exception if this is the bottom call. |
866 // if we are asked to clear catchable exceptions. Termination | 865 bool clear_exception = is_bottom_call; |
867 // exceptions are not catchable and are only cleared if this is | |
868 // the bottom call. | |
869 bool clear_exception = is_bottom_call || | |
870 (force_clear_catchable && !is_termination_exception); | |
871 | 866 |
872 if (is_termination_exception) { | 867 if (is_termination_exception) { |
873 thread_local_.external_caught_exception_ = false; | |
874 if (is_bottom_call) { | 868 if (is_bottom_call) { |
| 869 thread_local_.external_caught_exception_ = false; |
875 clear_pending_exception(); | 870 clear_pending_exception(); |
876 return false; | 871 return false; |
877 } | 872 } |
878 } else if (thread_local_.external_caught_exception_) { | 873 } else if (thread_local_.external_caught_exception_) { |
879 // If the exception is externally caught, clear it if there are no | 874 // If the exception is externally caught, clear it if there are no |
880 // JavaScript frames on the way to the C++ frame that has the | 875 // JavaScript frames on the way to the C++ frame that has the |
881 // external handler. | 876 // external handler. |
882 ASSERT(thread_local_.try_catch_handler_ != NULL); | 877 ASSERT(thread_local_.try_catch_handler_ != NULL); |
883 Address external_handler_address = | 878 Address external_handler_address = |
884 reinterpret_cast<Address>(thread_local_.try_catch_handler_); | 879 reinterpret_cast<Address>(thread_local_.try_catch_handler_); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 Top::break_access_->Lock(); | 963 Top::break_access_->Lock(); |
969 } | 964 } |
970 | 965 |
971 | 966 |
972 ExecutionAccess::~ExecutionAccess() { | 967 ExecutionAccess::~ExecutionAccess() { |
973 Top::break_access_->Unlock(); | 968 Top::break_access_->Unlock(); |
974 } | 969 } |
975 | 970 |
976 | 971 |
977 } } // namespace v8::internal | 972 } } // namespace v8::internal |
OLD | NEW |