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 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 // current frame is the top-level frame. | 1133 // current frame is the top-level frame. |
1134 it.Advance(); | 1134 it.Advance(); |
1135 Handle<Object> is_top_level = it.done() | 1135 Handle<Object> is_top_level = it.done() |
1136 ? factory()->true_value() | 1136 ? factory()->true_value() |
1137 : factory()->false_value(); | 1137 : factory()->false_value(); |
1138 // Generate and print stack trace line. | 1138 // Generate and print stack trace line. |
1139 Handle<String> line = | 1139 Handle<String> line = |
1140 Execution::GetStackTraceLine(recv, fun, pos_obj, is_top_level); | 1140 Execution::GetStackTraceLine(recv, fun, pos_obj, is_top_level); |
1141 if (line->length() > 0) { | 1141 if (line->length() > 0) { |
1142 line->PrintOn(out); | 1142 line->PrintOn(out); |
1143 fprintf(out, "\n"); | 1143 PrintF(out, "\n"); |
1144 } | 1144 } |
1145 } | 1145 } |
1146 } | 1146 } |
1147 | 1147 |
1148 | 1148 |
1149 void Isolate::ComputeLocation(MessageLocation* target) { | 1149 void Isolate::ComputeLocation(MessageLocation* target) { |
1150 *target = MessageLocation(Handle<Script>(heap_.empty_script()), -1, -1); | 1150 *target = MessageLocation(Handle<Script>(heap_.empty_script()), -1, -1); |
1151 StackTraceFrameIterator it(this); | 1151 StackTraceFrameIterator it(this); |
1152 if (!it.done()) { | 1152 if (!it.done()) { |
1153 JavaScriptFrame* frame = it.frame(); | 1153 JavaScriptFrame* frame = it.frame(); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 } | 1299 } |
1300 | 1300 |
1301 // If the abort-on-uncaught-exception flag is specified, abort on any | 1301 // If the abort-on-uncaught-exception flag is specified, abort on any |
1302 // exception not caught by JavaScript, even when an external handler is | 1302 // exception not caught by JavaScript, even when an external handler is |
1303 // present. This flag is intended for use by JavaScript developers, so | 1303 // present. This flag is intended for use by JavaScript developers, so |
1304 // print a user-friendly stack trace (not an internal one). | 1304 // print a user-friendly stack trace (not an internal one). |
1305 if (fatal_exception_depth == 0 && | 1305 if (fatal_exception_depth == 0 && |
1306 FLAG_abort_on_uncaught_exception && | 1306 FLAG_abort_on_uncaught_exception && |
1307 (report_exception || can_be_caught_externally)) { | 1307 (report_exception || can_be_caught_externally)) { |
1308 fatal_exception_depth++; | 1308 fatal_exception_depth++; |
1309 fprintf(stderr, "%s\n\nFROM\n", | 1309 PrintF(stderr, |
1310 *MessageHandler::GetLocalizedMessage(this, message_obj)); | 1310 "%s\n\nFROM\n", |
| 1311 *MessageHandler::GetLocalizedMessage(this, message_obj)); |
1311 PrintCurrentStackTrace(stderr); | 1312 PrintCurrentStackTrace(stderr); |
1312 OS::Abort(); | 1313 OS::Abort(); |
1313 } | 1314 } |
1314 } else if (location != NULL && !location->script().is_null()) { | 1315 } else if (location != NULL && !location->script().is_null()) { |
1315 // We are bootstrapping and caught an error where the location is set | 1316 // We are bootstrapping and caught an error where the location is set |
1316 // and we have a script for the location. | 1317 // and we have a script for the location. |
1317 // In this case we could have an extension (or an internal error | 1318 // In this case we could have an extension (or an internal error |
1318 // somewhere) and we print out the line number at which the error occured | 1319 // somewhere) and we print out the line number at which the error occured |
1319 // to the console for easier debugging. | 1320 // to the console for easier debugging. |
1320 int line_number = GetScriptLineNumberSafe(location->script(), | 1321 int line_number = GetScriptLineNumberSafe(location->script(), |
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2406 | 2407 |
2407 #ifdef DEBUG | 2408 #ifdef DEBUG |
2408 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2409 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2409 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2410 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2410 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2411 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2411 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2412 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2412 #undef ISOLATE_FIELD_OFFSET | 2413 #undef ISOLATE_FIELD_OFFSET |
2413 #endif | 2414 #endif |
2414 | 2415 |
2415 } } // namespace v8::internal | 2416 } } // namespace v8::internal |
OLD | NEW |