| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // lookups. | 46 // lookups. |
| 47 Context* context_; | 47 Context* context_; |
| 48 Object* pending_exception_; | 48 Object* pending_exception_; |
| 49 // Use a separate value for scheduled exceptions to preserve the | 49 // Use a separate value for scheduled exceptions to preserve the |
| 50 // invariants that hold about pending_exception. We may want to | 50 // invariants that hold about pending_exception. We may want to |
| 51 // unify them later. | 51 // unify them later. |
| 52 Object* scheduled_exception_; | 52 Object* scheduled_exception_; |
| 53 bool external_caught_exception_; | 53 bool external_caught_exception_; |
| 54 v8::TryCatch* try_catch_handler_; | 54 v8::TryCatch* try_catch_handler_; |
| 55 SaveContext* save_context_; | 55 SaveContext* save_context_; |
| 56 // Flag indicating that the try_catch_handler_ contains an exception to be | 56 v8::TryCatch* catcher_; |
| 57 // caught. | |
| 58 bool pending_external_caught_exception_; | |
| 59 | 57 |
| 60 // Stack. | 58 // Stack. |
| 61 Address c_entry_fp_; // the frame pointer of the top c entry frame | 59 Address c_entry_fp_; // the frame pointer of the top c entry frame |
| 62 Address handler_; // try-blocks are chained through the stack | 60 Address handler_; // try-blocks are chained through the stack |
| 63 bool stack_is_cooked_; | 61 bool stack_is_cooked_; |
| 64 inline bool stack_is_cooked() { return stack_is_cooked_; } | 62 inline bool stack_is_cooked() { return stack_is_cooked_; } |
| 65 inline void set_stack_is_cooked(bool value) { stack_is_cooked_ = value; } | 63 inline void set_stack_is_cooked(bool value) { stack_is_cooked_ = value; } |
| 66 | 64 |
| 67 // Generated code scratch locations. | 65 // Generated code scratch locations. |
| 68 int32_t formal_count_; | 66 int32_t formal_count_; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 ASSERT(has_scheduled_exception()); | 137 ASSERT(has_scheduled_exception()); |
| 140 return thread_local_.scheduled_exception_; | 138 return thread_local_.scheduled_exception_; |
| 141 } | 139 } |
| 142 static bool has_scheduled_exception() { | 140 static bool has_scheduled_exception() { |
| 143 return !thread_local_.scheduled_exception_->IsTheHole(); | 141 return !thread_local_.scheduled_exception_->IsTheHole(); |
| 144 } | 142 } |
| 145 static void clear_scheduled_exception() { | 143 static void clear_scheduled_exception() { |
| 146 thread_local_.scheduled_exception_ = Heap::the_hole_value(); | 144 thread_local_.scheduled_exception_ = Heap::the_hole_value(); |
| 147 } | 145 } |
| 148 | 146 |
| 149 // Propagate the external caught exception flag. If there is no external | 147 static void setup_external_caught() { |
| 150 // caught exception always clear the TryCatch handler as it might contain | 148 thread_local_.external_caught_exception_ = |
| 151 // an exception object from a throw which was bypassed by a finally block | 149 (thread_local_.catcher_ != NULL) && |
| 152 // doing an explicit return/break/continue. | 150 (Top::thread_local_.try_catch_handler_ == Top::thread_local_.catcher_); |
| 153 static void propagate_external_caught() { | |
| 154 if (has_pending_exception()) { | |
| 155 thread_local_.external_caught_exception_ = | |
| 156 thread_local_.pending_external_caught_exception_; | |
| 157 } | |
| 158 thread_local_.pending_external_caught_exception_ = false; | |
| 159 } | 151 } |
| 160 | 152 |
| 161 // Tells whether the current context has experienced an out of memory | 153 // Tells whether the current context has experienced an out of memory |
| 162 // exception. | 154 // exception. |
| 163 static bool is_out_of_memory(); | 155 static bool is_out_of_memory(); |
| 164 | 156 |
| 165 // JS execution stack (see frames.h). | 157 // JS execution stack (see frames.h). |
| 166 static Address c_entry_fp(ThreadLocalTop* thread) { | 158 static Address c_entry_fp(ThreadLocalTop* thread) { |
| 167 return thread->c_entry_fp_; | 159 return thread->c_entry_fp_; |
| 168 } | 160 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 354 |
| 363 class ExecutionAccess BASE_EMBEDDED { | 355 class ExecutionAccess BASE_EMBEDDED { |
| 364 public: | 356 public: |
| 365 ExecutionAccess(); | 357 ExecutionAccess(); |
| 366 ~ExecutionAccess(); | 358 ~ExecutionAccess(); |
| 367 }; | 359 }; |
| 368 | 360 |
| 369 } } // namespace v8::internal | 361 } } // namespace v8::internal |
| 370 | 362 |
| 371 #endif // V8_TOP_H_ | 363 #endif // V8_TOP_H_ |
| OLD | NEW |