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 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1065 Handle<JSArray> stack_trace_object; | 1065 Handle<JSArray> stack_trace_object; |
1066 if (report_exception && capture_stack_trace_for_uncaught_exceptions_) { | 1066 if (report_exception && capture_stack_trace_for_uncaught_exceptions_) { |
1067 stack_trace_object = CaptureCurrentStackTrace( | 1067 stack_trace_object = CaptureCurrentStackTrace( |
1068 stack_trace_for_uncaught_exceptions_frame_limit_, | 1068 stack_trace_for_uncaught_exceptions_frame_limit_, |
1069 stack_trace_for_uncaught_exceptions_options_); | 1069 stack_trace_for_uncaught_exceptions_options_); |
1070 } | 1070 } |
1071 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. |
1072 message_obj = MessageHandler::MakeMessageObject("uncaught_exception", | 1072 message_obj = MessageHandler::MakeMessageObject("uncaught_exception", |
1073 location, HandleVector<Object>(&exception_handle, 1), stack_trace, | 1073 location, HandleVector<Object>(&exception_handle, 1), stack_trace, |
1074 stack_trace_object); | 1074 stack_trace_object); |
1075 } else if (location != NULL && !location->script().is_null()) { | |
1076 // We are bootstrapping and caught and error where the location is set | |
Mads Ager (chromium)
2011/10/25 13:41:00
and error -> an error
| |
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); | |
1075 } | 1085 } |
1076 } | 1086 } |
1077 | 1087 |
1078 // Save the message for reporting if the the exception remains uncaught. | 1088 // Save the message for reporting if the the exception remains uncaught. |
1079 thread_local_top()->has_pending_message_ = report_exception; | 1089 thread_local_top()->has_pending_message_ = report_exception; |
1080 if (!message_obj.is_null()) { | 1090 if (!message_obj.is_null()) { |
1081 thread_local_top()->pending_message_obj_ = *message_obj; | 1091 thread_local_top()->pending_message_obj_ = *message_obj; |
1082 if (location != NULL) { | 1092 if (location != NULL) { |
1083 thread_local_top()->pending_message_script_ = *location->script(); | 1093 thread_local_top()->pending_message_script_ = *location->script(); |
1084 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... | |
1890 | 1900 |
1891 #ifdef DEBUG | 1901 #ifdef DEBUG |
1892 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 1902 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
1893 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 1903 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
1894 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 1904 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
1895 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 1905 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
1896 #undef ISOLATE_FIELD_OFFSET | 1906 #undef ISOLATE_FIELD_OFFSET |
1897 #endif | 1907 #endif |
1898 | 1908 |
1899 } } // namespace v8::internal | 1909 } } // namespace v8::internal |
OLD | NEW |