OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 js_entry_sp_ = NULL; | 91 js_entry_sp_ = NULL; |
92 external_callback_ = NULL; | 92 external_callback_ = NULL; |
93 current_vm_state_ = EXTERNAL; | 93 current_vm_state_ = EXTERNAL; |
94 try_catch_handler_address_ = NULL; | 94 try_catch_handler_address_ = NULL; |
95 context_ = NULL; | 95 context_ = NULL; |
96 thread_id_ = ThreadId::Invalid(); | 96 thread_id_ = ThreadId::Invalid(); |
97 external_caught_exception_ = false; | 97 external_caught_exception_ = false; |
98 failed_access_check_callback_ = NULL; | 98 failed_access_check_callback_ = NULL; |
99 save_context_ = NULL; | 99 save_context_ = NULL; |
100 catcher_ = NULL; | 100 catcher_ = NULL; |
| 101 top_lookup_result_ = NULL; |
101 | 102 |
102 // These members are re-initialized later after deserialization | 103 // These members are re-initialized later after deserialization |
103 // is complete. | 104 // is complete. |
104 pending_exception_ = NULL; | 105 pending_exception_ = NULL; |
105 has_pending_message_ = false; | 106 has_pending_message_ = false; |
106 pending_message_obj_ = NULL; | 107 pending_message_obj_ = NULL; |
107 pending_message_script_ = NULL; | 108 pending_message_script_ = NULL; |
108 scheduled_exception_ = NULL; | 109 scheduled_exception_ = NULL; |
109 } | 110 } |
110 | 111 |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 block != NULL; | 474 block != NULL; |
474 block = TRY_CATCH_FROM_ADDRESS(block->next_)) { | 475 block = TRY_CATCH_FROM_ADDRESS(block->next_)) { |
475 v->VisitPointer(BitCast<Object**>(&(block->exception_))); | 476 v->VisitPointer(BitCast<Object**>(&(block->exception_))); |
476 v->VisitPointer(BitCast<Object**>(&(block->message_))); | 477 v->VisitPointer(BitCast<Object**>(&(block->message_))); |
477 } | 478 } |
478 | 479 |
479 // Iterate over pointers on native execution stack. | 480 // Iterate over pointers on native execution stack. |
480 for (StackFrameIterator it(this, thread); !it.done(); it.Advance()) { | 481 for (StackFrameIterator it(this, thread); !it.done(); it.Advance()) { |
481 it.frame()->Iterate(v); | 482 it.frame()->Iterate(v); |
482 } | 483 } |
| 484 |
| 485 // Iterate pointers in live lookup results. |
| 486 thread->top_lookup_result_->Iterate(v); |
483 } | 487 } |
484 | 488 |
485 | 489 |
486 void Isolate::Iterate(ObjectVisitor* v) { | 490 void Isolate::Iterate(ObjectVisitor* v) { |
487 ThreadLocalTop* current_t = thread_local_top(); | 491 ThreadLocalTop* current_t = thread_local_top(); |
488 Iterate(v, current_t); | 492 Iterate(v, current_t); |
489 } | 493 } |
490 | 494 |
491 | 495 |
492 void Isolate::RegisterTryCatchHandler(v8::TryCatch* that) { | 496 void Isolate::RegisterTryCatchHandler(v8::TryCatch* that) { |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 Handle<JSArray> stack_trace_object; | 1065 Handle<JSArray> stack_trace_object; |
1062 if (report_exception && capture_stack_trace_for_uncaught_exceptions_) { | 1066 if (report_exception && capture_stack_trace_for_uncaught_exceptions_) { |
1063 stack_trace_object = CaptureCurrentStackTrace( | 1067 stack_trace_object = CaptureCurrentStackTrace( |
1064 stack_trace_for_uncaught_exceptions_frame_limit_, | 1068 stack_trace_for_uncaught_exceptions_frame_limit_, |
1065 stack_trace_for_uncaught_exceptions_options_); | 1069 stack_trace_for_uncaught_exceptions_options_); |
1066 } | 1070 } |
1067 ASSERT(is_object); // Can't use the handle unless there's a real object. | 1071 ASSERT(is_object); // Can't use the handle unless there's a real object. |
1068 message_obj = MessageHandler::MakeMessageObject("uncaught_exception", | 1072 message_obj = MessageHandler::MakeMessageObject("uncaught_exception", |
1069 location, HandleVector<Object>(&exception_handle, 1), stack_trace, | 1073 location, HandleVector<Object>(&exception_handle, 1), stack_trace, |
1070 stack_trace_object); | 1074 stack_trace_object); |
| 1075 } else if (location != NULL && !location->script().is_null()) { |
| 1076 // We are bootstrapping and caught an error where the location is set |
| 1077 // and we have a script for the location. |
| 1078 // In this case we could have an extension (or an internal error |
| 1079 // somewhere) and we print out the line number at which the error occured |
| 1080 // to the console for easier debugging. |
| 1081 int line_number = GetScriptLineNumberSafe(location->script(), |
| 1082 location->start_pos()); |
| 1083 OS::PrintError("Extension or internal compilation error at line %d.\n", |
| 1084 line_number); |
1071 } | 1085 } |
1072 } | 1086 } |
1073 | 1087 |
1074 // Save the message for reporting if the the exception remains uncaught. | 1088 // Save the message for reporting if the the exception remains uncaught. |
1075 thread_local_top()->has_pending_message_ = report_exception; | 1089 thread_local_top()->has_pending_message_ = report_exception; |
1076 if (!message_obj.is_null()) { | 1090 if (!message_obj.is_null()) { |
1077 thread_local_top()->pending_message_obj_ = *message_obj; | 1091 thread_local_top()->pending_message_obj_ = *message_obj; |
1078 if (location != NULL) { | 1092 if (location != NULL) { |
1079 thread_local_top()->pending_message_script_ = *location->script(); | 1093 thread_local_top()->pending_message_script_ = *location->script(); |
1080 thread_local_top()->pending_message_start_pos_ = location->start_pos(); | 1094 thread_local_top()->pending_message_start_pos_ = location->start_pos(); |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 | 1900 |
1887 #ifdef DEBUG | 1901 #ifdef DEBUG |
1888 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 1902 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
1889 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 1903 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
1890 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 1904 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
1891 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 1905 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
1892 #undef ISOLATE_FIELD_OFFSET | 1906 #undef ISOLATE_FIELD_OFFSET |
1893 #endif | 1907 #endif |
1894 | 1908 |
1895 } } // namespace v8::internal | 1909 } } // namespace v8::internal |
OLD | NEW |