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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 static bool initialized = false; | 120 static bool initialized = false; |
121 if (initialized) | 121 if (initialized) |
122 return; | 122 return; |
123 initialized = true; | 123 initialized = true; |
124 | 124 |
125 initializeV8Common(); | 125 initializeV8Common(); |
126 | 126 |
127 v8::V8::SetFatalErrorHandler(reportFatalErrorInMainThread); | 127 v8::V8::SetFatalErrorHandler(reportFatalErrorInMainThread); |
128 v8::V8::AddMessageListener(messageHandlerInMainThread); | 128 v8::V8::AddMessageListener(messageHandlerInMainThread); |
129 v8::V8::SetFailedAccessCheckCallbackFunction(failedAccessCheckCallbackInMain
Thread); | 129 v8::V8::SetFailedAccessCheckCallbackFunction(failedAccessCheckCallbackInMain
Thread); |
130 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
131 ScriptProfiler::initialize(); | 130 ScriptProfiler::initialize(); |
132 #endif | |
133 V8PerIsolateData::ensureInitialized(isolate); | 131 V8PerIsolateData::ensureInitialized(isolate); |
134 } | 132 } |
135 | 133 |
136 static void reportFatalErrorInWorker(const char* location, const char* message) | 134 static void reportFatalErrorInWorker(const char* location, const char* message) |
137 { | 135 { |
138 // FIXME: We temporarily deal with V8 internal error situations such as out-
of-memory by crashing the worker. | 136 // FIXME: We temporarily deal with V8 internal error situations such as out-
of-memory by crashing the worker. |
139 CRASH(); | 137 CRASH(); |
140 } | 138 } |
141 | 139 |
142 static void messageHandlerInWorker(v8::Handle<v8::Message> message, v8::Handle<v
8::Value> data) | 140 static void messageHandlerInWorker(v8::Handle<v8::Message> message, v8::Handle<v
8::Value> data) |
(...skipping 27 matching lines...) Expand all Loading... |
170 | 168 |
171 v8::ResourceConstraints resourceConstraints; | 169 v8::ResourceConstraints resourceConstraints; |
172 uint32_t here; | 170 uint32_t here; |
173 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); | 171 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); |
174 v8::SetResourceConstraints(&resourceConstraints); | 172 v8::SetResourceConstraints(&resourceConstraints); |
175 | 173 |
176 V8PerIsolateData::ensureInitialized(isolate); | 174 V8PerIsolateData::ensureInitialized(isolate); |
177 } | 175 } |
178 | 176 |
179 } // namespace WebCore | 177 } // namespace WebCore |
OLD | NEW |