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

Side by Side Diff: src/isolate.cc

Issue 10917086: Push stacktrace and die if the receiver is of unknown type. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: u Created 8 years, 3 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
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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 incomplete_message_->OutputToStdOut(); 528 incomplete_message_->OutputToStdOut();
529 return factory()->empty_symbol(); 529 return factory()->empty_symbol();
530 } else { 530 } else {
531 OS::Abort(); 531 OS::Abort();
532 // Unreachable 532 // Unreachable
533 return factory()->empty_symbol(); 533 return factory()->empty_symbol();
534 } 534 }
535 } 535 }
536 536
537 537
538 void Isolate::PushStackTraceAndDie(unsigned int magic,
539 Object* object,
540 Map* map,
541 unsigned int magic2) {
542 const int kMaxStackTraceSize = 8192;
543 Handle<String> trace = StackTraceString();
544 char buffer[kMaxStackTraceSize];
545 int length = Min(kMaxStackTraceSize, trace->length());
546 String::WriteToFlat(*trace, buffer, 0, length - 1);
Yang 2012/09/05 12:03:48 Not sure if we need to null-terminate the string.
547 OS::PrintError("Stacktrace (%x-%x) %p %p: %s\n",
548 magic, magic2,
549 static_cast<void*>(object), static_cast<void*>(map),
550 buffer);
551 OS::Abort();
552 }
553
554
538 void Isolate::CaptureAndSetCurrentStackTraceFor(Handle<JSObject> error_object) { 555 void Isolate::CaptureAndSetCurrentStackTraceFor(Handle<JSObject> error_object) {
539 if (capture_stack_trace_for_uncaught_exceptions_) { 556 if (capture_stack_trace_for_uncaught_exceptions_) {
540 // Capture stack trace for a detailed exception message. 557 // Capture stack trace for a detailed exception message.
541 Handle<String> key = factory()->hidden_stack_trace_symbol(); 558 Handle<String> key = factory()->hidden_stack_trace_symbol();
542 Handle<JSArray> stack_trace = CaptureCurrentStackTrace( 559 Handle<JSArray> stack_trace = CaptureCurrentStackTrace(
543 stack_trace_for_uncaught_exceptions_frame_limit_, 560 stack_trace_for_uncaught_exceptions_frame_limit_,
544 stack_trace_for_uncaught_exceptions_options_); 561 stack_trace_for_uncaught_exceptions_options_);
545 JSObject::SetHiddenProperty(error_object, key, stack_trace); 562 JSObject::SetHiddenProperty(error_object, key, stack_trace);
546 } 563 }
547 } 564 }
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 2057
2041 #ifdef DEBUG 2058 #ifdef DEBUG
2042 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2059 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2043 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2060 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2044 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2061 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2045 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2062 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2046 #undef ISOLATE_FIELD_OFFSET 2063 #undef ISOLATE_FIELD_OFFSET
2047 #endif 2064 #endif
2048 2065
2049 } } // namespace v8::internal 2066 } } // namespace v8::internal
OLDNEW
« src/isolate.h ('K') | « src/isolate.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698