diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2009-11-18 15:25:58 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2009-11-18 15:28:54 +0100 |
commit | 728d8a37f471afaeaa6af19823f9da8c41f1f65a (patch) | |
tree | 21e014089ff0bfb7d493691620ab9eee51176d28 /deps/v8/src/top.h | |
parent | 8195e0f7232fed3d6a3a2cc8464fec5e36f4433c (diff) | |
download | node-728d8a37f471afaeaa6af19823f9da8c41f1f65a.tar.gz |
Upgrade v8 to 2.0
(With just one change: remove -Werror)
Diffstat (limited to 'deps/v8/src/top.h')
-rw-r--r-- | deps/v8/src/top.h | 56 |
1 files changed, 47 insertions, 9 deletions
diff --git a/deps/v8/src/top.h b/deps/v8/src/top.h index ae94f08e3..8780844b0 100644 --- a/deps/v8/src/top.h +++ b/deps/v8/src/top.h @@ -43,6 +43,41 @@ class SaveContext; // Forward declaration. class ThreadLocalTop BASE_EMBEDDED { public: + // Initialize the thread data. + void Initialize(); + + // Get the top C++ try catch handler or NULL if none are registered. + // + // This method is not guarenteed to return an address that can be + // used for comparison with addresses into the JS stack. If such an + // address is needed, use try_catch_handler_address. + v8::TryCatch* TryCatchHandler(); + + // Get the address of the top C++ try catch handler or NULL if + // none are registered. + // + // This method always returns an address that can be compared to + // pointers into the JavaScript stack. When running on actual + // hardware, try_catch_handler_address and TryCatchHandler return + // the same pointer. When running on a simulator with a separate JS + // stack, try_catch_handler_address returns a JS stack address that + // corresponds to the place on the JS stack where the C++ handler + // would have been if the stack were not separate. + inline Address try_catch_handler_address() { + return try_catch_handler_address_; + } + + // Set the address of the top C++ try catch handler. + inline void set_try_catch_handler_address(Address address) { + try_catch_handler_address_ = address; + } + + void Free() { + ASSERT(!has_pending_message_); + ASSERT(!external_caught_exception_); + ASSERT(try_catch_handler_address_ == NULL); + } + // The context where the current execution method is created and for variable // lookups. Context* context_; @@ -59,7 +94,6 @@ class ThreadLocalTop BASE_EMBEDDED { // unify them later. Object* scheduled_exception_; bool external_caught_exception_; - v8::TryCatch* try_catch_handler_; SaveContext* save_context_; v8::TryCatch* catcher_; @@ -79,14 +113,11 @@ class ThreadLocalTop BASE_EMBEDDED { // Call back function to report unsafe JS accesses. v8::FailedAccessCheckCallback failed_access_check_callback_; - void Free() { - ASSERT(!has_pending_message_); - ASSERT(!external_caught_exception_); - ASSERT(try_catch_handler_ == NULL); - } + private: + Address try_catch_handler_address_; }; -#define TOP_ADDRESS_LIST(C) \ +#define TOP_ADDRESS_LIST(C) \ C(handler_address) \ C(c_entry_fp_address) \ C(context_address) \ @@ -157,7 +188,10 @@ class Top { thread_local_.pending_message_script_ = NULL; } static v8::TryCatch* try_catch_handler() { - return thread_local_.try_catch_handler_; + return thread_local_.TryCatchHandler(); + } + static Address try_catch_handler_address() { + return thread_local_.try_catch_handler_address(); } // This method is called by the api after operations that may throw // exceptions. If an exception was thrown and not handled by an external @@ -170,6 +204,10 @@ class Top { return &thread_local_.external_caught_exception_; } + static Object** scheduled_exception_address() { + return &thread_local_.scheduled_exception_; + } + static Object* scheduled_exception() { ASSERT(has_scheduled_exception()); return thread_local_.scheduled_exception_; @@ -185,7 +223,7 @@ class Top { thread_local_.external_caught_exception_ = has_pending_exception() && (thread_local_.catcher_ != NULL) && - (thread_local_.try_catch_handler_ == thread_local_.catcher_); + (try_catch_handler() == thread_local_.catcher_); } // Tells whether the current context has experienced an out of memory |