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 28 matching lines...) Expand all Loading... |
39 // Top has static variables used for JavaScript execution. | 39 // Top has static variables used for JavaScript execution. |
40 | 40 |
41 class SaveContext; // Forward decleration. | 41 class SaveContext; // Forward decleration. |
42 | 42 |
43 class ThreadLocalTop BASE_EMBEDDED { | 43 class ThreadLocalTop BASE_EMBEDDED { |
44 public: | 44 public: |
45 // The context where the current execution method is created and for variable | 45 // The context where the current execution method is created and for variable |
46 // lookups. | 46 // lookups. |
47 Context* context_; | 47 Context* context_; |
48 Object* pending_exception_; | 48 Object* pending_exception_; |
| 49 bool has_pending_message_; |
49 const char* pending_message_; | 50 const char* pending_message_; |
50 Object* pending_message_obj_; | 51 Object* pending_message_obj_; |
51 Script* pending_message_script_; | 52 Script* pending_message_script_; |
52 int pending_message_start_pos_; | 53 int pending_message_start_pos_; |
53 int pending_message_end_pos_; | 54 int pending_message_end_pos_; |
54 // Use a separate value for scheduled exceptions to preserve the | 55 // Use a separate value for scheduled exceptions to preserve the |
55 // invariants that hold about pending_exception. We may want to | 56 // invariants that hold about pending_exception. We may want to |
56 // unify them later. | 57 // unify them later. |
57 Object* scheduled_exception_; | 58 Object* scheduled_exception_; |
58 bool external_caught_exception_; | 59 bool external_caught_exception_; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 121 } |
121 | 122 |
122 static Object** pending_exception_address() { | 123 static Object** pending_exception_address() { |
123 return &thread_local_.pending_exception_; | 124 return &thread_local_.pending_exception_; |
124 } | 125 } |
125 static bool has_pending_exception() { | 126 static bool has_pending_exception() { |
126 return !thread_local_.pending_exception_->IsTheHole(); | 127 return !thread_local_.pending_exception_->IsTheHole(); |
127 } | 128 } |
128 static void clear_pending_message() { | 129 static void clear_pending_message() { |
129 thread_local_.catcher_ = NULL; | 130 thread_local_.catcher_ = NULL; |
| 131 thread_local_.has_pending_message_ = false; |
130 thread_local_.pending_message_ = NULL; | 132 thread_local_.pending_message_ = NULL; |
131 thread_local_.pending_message_obj_ = Heap::the_hole_value(); | 133 thread_local_.pending_message_obj_ = Heap::the_hole_value(); |
132 thread_local_.pending_message_script_ = NULL; | 134 thread_local_.pending_message_script_ = NULL; |
133 } | 135 } |
134 static v8::TryCatch* try_catch_handler() { | 136 static v8::TryCatch* try_catch_handler() { |
135 return thread_local_.try_catch_handler_; | 137 return thread_local_.try_catch_handler_; |
136 } | 138 } |
137 // This method is called by the api after operations that may throw | 139 // This method is called by the api after operations that may throw |
138 // exceptions. If an exception was thrown and not handled by an external | 140 // exceptions. If an exception was thrown and not handled by an external |
139 // handler the exception is scheduled to be rethrown when we return to running | 141 // handler the exception is scheduled to be rethrown when we return to running |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 | 381 |
380 class ExecutionAccess BASE_EMBEDDED { | 382 class ExecutionAccess BASE_EMBEDDED { |
381 public: | 383 public: |
382 ExecutionAccess(); | 384 ExecutionAccess(); |
383 ~ExecutionAccess(); | 385 ~ExecutionAccess(); |
384 }; | 386 }; |
385 | 387 |
386 } } // namespace v8::internal | 388 } } // namespace v8::internal |
387 | 389 |
388 #endif // V8_TOP_H_ | 390 #endif // V8_TOP_H_ |
OLD | NEW |