OLD | NEW |
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 281 |
282 // Generated code scratch locations. | 282 // Generated code scratch locations. |
283 int32_t formal_count_; | 283 int32_t formal_count_; |
284 | 284 |
285 // Call back function to report unsafe JS accesses. | 285 // Call back function to report unsafe JS accesses. |
286 v8::FailedAccessCheckCallback failed_access_check_callback_; | 286 v8::FailedAccessCheckCallback failed_access_check_callback_; |
287 | 287 |
288 // Head of the list of live LookupResults. | 288 // Head of the list of live LookupResults. |
289 LookupResult* top_lookup_result_; | 289 LookupResult* top_lookup_result_; |
290 | 290 |
| 291 // Whether out of memory exceptions should be ignored. |
| 292 bool ignore_out_of_memory_; |
| 293 |
291 private: | 294 private: |
292 void InitializeInternal(); | 295 void InitializeInternal(); |
293 | 296 |
294 Address try_catch_handler_address_; | 297 Address try_catch_handler_address_; |
295 }; | 298 }; |
296 | 299 |
297 | 300 |
298 #ifdef ENABLE_DEBUGGER_SUPPORT | 301 #ifdef ENABLE_DEBUGGER_SUPPORT |
299 | 302 |
300 #define ISOLATE_DEBUGGER_INIT_LIST(V) \ | 303 #define ISOLATE_DEBUGGER_INIT_LIST(V) \ |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 bool has_scheduled_exception() { | 634 bool has_scheduled_exception() { |
632 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value(); | 635 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value(); |
633 } | 636 } |
634 void clear_scheduled_exception() { | 637 void clear_scheduled_exception() { |
635 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); | 638 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); |
636 } | 639 } |
637 | 640 |
638 bool IsExternallyCaught(); | 641 bool IsExternallyCaught(); |
639 | 642 |
640 bool is_catchable_by_javascript(MaybeObject* exception) { | 643 bool is_catchable_by_javascript(MaybeObject* exception) { |
641 return exception != heap()->termination_exception(); | 644 return (!exception->IsOutOfMemory()) && |
| 645 (exception != heap()->termination_exception()); |
642 } | 646 } |
643 | 647 |
644 // Serializer. | 648 // Serializer. |
645 void PushToPartialSnapshotCache(Object* obj); | 649 void PushToPartialSnapshotCache(Object* obj); |
646 | 650 |
647 // JS execution stack (see frames.h). | 651 // JS execution stack (see frames.h). |
648 static Address c_entry_fp(ThreadLocalTop* thread) { | 652 static Address c_entry_fp(ThreadLocalTop* thread) { |
649 return thread->c_entry_fp_; | 653 return thread->c_entry_fp_; |
650 } | 654 } |
651 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } | 655 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 Isolate* isolate_; | 714 Isolate* isolate_; |
711 Handle<Object> pending_exception_; | 715 Handle<Object> pending_exception_; |
712 v8::TryCatch* catcher_; | 716 v8::TryCatch* catcher_; |
713 }; | 717 }; |
714 | 718 |
715 void SetCaptureStackTraceForUncaughtExceptions( | 719 void SetCaptureStackTraceForUncaughtExceptions( |
716 bool capture, | 720 bool capture, |
717 int frame_limit, | 721 int frame_limit, |
718 StackTrace::StackTraceOptions options); | 722 StackTrace::StackTraceOptions options); |
719 | 723 |
| 724 // Tells whether the current context has experienced an out of memory |
| 725 // exception. |
| 726 bool is_out_of_memory(); |
| 727 |
| 728 THREAD_LOCAL_TOP_ACCESSOR(bool, ignore_out_of_memory) |
| 729 |
720 void PrintCurrentStackTrace(FILE* out); | 730 void PrintCurrentStackTrace(FILE* out); |
721 void PrintStack(StringStream* accumulator); | 731 void PrintStack(StringStream* accumulator); |
722 void PrintStack(FILE* out); | 732 void PrintStack(FILE* out); |
723 Handle<String> StackTraceString(); | 733 Handle<String> StackTraceString(); |
724 NO_INLINE(void PushStackTraceAndDie(unsigned int magic, | 734 NO_INLINE(void PushStackTraceAndDie(unsigned int magic, |
725 Object* object, | 735 Object* object, |
726 Map* map, | 736 Map* map, |
727 unsigned int magic2)); | 737 unsigned int magic2)); |
728 Handle<JSArray> CaptureCurrentStackTrace( | 738 Handle<JSArray> CaptureCurrentStackTrace( |
729 int frame_limit, | 739 int frame_limit, |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 if (--stack_guard_->thread_local_.postpone_interrupts_nesting_ == 0) { | 1468 if (--stack_guard_->thread_local_.postpone_interrupts_nesting_ == 0) { |
1459 stack_guard_->EnableInterrupts(); | 1469 stack_guard_->EnableInterrupts(); |
1460 } | 1470 } |
1461 } | 1471 } |
1462 private: | 1472 private: |
1463 StackGuard* stack_guard_; | 1473 StackGuard* stack_guard_; |
1464 Isolate* isolate_; | 1474 Isolate* isolate_; |
1465 }; | 1475 }; |
1466 | 1476 |
1467 | 1477 |
| 1478 // Tells whether the native context is marked with out of memory. |
| 1479 inline bool Context::has_out_of_memory() { |
| 1480 return native_context()->out_of_memory()->IsTrue(); |
| 1481 } |
| 1482 |
| 1483 |
| 1484 // Mark the native context with out of memory. |
| 1485 inline void Context::mark_out_of_memory() { |
| 1486 native_context()->set_out_of_memory(GetIsolate()->heap()->true_value()); |
| 1487 } |
| 1488 |
1468 class CodeTracer V8_FINAL : public Malloced { | 1489 class CodeTracer V8_FINAL : public Malloced { |
1469 public: | 1490 public: |
1470 explicit CodeTracer(int isolate_id) | 1491 explicit CodeTracer(int isolate_id) |
1471 : file_(NULL), | 1492 : file_(NULL), |
1472 scope_depth_(0) { | 1493 scope_depth_(0) { |
1473 if (!ShouldRedirect()) { | 1494 if (!ShouldRedirect()) { |
1474 file_ = stdout; | 1495 file_ = stdout; |
1475 return; | 1496 return; |
1476 } | 1497 } |
1477 | 1498 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1529 } | 1550 } |
1530 | 1551 |
1531 EmbeddedVector<char, 128> filename_; | 1552 EmbeddedVector<char, 128> filename_; |
1532 FILE* file_; | 1553 FILE* file_; |
1533 int scope_depth_; | 1554 int scope_depth_; |
1534 }; | 1555 }; |
1535 | 1556 |
1536 } } // namespace v8::internal | 1557 } } // namespace v8::internal |
1537 | 1558 |
1538 #endif // V8_ISOLATE_H_ | 1559 #endif // V8_ISOLATE_H_ |
OLD | NEW |