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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 switch (feature) { | 55 switch (feature) { |
56 case v8::Isolate::kUseAsm: | 56 case v8::Isolate::kUseAsm: |
57 UseCounter::count(currentExecutionContext(isolate), UseCounter::UseAsm); | 57 UseCounter::count(currentExecutionContext(isolate), UseCounter::UseAsm); |
58 break; | 58 break; |
59 default: | 59 default: |
60 ASSERT_NOT_REACHED(); | 60 ASSERT_NOT_REACHED(); |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 V8PerIsolateData::V8PerIsolateData() | 64 V8PerIsolateData::V8PerIsolateData() |
65 : m_isolateHolder(adoptPtr(new gin::IsolateHolder())) | 65 : m_destructionPending(false) |
| 66 , m_isolateHolder(adoptPtr(new gin::IsolateHolder())) |
66 , m_stringCache(adoptPtr(new StringCache(isolate()))) | 67 , m_stringCache(adoptPtr(new StringCache(isolate()))) |
67 , m_hiddenValue(adoptPtr(new V8HiddenValue())) | 68 , m_hiddenValue(adoptPtr(new V8HiddenValue())) |
68 , m_constructorMode(ConstructorMode::CreateNewObject) | 69 , m_constructorMode(ConstructorMode::CreateNewObject) |
69 , m_recursionLevel(0) | 70 , m_recursionLevel(0) |
70 , m_isHandlingRecursionLevelError(false) | 71 , m_isHandlingRecursionLevelError(false) |
71 #if ENABLE(ASSERT) | 72 #if ENABLE(ASSERT) |
72 , m_internalScriptRecursionLevel(0) | 73 , m_internalScriptRecursionLevel(0) |
73 #endif | 74 #endif |
74 , m_gcEventData(adoptPtr(new GCEventData())) | 75 , m_gcEventData(adoptPtr(new GCEventData())) |
75 , m_performingMicrotaskCheckpoint(false) | 76 , m_performingMicrotaskCheckpoint(false) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 { | 116 { |
116 if (m_liveRoot.isEmpty()) | 117 if (m_liveRoot.isEmpty()) |
117 m_liveRoot.set(isolate(), v8::Null(isolate())); | 118 m_liveRoot.set(isolate(), v8::Null(isolate())); |
118 return m_liveRoot.getUnsafe(); | 119 return m_liveRoot.getUnsafe(); |
119 } | 120 } |
120 | 121 |
121 void V8PerIsolateData::willBeDestroyed(v8::Isolate* isolate) | 122 void V8PerIsolateData::willBeDestroyed(v8::Isolate* isolate) |
122 { | 123 { |
123 V8PerIsolateData* data = from(isolate); | 124 V8PerIsolateData* data = from(isolate); |
124 | 125 |
| 126 ASSERT(!data->m_destructionPending); |
| 127 data->m_destructionPending = true; |
| 128 |
125 // Clear any data that may have handles into the heap, | 129 // Clear any data that may have handles into the heap, |
126 // prior to calling ThreadState::detach(). | 130 // prior to calling ThreadState::detach(). |
127 data->m_idbPendingTransactionMonitor.clear(); | 131 data->m_idbPendingTransactionMonitor.clear(); |
128 } | 132 } |
129 | 133 |
130 void V8PerIsolateData::destroy(v8::Isolate* isolate) | 134 void V8PerIsolateData::destroy(v8::Isolate* isolate) |
131 { | 135 { |
132 #if ENABLE(ASSERT) | 136 #if ENABLE(ASSERT) |
133 if (blink::Platform::current()->currentThread()) | 137 if (blink::Platform::current()->currentThread()) |
134 isolate->RemoveCallCompletedCallback(&assertV8RecursionScope); | 138 isolate->RemoveCallCompletedCallback(&assertV8RecursionScope); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 } | 245 } |
242 | 246 |
243 IDBPendingTransactionMonitor* V8PerIsolateData::ensureIDBPendingTransactionMonit
or() | 247 IDBPendingTransactionMonitor* V8PerIsolateData::ensureIDBPendingTransactionMonit
or() |
244 { | 248 { |
245 if (!m_idbPendingTransactionMonitor) | 249 if (!m_idbPendingTransactionMonitor) |
246 m_idbPendingTransactionMonitor = adoptPtr(new IDBPendingTransactionMonit
or()); | 250 m_idbPendingTransactionMonitor = adoptPtr(new IDBPendingTransactionMonit
or()); |
247 return m_idbPendingTransactionMonitor.get(); | 251 return m_idbPendingTransactionMonitor.get(); |
248 } | 252 } |
249 | 253 |
250 } // namespace blink | 254 } // namespace blink |
OLD | NEW |