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 | |
294 private: | 291 private: |
295 void InitializeInternal(); | 292 void InitializeInternal(); |
296 | 293 |
297 Address try_catch_handler_address_; | 294 Address try_catch_handler_address_; |
298 }; | 295 }; |
299 | 296 |
300 | 297 |
301 #ifdef ENABLE_DEBUGGER_SUPPORT | 298 #ifdef ENABLE_DEBUGGER_SUPPORT |
302 | 299 |
303 #define ISOLATE_DEBUGGER_INIT_LIST(V) \ | 300 #define ISOLATE_DEBUGGER_INIT_LIST(V) \ |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 bool has_scheduled_exception() { | 631 bool has_scheduled_exception() { |
635 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value(); | 632 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value(); |
636 } | 633 } |
637 void clear_scheduled_exception() { | 634 void clear_scheduled_exception() { |
638 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); | 635 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); |
639 } | 636 } |
640 | 637 |
641 bool IsExternallyCaught(); | 638 bool IsExternallyCaught(); |
642 | 639 |
643 bool is_catchable_by_javascript(MaybeObject* exception) { | 640 bool is_catchable_by_javascript(MaybeObject* exception) { |
644 return (!exception->IsOutOfMemory()) && | 641 return exception != heap()->termination_exception(); |
645 (exception != heap()->termination_exception()); | |
646 } | 642 } |
647 | 643 |
648 // Serializer. | 644 // Serializer. |
649 void PushToPartialSnapshotCache(Object* obj); | 645 void PushToPartialSnapshotCache(Object* obj); |
650 | 646 |
651 // JS execution stack (see frames.h). | 647 // JS execution stack (see frames.h). |
652 static Address c_entry_fp(ThreadLocalTop* thread) { | 648 static Address c_entry_fp(ThreadLocalTop* thread) { |
653 return thread->c_entry_fp_; | 649 return thread->c_entry_fp_; |
654 } | 650 } |
655 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } | 651 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 Isolate* isolate_; | 710 Isolate* isolate_; |
715 Handle<Object> pending_exception_; | 711 Handle<Object> pending_exception_; |
716 v8::TryCatch* catcher_; | 712 v8::TryCatch* catcher_; |
717 }; | 713 }; |
718 | 714 |
719 void SetCaptureStackTraceForUncaughtExceptions( | 715 void SetCaptureStackTraceForUncaughtExceptions( |
720 bool capture, | 716 bool capture, |
721 int frame_limit, | 717 int frame_limit, |
722 StackTrace::StackTraceOptions options); | 718 StackTrace::StackTraceOptions options); |
723 | 719 |
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 | |
730 void PrintCurrentStackTrace(FILE* out); | 720 void PrintCurrentStackTrace(FILE* out); |
731 void PrintStack(StringStream* accumulator); | 721 void PrintStack(StringStream* accumulator); |
732 void PrintStack(FILE* out); | 722 void PrintStack(FILE* out); |
733 Handle<String> StackTraceString(); | 723 Handle<String> StackTraceString(); |
734 NO_INLINE(void PushStackTraceAndDie(unsigned int magic, | 724 NO_INLINE(void PushStackTraceAndDie(unsigned int magic, |
735 Object* object, | 725 Object* object, |
736 Map* map, | 726 Map* map, |
737 unsigned int magic2)); | 727 unsigned int magic2)); |
738 Handle<JSArray> CaptureCurrentStackTrace( | 728 Handle<JSArray> CaptureCurrentStackTrace( |
739 int frame_limit, | 729 int frame_limit, |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 if (--stack_guard_->thread_local_.postpone_interrupts_nesting_ == 0) { | 1458 if (--stack_guard_->thread_local_.postpone_interrupts_nesting_ == 0) { |
1469 stack_guard_->EnableInterrupts(); | 1459 stack_guard_->EnableInterrupts(); |
1470 } | 1460 } |
1471 } | 1461 } |
1472 private: | 1462 private: |
1473 StackGuard* stack_guard_; | 1463 StackGuard* stack_guard_; |
1474 Isolate* isolate_; | 1464 Isolate* isolate_; |
1475 }; | 1465 }; |
1476 | 1466 |
1477 | 1467 |
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 | |
1489 class CodeTracer V8_FINAL : public Malloced { | 1468 class CodeTracer V8_FINAL : public Malloced { |
1490 public: | 1469 public: |
1491 explicit CodeTracer(int isolate_id) | 1470 explicit CodeTracer(int isolate_id) |
1492 : file_(NULL), | 1471 : file_(NULL), |
1493 scope_depth_(0) { | 1472 scope_depth_(0) { |
1494 if (!ShouldRedirect()) { | 1473 if (!ShouldRedirect()) { |
1495 file_ = stdout; | 1474 file_ = stdout; |
1496 return; | 1475 return; |
1497 } | 1476 } |
1498 | 1477 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1550 } | 1529 } |
1551 | 1530 |
1552 EmbeddedVector<char, 128> filename_; | 1531 EmbeddedVector<char, 128> filename_; |
1553 FILE* file_; | 1532 FILE* file_; |
1554 int scope_depth_; | 1533 int scope_depth_; |
1555 }; | 1534 }; |
1556 | 1535 |
1557 } } // namespace v8::internal | 1536 } } // namespace v8::internal |
1558 | 1537 |
1559 #endif // V8_ISOLATE_H_ | 1538 #endif // V8_ISOLATE_H_ |
OLD | NEW |