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 <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 Isolate* __isolate__ = (isolate); \ | 119 Isolate* __isolate__ = (isolate); \ |
120 if (__isolate__->has_scheduled_exception()) { \ | 120 if (__isolate__->has_scheduled_exception()) { \ |
121 __isolate__->PromoteScheduledException(); \ | 121 __isolate__->PromoteScheduledException(); \ |
122 return value; \ | 122 return value; \ |
123 } \ | 123 } \ |
124 } while (false) | 124 } while (false) |
125 | 125 |
126 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ | 126 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ |
127 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>()) | 127 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>()) |
128 | 128 |
129 #define RETURN_RESULT(isolate, call, T) \ | |
130 do { \ | |
131 Handle<T> __result__; \ | |
132 if (!(call).ToHandle(&__result__)) { \ | |
133 DCHECK((isolate)->has_pending_exception()); \ | |
134 return MaybeHandle<T>(); \ | |
135 } \ | |
136 return __result__; \ | |
137 } while (false) | |
138 | |
129 #define RETURN_RESULT_OR_FAILURE(isolate, call) \ | 139 #define RETURN_RESULT_OR_FAILURE(isolate, call) \ |
130 do { \ | 140 do { \ |
131 Handle<Object> __result__; \ | 141 Handle<Object> __result__; \ |
132 Isolate* __isolate__ = (isolate); \ | 142 Isolate* __isolate__ = (isolate); \ |
133 if (!(call).ToHandle(&__result__)) { \ | 143 if (!(call).ToHandle(&__result__)) { \ |
134 DCHECK(__isolate__->has_pending_exception()); \ | 144 DCHECK(__isolate__->has_pending_exception()); \ |
135 return __isolate__->heap()->exception(); \ | 145 return __isolate__->heap()->exception(); \ |
136 } \ | 146 } \ |
137 return *__result__; \ | 147 return *__result__; \ |
138 } while (false) | 148 } while (false) |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
669 // Scope currently can only be used for regular exceptions, | 679 // Scope currently can only be used for regular exceptions, |
670 // not termination exception. | 680 // not termination exception. |
671 inline explicit ExceptionScope(Isolate* isolate); | 681 inline explicit ExceptionScope(Isolate* isolate); |
672 inline ~ExceptionScope(); | 682 inline ~ExceptionScope(); |
673 | 683 |
674 private: | 684 private: |
675 Isolate* isolate_; | 685 Isolate* isolate_; |
676 Handle<Object> pending_exception_; | 686 Handle<Object> pending_exception_; |
677 }; | 687 }; |
678 | 688 |
689 void set_formatting_stack_trace(bool val) { formatting_stack_trace_ = val; } | |
690 bool formatting_stack_trace() const { return formatting_stack_trace_; } | |
691 | |
679 void SetCaptureStackTraceForUncaughtExceptions( | 692 void SetCaptureStackTraceForUncaughtExceptions( |
680 bool capture, | 693 bool capture, |
681 int frame_limit, | 694 int frame_limit, |
682 StackTrace::StackTraceOptions options); | 695 StackTrace::StackTraceOptions options); |
683 | 696 |
684 void SetAbortOnUncaughtExceptionCallback( | 697 void SetAbortOnUncaughtExceptionCallback( |
685 v8::Isolate::AbortOnUncaughtExceptionCallback callback); | 698 v8::Isolate::AbortOnUncaughtExceptionCallback callback); |
686 | 699 |
687 enum PrintStackMode { kPrintStackConcise, kPrintStackVerbose }; | 700 enum PrintStackMode { kPrintStackConcise, kPrintStackVerbose }; |
688 void PrintCurrentStackTrace(FILE* out); | 701 void PrintCurrentStackTrace(FILE* out); |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1283 Logger* logger_; | 1296 Logger* logger_; |
1284 StackGuard stack_guard_; | 1297 StackGuard stack_guard_; |
1285 StatsTable* stats_table_; | 1298 StatsTable* stats_table_; |
1286 StubCache* load_stub_cache_; | 1299 StubCache* load_stub_cache_; |
1287 StubCache* store_stub_cache_; | 1300 StubCache* store_stub_cache_; |
1288 CodeAgingHelper* code_aging_helper_; | 1301 CodeAgingHelper* code_aging_helper_; |
1289 DeoptimizerData* deoptimizer_data_; | 1302 DeoptimizerData* deoptimizer_data_; |
1290 bool deoptimizer_lazy_throw_; | 1303 bool deoptimizer_lazy_throw_; |
1291 MaterializedObjectStore* materialized_object_store_; | 1304 MaterializedObjectStore* materialized_object_store_; |
1292 ThreadLocalTop thread_local_top_; | 1305 ThreadLocalTop thread_local_top_; |
1306 bool formatting_stack_trace_; | |
Yang
2016/08/01 12:31:20
You can add this to ISOLATE_INIT_LIST
jgruber
2016/08/01 14:01:08
Done.
| |
1293 bool capture_stack_trace_for_uncaught_exceptions_; | 1307 bool capture_stack_trace_for_uncaught_exceptions_; |
1294 int stack_trace_for_uncaught_exceptions_frame_limit_; | 1308 int stack_trace_for_uncaught_exceptions_frame_limit_; |
1295 StackTrace::StackTraceOptions stack_trace_for_uncaught_exceptions_options_; | 1309 StackTrace::StackTraceOptions stack_trace_for_uncaught_exceptions_options_; |
1296 KeyedLookupCache* keyed_lookup_cache_; | 1310 KeyedLookupCache* keyed_lookup_cache_; |
1297 ContextSlotCache* context_slot_cache_; | 1311 ContextSlotCache* context_slot_cache_; |
1298 DescriptorLookupCache* descriptor_lookup_cache_; | 1312 DescriptorLookupCache* descriptor_lookup_cache_; |
1299 HandleScopeData handle_scope_data_; | 1313 HandleScopeData handle_scope_data_; |
1300 HandleScopeImplementer* handle_scope_implementer_; | 1314 HandleScopeImplementer* handle_scope_implementer_; |
1301 UnicodeCache* unicode_cache_; | 1315 UnicodeCache* unicode_cache_; |
1302 base::AccountingAllocator* allocator_; | 1316 base::AccountingAllocator* allocator_; |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1643 | 1657 |
1644 EmbeddedVector<char, 128> filename_; | 1658 EmbeddedVector<char, 128> filename_; |
1645 FILE* file_; | 1659 FILE* file_; |
1646 int scope_depth_; | 1660 int scope_depth_; |
1647 }; | 1661 }; |
1648 | 1662 |
1649 } // namespace internal | 1663 } // namespace internal |
1650 } // namespace v8 | 1664 } // namespace v8 |
1651 | 1665 |
1652 #endif // V8_ISOLATE_H_ | 1666 #endif // V8_ISOLATE_H_ |
OLD | NEW |