Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: src/isolate.cc

Issue 23283011: During bootstrapping, the script's name is not necessarily set. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 OS::Abort(); 1393 OS::Abort();
1394 } 1394 }
1395 } else if (location != NULL && !location->script().is_null()) { 1395 } else if (location != NULL && !location->script().is_null()) {
1396 // We are bootstrapping and caught an error where the location is set 1396 // We are bootstrapping and caught an error where the location is set
1397 // and we have a script for the location. 1397 // and we have a script for the location.
1398 // In this case we could have an extension (or an internal error 1398 // In this case we could have an extension (or an internal error
1399 // somewhere) and we print out the line number at which the error occured 1399 // somewhere) and we print out the line number at which the error occured
1400 // to the console for easier debugging. 1400 // to the console for easier debugging.
1401 int line_number = GetScriptLineNumberSafe(location->script(), 1401 int line_number = GetScriptLineNumberSafe(location->script(),
1402 location->start_pos()); 1402 location->start_pos());
1403 if (exception->IsString()) { 1403 if (exception->IsString() && location->script()->name()->IsString()) {
1404 OS::PrintError( 1404 OS::PrintError(
1405 "Extension or internal compilation error: %s in %s at line %d.\n", 1405 "Extension or internal compilation error: %s in %s at line %d.\n",
1406 *String::cast(exception)->ToCString(), 1406 *String::cast(exception)->ToCString(),
1407 *String::cast(location->script()->name())->ToCString(), 1407 *String::cast(location->script()->name())->ToCString(),
1408 line_number + 1); 1408 line_number + 1);
1409 } else { 1409 } else if (location->script()->name()->IsString()) {
1410 OS::PrintError( 1410 OS::PrintError(
1411 "Extension or internal compilation error in %s at line %d.\n", 1411 "Extension or internal compilation error in %s at line %d.\n",
1412 *String::cast(location->script()->name())->ToCString(), 1412 *String::cast(location->script()->name())->ToCString(),
1413 line_number + 1); 1413 line_number + 1);
1414 } else {
1415 OS::PrintError("Extension or internal compilation error.\n");
1414 } 1416 }
1415 } 1417 }
1416 } 1418 }
1417 1419
1418 // Save the message for reporting if the the exception remains uncaught. 1420 // Save the message for reporting if the the exception remains uncaught.
1419 thread_local_top()->has_pending_message_ = report_exception; 1421 thread_local_top()->has_pending_message_ = report_exception;
1420 1422
1421 // Do not forget to clean catcher_ if currently thrown exception cannot 1423 // Do not forget to clean catcher_ if currently thrown exception cannot
1422 // be caught. If necessary, ReThrow will update the catcher. 1424 // be caught. If necessary, ReThrow will update the catcher.
1423 thread_local_top()->catcher_ = can_be_caught_externally ? 1425 thread_local_top()->catcher_ = can_be_caught_externally ?
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
2525 2527
2526 #ifdef DEBUG 2528 #ifdef DEBUG
2527 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2529 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2528 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2530 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2529 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2531 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2530 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2532 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2531 #undef ISOLATE_FIELD_OFFSET 2533 #undef ISOLATE_FIELD_OFFSET
2532 #endif 2534 #endif
2533 2535
2534 } } // namespace v8::internal 2536 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698