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

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: Fixed bounds 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
« no previous file with comments | « src/isolate.h ('k') | src/objects.cc » ('j') | 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 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 - 1, trace->length());
546 String::WriteToFlat(*trace, buffer, 0, length);
547 buffer[length] = '\0';
548 OS::PrintError("Stacktrace (%x-%x) %p %p: %s\n",
549 magic, magic2,
550 static_cast<void*>(object), static_cast<void*>(map),
551 buffer);
552 OS::Abort();
553 }
554
555
538 void Isolate::CaptureAndSetCurrentStackTraceFor(Handle<JSObject> error_object) { 556 void Isolate::CaptureAndSetCurrentStackTraceFor(Handle<JSObject> error_object) {
539 if (capture_stack_trace_for_uncaught_exceptions_) { 557 if (capture_stack_trace_for_uncaught_exceptions_) {
540 // Capture stack trace for a detailed exception message. 558 // Capture stack trace for a detailed exception message.
541 Handle<String> key = factory()->hidden_stack_trace_symbol(); 559 Handle<String> key = factory()->hidden_stack_trace_symbol();
542 Handle<JSArray> stack_trace = CaptureCurrentStackTrace( 560 Handle<JSArray> stack_trace = CaptureCurrentStackTrace(
543 stack_trace_for_uncaught_exceptions_frame_limit_, 561 stack_trace_for_uncaught_exceptions_frame_limit_,
544 stack_trace_for_uncaught_exceptions_options_); 562 stack_trace_for_uncaught_exceptions_options_);
545 JSObject::SetHiddenProperty(error_object, key, stack_trace); 563 JSObject::SetHiddenProperty(error_object, key, stack_trace);
546 } 564 }
547 } 565 }
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 2058
2041 #ifdef DEBUG 2059 #ifdef DEBUG
2042 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2060 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2043 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2061 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2044 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2062 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2045 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2063 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2046 #undef ISOLATE_FIELD_OFFSET 2064 #undef ISOLATE_FIELD_OFFSET
2047 #endif 2065 #endif
2048 2066
2049 } } // namespace v8::internal 2067 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698