OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_ISOLATE_H_ | 5 #ifndef V8_ISOLATE_H_ |
6 #define V8_ISOLATE_H_ | 6 #define V8_ISOLATE_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include "include/v8-debug.h" | 9 #include "include/v8-debug.h" |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 // Find the correct handler for the current pending exception. This also | 760 // Find the correct handler for the current pending exception. This also |
761 // clears and returns the current pending exception. | 761 // clears and returns the current pending exception. |
762 Object* FindHandler(); | 762 Object* FindHandler(); |
763 | 763 |
764 // Tries to predict whether the exception will be caught. Note that this can | 764 // Tries to predict whether the exception will be caught. Note that this can |
765 // only produce an estimate, because it is undecidable whether a finally | 765 // only produce an estimate, because it is undecidable whether a finally |
766 // clause will consume or re-throw an exception. We conservatively assume any | 766 // clause will consume or re-throw an exception. We conservatively assume any |
767 // finally clause will behave as if the exception were consumed. | 767 // finally clause will behave as if the exception were consumed. |
768 bool PredictWhetherExceptionIsCaught(Object* exception); | 768 bool PredictWhetherExceptionIsCaught(Object* exception); |
769 | 769 |
| 770 // Propagate pending exception message to potential v8::TryCatch. Also call |
| 771 // message handlers when the exception is guaranteed not to be caught. |
| 772 void ReportPendingMessages(); |
| 773 |
770 void ScheduleThrow(Object* exception); | 774 void ScheduleThrow(Object* exception); |
771 // Re-set pending message, script and positions reported to the TryCatch | 775 // Re-set pending message, script and positions reported to the TryCatch |
772 // back to the TLS for re-use when rethrowing. | 776 // back to the TLS for re-use when rethrowing. |
773 void RestorePendingMessageFromTryCatch(v8::TryCatch* handler); | 777 void RestorePendingMessageFromTryCatch(v8::TryCatch* handler); |
774 // Un-schedule an exception that was caught by a TryCatch handler. | 778 // Un-schedule an exception that was caught by a TryCatch handler. |
775 void CancelScheduledExceptionFromTryCatch(v8::TryCatch* handler); | 779 void CancelScheduledExceptionFromTryCatch(v8::TryCatch* handler); |
776 void ReportPendingMessages(); | |
777 // Return pending location if any or unfilled structure. | 780 // Return pending location if any or unfilled structure. |
778 MessageLocation GetMessageLocation(); | 781 MessageLocation GetMessageLocation(); |
779 | 782 |
780 // Promote a scheduled exception to pending. Asserts has_scheduled_exception. | 783 // Promote a scheduled exception to pending. Asserts has_scheduled_exception. |
781 Object* PromoteScheduledException(); | 784 Object* PromoteScheduledException(); |
782 | 785 |
783 // Attempts to compute the current source location, storing the | 786 // Attempts to compute the current source location, storing the |
784 // result in the target out parameter. | 787 // result in the target out parameter. |
785 void ComputeLocation(MessageLocation* target); | 788 void ComputeLocation(MessageLocation* target); |
786 bool ComputeLocationFromException(MessageLocation* target, | 789 bool ComputeLocationFromException(MessageLocation* target, |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 | 1211 |
1209 void InitializeThreadLocal(); | 1212 void InitializeThreadLocal(); |
1210 | 1213 |
1211 void MarkCompactPrologue(bool is_compacting, | 1214 void MarkCompactPrologue(bool is_compacting, |
1212 ThreadLocalTop* archived_thread_data); | 1215 ThreadLocalTop* archived_thread_data); |
1213 void MarkCompactEpilogue(bool is_compacting, | 1216 void MarkCompactEpilogue(bool is_compacting, |
1214 ThreadLocalTop* archived_thread_data); | 1217 ThreadLocalTop* archived_thread_data); |
1215 | 1218 |
1216 void FillCache(); | 1219 void FillCache(); |
1217 | 1220 |
1218 // Propagate pending exception message to the v8::TryCatch. | |
1219 // If there is no external try-catch or message was successfully propagated, | |
1220 // then return true. | |
1221 bool PropagatePendingExceptionToExternalTryCatch(); | |
1222 | |
1223 // Traverse prototype chain to find out whether the object is derived from | 1221 // Traverse prototype chain to find out whether the object is derived from |
1224 // the Error object. | 1222 // the Error object. |
1225 bool IsErrorObject(Handle<Object> obj); | 1223 bool IsErrorObject(Handle<Object> obj); |
1226 | 1224 |
1227 base::Atomic32 id_; | 1225 base::Atomic32 id_; |
1228 EntryStackItem* entry_stack_; | 1226 EntryStackItem* entry_stack_; |
1229 int stack_trace_nesting_level_; | 1227 int stack_trace_nesting_level_; |
1230 StringStream* incomplete_message_; | 1228 StringStream* incomplete_message_; |
1231 Address isolate_addresses_[kIsolateAddressCount + 1]; // NOLINT | 1229 Address isolate_addresses_[kIsolateAddressCount + 1]; // NOLINT |
1232 Bootstrapper* bootstrapper_; | 1230 Bootstrapper* bootstrapper_; |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 } | 1561 } |
1564 | 1562 |
1565 EmbeddedVector<char, 128> filename_; | 1563 EmbeddedVector<char, 128> filename_; |
1566 FILE* file_; | 1564 FILE* file_; |
1567 int scope_depth_; | 1565 int scope_depth_; |
1568 }; | 1566 }; |
1569 | 1567 |
1570 } } // namespace v8::internal | 1568 } } // namespace v8::internal |
1571 | 1569 |
1572 #endif // V8_ISOLATE_H_ | 1570 #endif // V8_ISOLATE_H_ |
OLD | NEW |