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

Side by Side Diff: src/execution.cc

Issue 201573007: Revert "Remove Failure::OutOfMemory propagation and V8::IgnoreOutOfMemoryException." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 }
138 #ifdef ENABLE_DEBUGGER_SUPPORT 143 #ifdef ENABLE_DEBUGGER_SUPPORT
139 // Reset stepping state when script exits with uncaught exception. 144 // Reset stepping state when script exits with uncaught exception.
140 if (isolate->debugger()->IsDebuggerActive()) { 145 if (isolate->debugger()->IsDebuggerActive()) {
141 isolate->debug()->ClearStepping(); 146 isolate->debug()->ClearStepping();
142 } 147 }
143 #endif // ENABLE_DEBUGGER_SUPPORT 148 #endif // ENABLE_DEBUGGER_SUPPORT
144 return Handle<Object>(); 149 return Handle<Object>();
145 } else { 150 } else {
146 isolate->clear_pending_message(); 151 isolate->clear_pending_message();
147 } 152 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // Get isolate now, because handle might be persistent 218 // Get isolate now, because handle might be persistent
214 // and get destroyed in the next call. 219 // and get destroyed in the next call.
215 Isolate* isolate = func->GetIsolate(); 220 Isolate* isolate = func->GetIsolate();
216 Handle<Object> result = Invoke(false, func, receiver, argc, args, 221 Handle<Object> result = Invoke(false, func, receiver, argc, args,
217 caught_exception); 222 caught_exception);
218 223
219 if (*caught_exception) { 224 if (*caught_exception) {
220 ASSERT(catcher.HasCaught()); 225 ASSERT(catcher.HasCaught());
221 ASSERT(isolate->has_pending_exception()); 226 ASSERT(isolate->has_pending_exception());
222 ASSERT(isolate->external_caught_exception()); 227 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 }
223 if (isolate->pending_exception() == 231 if (isolate->pending_exception() ==
224 isolate->heap()->termination_exception()) { 232 isolate->heap()->termination_exception()) {
225 result = isolate->factory()->termination_exception(); 233 result = isolate->factory()->termination_exception();
226 } else { 234 } else {
227 result = v8::Utils::OpenHandle(*catcher.Exception()); 235 result = v8::Utils::OpenHandle(*catcher.Exception());
228 } 236 }
229 isolate->OptionalRescheduleException(true); 237 isolate->OptionalRescheduleException(true);
230 } 238 }
231 239
232 ASSERT(!isolate->has_pending_exception()); 240 ASSERT(!isolate->has_pending_exception());
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 ASSERT(isolate->concurrent_recompilation_enabled()); 1056 ASSERT(isolate->concurrent_recompilation_enabled());
1049 stack_guard->Continue(INSTALL_CODE); 1057 stack_guard->Continue(INSTALL_CODE);
1050 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); 1058 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions();
1051 } 1059 }
1052 isolate->runtime_profiler()->OptimizeNow(); 1060 isolate->runtime_profiler()->OptimizeNow();
1053 return isolate->heap()->undefined_value(); 1061 return isolate->heap()->undefined_value();
1054 } 1062 }
1055 1063
1056 1064
1057 } } // namespace v8::internal 1065 } } // 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