OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 } | 152 } |
153 | 153 |
154 static void initializeV8Common(v8::Isolate* isolate) | 154 static void initializeV8Common(v8::Isolate* isolate) |
155 { | 155 { |
156 v8::ResourceConstraints constraints; | 156 v8::ResourceConstraints constraints; |
157 constraints.ConfigureDefaults(static_cast<uint64_t>(blink::Platform::current
()->physicalMemoryMB()) << 20, static_cast<uint32_t>(blink::Platform::current()-
>numberOfProcessors())); | 157 constraints.ConfigureDefaults(static_cast<uint64_t>(blink::Platform::current
()->physicalMemoryMB()) << 20, static_cast<uint32_t>(blink::Platform::current()-
>numberOfProcessors())); |
158 v8::SetResourceConstraints(isolate, &constraints); | 158 v8::SetResourceConstraints(isolate, &constraints); |
159 | 159 |
160 v8::V8::AddGCPrologueCallback(V8GCController::gcPrologue); | 160 v8::V8::AddGCPrologueCallback(V8GCController::gcPrologue); |
161 v8::V8::AddGCEpilogueCallback(V8GCController::gcEpilogue); | 161 v8::V8::AddGCEpilogueCallback(V8GCController::gcEpilogue); |
162 v8::V8::IgnoreOutOfMemoryException(); | |
163 | 162 |
164 v8::Debug::SetLiveEditEnabled(false); | 163 v8::Debug::SetLiveEditEnabled(false); |
165 } | 164 } |
166 | 165 |
167 void V8Initializer::initializeMainThreadIfNeeded(v8::Isolate* isolate) | 166 void V8Initializer::initializeMainThreadIfNeeded(v8::Isolate* isolate) |
168 { | 167 { |
169 ASSERT(isMainThread()); | 168 ASSERT(isMainThread()); |
170 | 169 |
171 static bool initialized = false; | 170 static bool initialized = false; |
172 if (initialized) | 171 if (initialized) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 v8::V8::AddMessageListener(messageHandlerInWorker); | 222 v8::V8::AddMessageListener(messageHandlerInWorker); |
224 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); | 223 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); |
225 | 224 |
226 v8::ResourceConstraints resourceConstraints; | 225 v8::ResourceConstraints resourceConstraints; |
227 uint32_t here; | 226 uint32_t here; |
228 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); | 227 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); |
229 v8::SetResourceConstraints(isolate, &resourceConstraints); | 228 v8::SetResourceConstraints(isolate, &resourceConstraints); |
230 } | 229 } |
231 | 230 |
232 } // namespace WebCore | 231 } // namespace WebCore |
OLD | NEW |