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

Side by Side Diff: src/api.cc

Issue 23731004: Make sure the fatal OOM handler never returns. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 if (isolate->heap()->HasBeenSetUp()) { 218 if (isolate->heap()->HasBeenSetUp()) {
219 // BUG(1718): Don't use the take_snapshot since we don't support 219 // BUG(1718): Don't use the take_snapshot since we don't support
220 // HeapIterator here without doing a special GC. 220 // HeapIterator here without doing a special GC.
221 isolate->heap()->RecordStats(&heap_stats, false); 221 isolate->heap()->RecordStats(&heap_stats, false);
222 } 222 }
223 isolate->SignalFatalError(); 223 isolate->SignalFatalError();
224 FatalErrorCallback callback = GetFatalErrorHandler(); 224 FatalErrorCallback callback = GetFatalErrorHandler();
225 const char* message = "Allocation failed - process out of memory"; 225 const char* message = "Allocation failed - process out of memory";
226 callback(location, message); 226 callback(location, message);
227 // If the callback returns, we stop execution. 227 // If the callback returns, we stop execution.
228 UNREACHABLE(); 228 FATAL("API fatal error handler returned after process out of memory");
229 } 229 }
230 230
231 231
232 bool Utils::ReportApiFailure(const char* location, const char* message) { 232 bool Utils::ReportApiFailure(const char* location, const char* message) {
233 FatalErrorCallback callback = GetFatalErrorHandler(); 233 FatalErrorCallback callback = GetFatalErrorHandler();
234 callback(location, message); 234 callback(location, message);
235 i::Isolate* isolate = i::Isolate::Current(); 235 i::Isolate* isolate = i::Isolate::Current();
236 isolate->SignalFatalError(); 236 isolate->SignalFatalError();
237 return false; 237 return false;
238 } 238 }
(...skipping 7627 matching lines...) Expand 10 before | Expand all | Expand 10 after
7866 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7866 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7867 Address callback_address = 7867 Address callback_address =
7868 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7868 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7869 VMState<EXTERNAL> state(isolate); 7869 VMState<EXTERNAL> state(isolate);
7870 ExternalCallbackScope call_scope(isolate, callback_address); 7870 ExternalCallbackScope call_scope(isolate, callback_address);
7871 return callback(info); 7871 return callback(info);
7872 } 7872 }
7873 7873
7874 7874
7875 } } // namespace v8::internal 7875 } } // 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