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 #include "src/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 offset = js_frame->LookupExceptionHandlerInTable(&stack_slots, nullptr); | 1105 offset = js_frame->LookupExceptionHandlerInTable(&stack_slots, nullptr); |
1106 if (offset >= 0) { | 1106 if (offset >= 0) { |
1107 // Compute the stack pointer from the frame pointer. This ensures that | 1107 // Compute the stack pointer from the frame pointer. This ensures that |
1108 // argument slots on the stack are dropped as returning would. | 1108 // argument slots on the stack are dropped as returning would. |
1109 Address return_sp = frame->fp() - | 1109 Address return_sp = frame->fp() - |
1110 StandardFrameConstants::kFixedFrameSizeFromFp - | 1110 StandardFrameConstants::kFixedFrameSizeFromFp - |
1111 stack_slots * kPointerSize; | 1111 stack_slots * kPointerSize; |
1112 | 1112 |
1113 // Gather information from the frame. | 1113 // Gather information from the frame. |
1114 code = frame->LookupCode(); | 1114 code = frame->LookupCode(); |
| 1115 if (code->marked_for_deoptimization()) { |
| 1116 // If the target code is lazy deoptimized, we jump to the original |
| 1117 // return address, but we make a note that we are throwing, so that |
| 1118 // the deoptimizer can do the right thing. |
| 1119 offset = static_cast<int>(frame->pc() - code->entry()); |
| 1120 set_deoptimizer_lazy_throw(true); |
| 1121 } |
1115 handler_sp = return_sp; | 1122 handler_sp = return_sp; |
1116 handler_fp = frame->fp(); | 1123 handler_fp = frame->fp(); |
1117 break; | 1124 break; |
1118 } | 1125 } |
1119 } | 1126 } |
1120 | 1127 |
1121 // For interpreted frame we perform a range lookup in the handler table. | 1128 // For interpreted frame we perform a range lookup in the handler table. |
1122 if (frame->is_interpreted() && catchable_by_js) { | 1129 if (frame->is_interpreted() && catchable_by_js) { |
1123 InterpretedFrame* js_frame = static_cast<InterpretedFrame*>(frame); | 1130 InterpretedFrame* js_frame = static_cast<InterpretedFrame*>(frame); |
1124 int context_reg = 0; // Will contain register index holding context. | 1131 int context_reg = 0; // Will contain register index holding context. |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1748 do { \ | 1755 do { \ |
1749 if (FLAG_trace_isolates) { \ | 1756 if (FLAG_trace_isolates) { \ |
1750 PrintF("Isolate %p (id %d)" #tag "\n", \ | 1757 PrintF("Isolate %p (id %d)" #tag "\n", \ |
1751 reinterpret_cast<void*>(this), id()); \ | 1758 reinterpret_cast<void*>(this), id()); \ |
1752 } \ | 1759 } \ |
1753 } while (false) | 1760 } while (false) |
1754 #else | 1761 #else |
1755 #define TRACE_ISOLATE(tag) | 1762 #define TRACE_ISOLATE(tag) |
1756 #endif | 1763 #endif |
1757 | 1764 |
1758 | |
1759 Isolate::Isolate(bool enable_serializer) | 1765 Isolate::Isolate(bool enable_serializer) |
1760 : embedder_data_(), | 1766 : embedder_data_(), |
1761 entry_stack_(NULL), | 1767 entry_stack_(NULL), |
1762 stack_trace_nesting_level_(0), | 1768 stack_trace_nesting_level_(0), |
1763 incomplete_message_(NULL), | 1769 incomplete_message_(NULL), |
1764 bootstrapper_(NULL), | 1770 bootstrapper_(NULL), |
1765 runtime_profiler_(NULL), | 1771 runtime_profiler_(NULL), |
1766 compilation_cache_(NULL), | 1772 compilation_cache_(NULL), |
1767 counters_(NULL), | 1773 counters_(NULL), |
1768 code_range_(NULL), | 1774 code_range_(NULL), |
1769 logger_(NULL), | 1775 logger_(NULL), |
1770 stats_table_(NULL), | 1776 stats_table_(NULL), |
1771 stub_cache_(NULL), | 1777 stub_cache_(NULL), |
1772 code_aging_helper_(NULL), | 1778 code_aging_helper_(NULL), |
1773 deoptimizer_data_(NULL), | 1779 deoptimizer_data_(NULL), |
| 1780 deoptimizer_lazy_throw_(false), |
1774 materialized_object_store_(NULL), | 1781 materialized_object_store_(NULL), |
1775 capture_stack_trace_for_uncaught_exceptions_(false), | 1782 capture_stack_trace_for_uncaught_exceptions_(false), |
1776 stack_trace_for_uncaught_exceptions_frame_limit_(0), | 1783 stack_trace_for_uncaught_exceptions_frame_limit_(0), |
1777 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview), | 1784 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview), |
1778 memory_allocator_(NULL), | 1785 memory_allocator_(NULL), |
1779 keyed_lookup_cache_(NULL), | 1786 keyed_lookup_cache_(NULL), |
1780 context_slot_cache_(NULL), | 1787 context_slot_cache_(NULL), |
1781 descriptor_lookup_cache_(NULL), | 1788 descriptor_lookup_cache_(NULL), |
1782 handle_scope_implementer_(NULL), | 1789 handle_scope_implementer_(NULL), |
1783 unicode_cache_(NULL), | 1790 unicode_cache_(NULL), |
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2858 // Then check whether this scope intercepts. | 2865 // Then check whether this scope intercepts. |
2859 if ((flag & intercept_mask_)) { | 2866 if ((flag & intercept_mask_)) { |
2860 intercepted_flags_ |= flag; | 2867 intercepted_flags_ |= flag; |
2861 return true; | 2868 return true; |
2862 } | 2869 } |
2863 return false; | 2870 return false; |
2864 } | 2871 } |
2865 | 2872 |
2866 } // namespace internal | 2873 } // namespace internal |
2867 } // namespace v8 | 2874 } // namespace v8 |
OLD | NEW |