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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 thread_local_.pending_exception_ = Heap::the_hole_value(); | 120 thread_local_.pending_exception_ = Heap::the_hole_value(); |
121 } | 121 } |
122 | 122 |
123 static Object** pending_exception_address() { | 123 static Object** pending_exception_address() { |
124 return &thread_local_.pending_exception_; | 124 return &thread_local_.pending_exception_; |
125 } | 125 } |
126 static bool has_pending_exception() { | 126 static bool has_pending_exception() { |
127 return !thread_local_.pending_exception_->IsTheHole(); | 127 return !thread_local_.pending_exception_->IsTheHole(); |
128 } | 128 } |
129 static void clear_pending_message() { | 129 static void clear_pending_message() { |
130 thread_local_.catcher_ = NULL; | |
131 thread_local_.has_pending_message_ = false; | 130 thread_local_.has_pending_message_ = false; |
132 thread_local_.pending_message_ = NULL; | 131 thread_local_.pending_message_ = NULL; |
133 thread_local_.pending_message_obj_ = Heap::the_hole_value(); | 132 thread_local_.pending_message_obj_ = Heap::the_hole_value(); |
134 thread_local_.pending_message_script_ = NULL; | 133 thread_local_.pending_message_script_ = NULL; |
135 } | 134 } |
136 static v8::TryCatch* try_catch_handler() { | 135 static v8::TryCatch* try_catch_handler() { |
137 return thread_local_.try_catch_handler_; | 136 return thread_local_.try_catch_handler_; |
138 } | 137 } |
139 // This method is called by the api after operations that may throw | 138 // This method is called by the api after operations that may throw |
140 // exceptions. If an exception was thrown and not handled by an external | 139 // exceptions. If an exception was thrown and not handled by an external |
(...skipping 11 matching lines...) Expand all Loading... |
152 } | 151 } |
153 static bool has_scheduled_exception() { | 152 static bool has_scheduled_exception() { |
154 return !thread_local_.scheduled_exception_->IsTheHole(); | 153 return !thread_local_.scheduled_exception_->IsTheHole(); |
155 } | 154 } |
156 static void clear_scheduled_exception() { | 155 static void clear_scheduled_exception() { |
157 thread_local_.scheduled_exception_ = Heap::the_hole_value(); | 156 thread_local_.scheduled_exception_ = Heap::the_hole_value(); |
158 } | 157 } |
159 | 158 |
160 static void setup_external_caught() { | 159 static void setup_external_caught() { |
161 thread_local_.external_caught_exception_ = | 160 thread_local_.external_caught_exception_ = |
162 (!thread_local_.pending_exception_->IsTheHole()) && | 161 has_pending_exception() && |
163 (thread_local_.catcher_ != NULL) && | 162 (thread_local_.catcher_ != NULL) && |
164 (Top::thread_local_.try_catch_handler_ == Top::thread_local_.catcher_); | 163 (thread_local_.try_catch_handler_ == thread_local_.catcher_); |
165 } | 164 } |
166 | 165 |
167 // Tells whether the current context has experienced an out of memory | 166 // Tells whether the current context has experienced an out of memory |
168 // exception. | 167 // exception. |
169 static bool is_out_of_memory(); | 168 static bool is_out_of_memory(); |
170 | 169 |
171 // JS execution stack (see frames.h). | 170 // JS execution stack (see frames.h). |
172 static Address c_entry_fp(ThreadLocalTop* thread) { | 171 static Address c_entry_fp(ThreadLocalTop* thread) { |
173 return thread->c_entry_fp_; | 172 return thread->c_entry_fp_; |
174 } | 173 } |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 368 |
370 class ExecutionAccess BASE_EMBEDDED { | 369 class ExecutionAccess BASE_EMBEDDED { |
371 public: | 370 public: |
372 ExecutionAccess(); | 371 ExecutionAccess(); |
373 ~ExecutionAccess(); | 372 ~ExecutionAccess(); |
374 }; | 373 }; |
375 | 374 |
376 } } // namespace v8::internal | 375 } } // namespace v8::internal |
377 | 376 |
378 #endif // V8_TOP_H_ | 377 #endif // V8_TOP_H_ |
OLD | NEW |