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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 thread_local_top()->pending_message_end_pos_ = location->end_pos(); | 1124 thread_local_top()->pending_message_end_pos_ = location->end_pos(); |
1125 } | 1125 } |
1126 } else if (location != NULL && !location->script().is_null()) { | 1126 } else if (location != NULL && !location->script().is_null()) { |
1127 // We are bootstrapping and caught an error where the location is set | 1127 // We are bootstrapping and caught an error where the location is set |
1128 // and we have a script for the location. | 1128 // and we have a script for the location. |
1129 // In this case we could have an extension (or an internal error | 1129 // In this case we could have an extension (or an internal error |
1130 // somewhere) and we print out the line number at which the error occured | 1130 // somewhere) and we print out the line number at which the error occured |
1131 // to the console for easier debugging. | 1131 // to the console for easier debugging. |
1132 int line_number = GetScriptLineNumberSafe(location->script(), | 1132 int line_number = GetScriptLineNumberSafe(location->script(), |
1133 location->start_pos()); | 1133 location->start_pos()); |
1134 OS::PrintError("Extension or internal compilation error at line %d.\n", | 1134 if (exception->IsString()) { |
1135 line_number); | 1135 OS::PrintError( |
| 1136 "Extension or internal compilation error: %s in %s at line %d.\n", |
| 1137 *String::cast(exception)->ToCString(), |
| 1138 *String::cast(location->script()->name())->ToCString(), |
| 1139 line_number); |
| 1140 } else { |
| 1141 OS::PrintError( |
| 1142 "Extension or internal compilation error in %s at line %d.\n", |
| 1143 *String::cast(location->script()->name())->ToCString(), |
| 1144 line_number); |
| 1145 } |
1136 } | 1146 } |
1137 } | 1147 } |
1138 | 1148 |
1139 // Save the message for reporting if the the exception remains uncaught. | 1149 // Save the message for reporting if the the exception remains uncaught. |
1140 thread_local_top()->has_pending_message_ = report_exception; | 1150 thread_local_top()->has_pending_message_ = report_exception; |
1141 | 1151 |
1142 // Do not forget to clean catcher_ if currently thrown exception cannot | 1152 // Do not forget to clean catcher_ if currently thrown exception cannot |
1143 // be caught. If necessary, ReThrow will update the catcher. | 1153 // be caught. If necessary, ReThrow will update the catcher. |
1144 thread_local_top()->catcher_ = can_be_caught_externally ? | 1154 thread_local_top()->catcher_ = can_be_caught_externally ? |
1145 try_catch_handler() : NULL; | 1155 try_catch_handler() : NULL; |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1951 | 1961 |
1952 #ifdef DEBUG | 1962 #ifdef DEBUG |
1953 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 1963 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
1954 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 1964 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
1955 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 1965 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
1956 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 1966 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
1957 #undef ISOLATE_FIELD_OFFSET | 1967 #undef ISOLATE_FIELD_OFFSET |
1958 #endif | 1968 #endif |
1959 | 1969 |
1960 } } // namespace v8::internal | 1970 } } // namespace v8::internal |
OLD | NEW |