Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/isolate.h

Issue 17694002: Restore message when rethrowing in TryCatch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 ASSERT(try_catch_handler_address_ == NULL); 239 ASSERT(try_catch_handler_address_ == NULL);
240 } 240 }
241 241
242 Isolate* isolate_; 242 Isolate* isolate_;
243 // The context where the current execution method is created and for variable 243 // The context where the current execution method is created and for variable
244 // lookups. 244 // lookups.
245 Context* context_; 245 Context* context_;
246 ThreadId thread_id_; 246 ThreadId thread_id_;
247 MaybeObject* pending_exception_; 247 MaybeObject* pending_exception_;
248 bool has_pending_message_; 248 bool has_pending_message_;
249 bool rethrowing_message_;
249 Object* pending_message_obj_; 250 Object* pending_message_obj_;
250 Script* pending_message_script_; 251 Object* pending_message_script_;
251 int pending_message_start_pos_; 252 int pending_message_start_pos_;
252 int pending_message_end_pos_; 253 int pending_message_end_pos_;
253 // Use a separate value for scheduled exceptions to preserve the 254 // Use a separate value for scheduled exceptions to preserve the
254 // invariants that hold about pending_exception. We may want to 255 // invariants that hold about pending_exception. We may want to
255 // unify them later. 256 // unify them later.
256 MaybeObject* scheduled_exception_; 257 MaybeObject* scheduled_exception_;
257 bool external_caught_exception_; 258 bool external_caught_exception_;
258 SaveContext* save_context_; 259 SaveContext* save_context_;
259 v8::TryCatch* catcher_; 260 v8::TryCatch* catcher_;
260 261
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 } 576 }
576 MaybeObject** pending_exception_address() { 577 MaybeObject** pending_exception_address() {
577 return &thread_local_top_.pending_exception_; 578 return &thread_local_top_.pending_exception_;
578 } 579 }
579 bool has_pending_exception() { 580 bool has_pending_exception() {
580 return !thread_local_top_.pending_exception_->IsTheHole(); 581 return !thread_local_top_.pending_exception_->IsTheHole();
581 } 582 }
582 void clear_pending_message() { 583 void clear_pending_message() {
583 thread_local_top_.has_pending_message_ = false; 584 thread_local_top_.has_pending_message_ = false;
584 thread_local_top_.pending_message_obj_ = heap_.the_hole_value(); 585 thread_local_top_.pending_message_obj_ = heap_.the_hole_value();
585 thread_local_top_.pending_message_script_ = NULL; 586 thread_local_top_.pending_message_script_ = heap_.the_hole_value();
586 } 587 }
587 v8::TryCatch* try_catch_handler() { 588 v8::TryCatch* try_catch_handler() {
588 return thread_local_top_.TryCatchHandler(); 589 return thread_local_top_.TryCatchHandler();
589 } 590 }
590 Address try_catch_handler_address() { 591 Address try_catch_handler_address() {
591 return thread_local_top_.try_catch_handler_address(); 592 return thread_local_top_.try_catch_handler_address();
592 } 593 }
593 bool* external_caught_exception_address() { 594 bool* external_caught_exception_address() {
594 return &thread_local_top_.external_caught_exception_; 595 return &thread_local_top_.external_caught_exception_;
595 } 596 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 void ReportFailedAccessCheck(JSObject* receiver, v8::AccessType type); 754 void ReportFailedAccessCheck(JSObject* receiver, v8::AccessType type);
754 755
755 // Exception throwing support. The caller should use the result 756 // Exception throwing support. The caller should use the result
756 // of Throw() as its return value. 757 // of Throw() as its return value.
757 Failure* Throw(Object* exception, MessageLocation* location = NULL); 758 Failure* Throw(Object* exception, MessageLocation* location = NULL);
758 // Re-throw an exception. This involves no error reporting since 759 // Re-throw an exception. This involves no error reporting since
759 // error reporting was handled when the exception was thrown 760 // error reporting was handled when the exception was thrown
760 // originally. 761 // originally.
761 Failure* ReThrow(MaybeObject* exception); 762 Failure* ReThrow(MaybeObject* exception);
762 void ScheduleThrow(Object* exception); 763 void ScheduleThrow(Object* exception);
764 // Re-set pending message, script and positions reported to the TryCatch
765 // back to the TLS for re-use when rethrowing.
766 void RestorePendingMessageFromTryCatch(v8::TryCatch* handler);
763 void ReportPendingMessages(); 767 void ReportPendingMessages();
764 // Return pending location if any or unfilled structure. 768 // Return pending location if any or unfilled structure.
765 MessageLocation GetMessageLocation(); 769 MessageLocation GetMessageLocation();
766 Failure* ThrowIllegalOperation(); 770 Failure* ThrowIllegalOperation();
767 771
768 // Promote a scheduled exception to pending. Asserts has_scheduled_exception. 772 // Promote a scheduled exception to pending. Asserts has_scheduled_exception.
769 Failure* PromoteScheduledException(); 773 Failure* PromoteScheduledException();
770 void DoThrow(Object* exception, MessageLocation* location); 774 void DoThrow(Object* exception, MessageLocation* location);
771 // Checks if exception should be reported and finds out if it's 775 // Checks if exception should be reported and finds out if it's
772 // caught externally. 776 // caught externally.
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 1493
1490 // Mark the native context with out of memory. 1494 // Mark the native context with out of memory.
1491 inline void Context::mark_out_of_memory() { 1495 inline void Context::mark_out_of_memory() {
1492 native_context()->set_out_of_memory(HEAP->true_value()); 1496 native_context()->set_out_of_memory(HEAP->true_value());
1493 } 1497 }
1494 1498
1495 1499
1496 } } // namespace v8::internal 1500 } } // namespace v8::internal
1497 1501
1498 #endif // V8_ISOLATE_H_ 1502 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698