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

Side by Side Diff: src/execution.cc

Issue 209903003: Reland "Remove Failure::OutOfMemory propagation and V8::IgnoreOutOfMemoryException." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Created 6 years, 9 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/elements.cc ('k') | src/heap.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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 #ifdef VERIFY_HEAP 129 #ifdef VERIFY_HEAP
130 value->Verify(); 130 value->Verify();
131 #endif 131 #endif
132 132
133 // Update the pending exception flag and return the value. 133 // Update the pending exception flag and return the value.
134 *has_pending_exception = value->IsException(); 134 *has_pending_exception = value->IsException();
135 ASSERT(*has_pending_exception == isolate->has_pending_exception()); 135 ASSERT(*has_pending_exception == isolate->has_pending_exception());
136 if (*has_pending_exception) { 136 if (*has_pending_exception) {
137 isolate->ReportPendingMessages(); 137 isolate->ReportPendingMessages();
138 if (isolate->pending_exception()->IsOutOfMemory()) {
139 if (!isolate->ignore_out_of_memory()) {
140 V8::FatalProcessOutOfMemory("JS", true);
141 }
142 }
143 #ifdef ENABLE_DEBUGGER_SUPPORT 138 #ifdef ENABLE_DEBUGGER_SUPPORT
144 // Reset stepping state when script exits with uncaught exception. 139 // Reset stepping state when script exits with uncaught exception.
145 if (isolate->debugger()->IsDebuggerActive()) { 140 if (isolate->debugger()->IsDebuggerActive()) {
146 isolate->debug()->ClearStepping(); 141 isolate->debug()->ClearStepping();
147 } 142 }
148 #endif // ENABLE_DEBUGGER_SUPPORT 143 #endif // ENABLE_DEBUGGER_SUPPORT
149 return Handle<Object>(); 144 return Handle<Object>();
150 } else { 145 } else {
151 isolate->clear_pending_message(); 146 isolate->clear_pending_message();
152 } 147 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // Get isolate now, because handle might be persistent 213 // Get isolate now, because handle might be persistent
219 // and get destroyed in the next call. 214 // and get destroyed in the next call.
220 Isolate* isolate = func->GetIsolate(); 215 Isolate* isolate = func->GetIsolate();
221 Handle<Object> result = Invoke(false, func, receiver, argc, args, 216 Handle<Object> result = Invoke(false, func, receiver, argc, args,
222 caught_exception); 217 caught_exception);
223 218
224 if (*caught_exception) { 219 if (*caught_exception) {
225 ASSERT(catcher.HasCaught()); 220 ASSERT(catcher.HasCaught());
226 ASSERT(isolate->has_pending_exception()); 221 ASSERT(isolate->has_pending_exception());
227 ASSERT(isolate->external_caught_exception()); 222 ASSERT(isolate->external_caught_exception());
228 if (isolate->is_out_of_memory() && !isolate->ignore_out_of_memory()) {
229 V8::FatalProcessOutOfMemory("OOM during Execution::TryCall");
230 }
231 if (isolate->pending_exception() == 223 if (isolate->pending_exception() ==
232 isolate->heap()->termination_exception()) { 224 isolate->heap()->termination_exception()) {
233 result = isolate->factory()->termination_exception(); 225 result = isolate->factory()->termination_exception();
234 } else { 226 } else {
235 result = v8::Utils::OpenHandle(*catcher.Exception()); 227 result = v8::Utils::OpenHandle(*catcher.Exception());
236 } 228 }
237 isolate->OptionalRescheduleException(true); 229 isolate->OptionalRescheduleException(true);
238 } 230 }
239 231
240 ASSERT(!isolate->has_pending_exception()); 232 ASSERT(!isolate->has_pending_exception());
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 ASSERT(isolate->concurrent_recompilation_enabled()); 1048 ASSERT(isolate->concurrent_recompilation_enabled());
1057 stack_guard->Continue(INSTALL_CODE); 1049 stack_guard->Continue(INSTALL_CODE);
1058 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); 1050 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions();
1059 } 1051 }
1060 isolate->runtime_profiler()->OptimizeNow(); 1052 isolate->runtime_profiler()->OptimizeNow();
1061 return isolate->heap()->undefined_value(); 1053 return isolate->heap()->undefined_value();
1062 } 1054 }
1063 1055
1064 1056
1065 } } // namespace v8::internal 1057 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698