OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "bindings/v8/V8RecursionScope.h" | 32 #include "bindings/v8/V8RecursionScope.h" |
33 | 33 |
34 #include "core/dom/Microtask.h" | 34 #include "core/dom/Microtask.h" |
| 35 #include "core/inspector/InspectorInstrumentation.h" |
| 36 #include "core/inspector/ScriptCallStack.h" |
35 #include "modules/indexeddb/IDBPendingTransactionMonitor.h" | 37 #include "modules/indexeddb/IDBPendingTransactionMonitor.h" |
36 | 38 |
37 namespace WebCore { | 39 namespace WebCore { |
38 | 40 |
39 void V8RecursionScope::didLeaveScriptContext() | 41 void V8RecursionScope::didLeaveScriptContext() |
40 { | 42 { |
41 Microtask::performCheckpoint(); | 43 Microtask::performCheckpoint(); |
42 | 44 |
43 // Indexed DB requires that transactions are created with an internal |activ
e| flag | 45 // Indexed DB requires that transactions are created with an internal |activ
e| flag |
44 // set to true, but the flag becomes false when control returns to the event
loop. | 46 // set to true, but the flag becomes false when control returns to the event
loop. |
45 IDBPendingTransactionMonitor::from(*m_executionContext).deactivateNewTransac
tions(); | 47 IDBPendingTransactionMonitor::from(*m_executionContext).deactivateNewTransac
tions(); |
46 } | 48 } |
47 | 49 |
| 50 void V8RecursionScope::trackStackDepth(V8PerIsolateData* isolateData) |
| 51 { |
| 52 StackTraceTimestampTracker* tracker = isolateData->stackTraceTimestampTracke
r(); |
| 53 // FIXMEDART: implement a more efficient way to measure the current V8 |
| 54 // stack trace depth than calling v8::StackTrace::CurrentStackTrace. |
| 55 // The current implementation will not slow down V8 when the |
| 56 // devtools are closed but could have a significant performance impact |
| 57 // when the devtools are open for code that dispatches a lot of synchronous |
| 58 // messages or relies heavily on Dart-JS interop. |
| 59 tracker->incrementRecursionLevel(InspectorInstrumentation::hasFrontends() &&
tracker->recursionLevel() > 0 ? |
| 60 v8::StackTrace::CurrentStackTrace(m_isolate, ScriptCallStack::maxCallSta
ckSizeToCapture)->GetFrameCount() : 0); |
| 61 } |
| 62 |
48 } // namespace WebCore | 63 } // namespace WebCore |
OLD | NEW |