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

Unified Diff: vm/exceptions.cc

Issue 11475012: Return an unhandled exception error on an OOM or other errors while (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | vm/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/exceptions.cc
===================================================================
--- vm/exceptions.cc (revision 15761)
+++ vm/exceptions.cc (working copy)
@@ -33,11 +33,7 @@
const GrowableObjectArray& pc_offset_list) {
StackFrameIterator frames(StackFrameIterator::kDontValidateFrames);
StackFrame* frame = frames.NextFrame();
- if (frame == NULL) {
- // We have no dart invocation frames and hence cannot find a handler
- // to return to.
- return false;
- }
+ ASSERT(frame != NULL); // We expect to find a dart invocation frame.
Function& func = Function::Handle();
Code& code = Code::Handle();
Smi& offset = Smi::Handle();
@@ -162,23 +158,12 @@
func_list,
code_list,
pc_offset_list);
- if (handler_pc == 0) {
- // There are no dart invocation frames on the stack so we do not
- // have a caller to return to.
- ASSERT(!handler_exists);
- if (Isolate::UnhandledExceptionCallback() != NULL) {
- // Notify embedder that an unhandled exception occurred.
- Dart_EnterScope();
- Dart_Handle error_handle = Api::NewHandle(Isolate::Current(),
- incoming_exception.raw());
- (Isolate::UnhandledExceptionCallback())(error_handle);
- Dart_ExitScope();
- } else {
- OS::PrintErr("Exception '%s' thrown:\n", exception.ToCString());
- OS::PrintErr("Shutting down the isolate\n");
- }
- Dart_ShutdownIsolate();
- }
+ // We expect to find a handler_pc, if the exception is unhandled
+ // then we expect to at least have the dart entry frame on the
+ // stack as Exceptions::Throw should happen only after a dart
+ // invocation has been done.
+ ASSERT(handler_pc != 0);
+
// TODO(5411263): At some point we can optimize by figuring out if a
// stack trace is needed based on whether the catch code specifies a
// stack trace object or there is a rethrow in the catch clause.
« no previous file with comments | « no previous file | vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698