| 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 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // during the GC prologue. | 121 // during the GC prologue. |
| 122 ASSERT((*reinterpret_cast<v8::Handle<v8::Value>*>(value))->IsObject()); | 122 ASSERT((*reinterpret_cast<v8::Handle<v8::Value>*>(value))->IsObject()); |
| 123 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Object
>*>(value); | 123 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Object
>*>(value); |
| 124 ASSERT(V8DOMWrapper::maybeDOMWrapper(*wrapper)); | 124 ASSERT(V8DOMWrapper::maybeDOMWrapper(*wrapper)); |
| 125 ASSERT(V8Node::HasInstanceInAnyWorld(*wrapper, m_isolate)); | 125 ASSERT(V8Node::HasInstanceInAnyWorld(*wrapper, m_isolate)); |
| 126 Node* node = V8Node::toNative(*wrapper); | 126 Node* node = V8Node::toNative(*wrapper); |
| 127 // A minor DOM GC can handle only node wrappers in the main world. | 127 // A minor DOM GC can handle only node wrappers in the main world. |
| 128 // Note that node->wrapper().IsEmpty() returns true for nodes that | 128 // Note that node->wrapper().IsEmpty() returns true for nodes that |
| 129 // do not have wrappers in the main world. | 129 // do not have wrappers in the main world. |
| 130 if (node->containsWrapper()) { | 130 if (node->containsWrapper()) { |
| 131 WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper); | 131 const WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper); |
| 132 ActiveDOMObject* activeDOMObject = type->toActiveDOMObject(*wrapper)
; | 132 ActiveDOMObject* activeDOMObject = type->toActiveDOMObject(*wrapper)
; |
| 133 if (activeDOMObject && activeDOMObject->hasPendingActivity()) | 133 if (activeDOMObject && activeDOMObject->hasPendingActivity()) |
| 134 return; | 134 return; |
| 135 m_nodesInNewSpace.append(node); | 135 m_nodesInNewSpace.append(node); |
| 136 node->setV8CollectableDuringMinorGC(true); | 136 node->setV8CollectableDuringMinorGC(true); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 void notifyFinished() | 140 void notifyFinished() |
| 141 { | 141 { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 if (classId != v8DOMNodeClassId && classId != v8DOMObjectClassId) | 238 if (classId != v8DOMNodeClassId && classId != v8DOMObjectClassId) |
| 239 return; | 239 return; |
| 240 | 240 |
| 241 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Object
>*>(value); | 241 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Object
>*>(value); |
| 242 | 242 |
| 243 ASSERT(V8DOMWrapper::maybeDOMWrapper(*wrapper)); | 243 ASSERT(V8DOMWrapper::maybeDOMWrapper(*wrapper)); |
| 244 | 244 |
| 245 if (value->IsIndependent()) | 245 if (value->IsIndependent()) |
| 246 return; | 246 return; |
| 247 | 247 |
| 248 WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper); | 248 const WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper); |
| 249 void* object = toNative(*wrapper); | 249 void* object = toNative(*wrapper); |
| 250 | 250 |
| 251 if (V8MessagePort::wrapperTypeInfo.equals(type)) { | 251 if (V8MessagePort::wrapperTypeInfo.equals(type)) { |
| 252 // Mark each port as in-use if it's entangled. For simplicity's sake
, | 252 // Mark each port as in-use if it's entangled. For simplicity's sake
, |
| 253 // we assume all ports are remotely entangled, since the Chromium po
rt | 253 // we assume all ports are remotely entangled, since the Chromium po
rt |
| 254 // implementation can't tell the difference. | 254 // implementation can't tell the difference. |
| 255 MessagePort* port = static_cast<MessagePort*>(object); | 255 MessagePort* port = static_cast<MessagePort*>(object); |
| 256 if (port->isEntangled() || port->hasPendingActivity()) | 256 if (port->isEntangled() || port->hasPendingActivity()) |
| 257 m_isolate->SetObjectGroupId(*value, liveRootId()); | 257 m_isolate->SetObjectGroupId(*value, liveRootId()); |
| 258 } else if (V8MutationObserver::wrapperTypeInfo.equals(type)) { | 258 } else if (V8MutationObserver::wrapperTypeInfo.equals(type)) { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 { | 414 { |
| 415 v8::HandleScope handleScope(isolate); | 415 v8::HandleScope handleScope(isolate); |
| 416 v8::Local<v8::Context> context = v8::Context::New(isolate); | 416 v8::Local<v8::Context> context = v8::Context::New(isolate); |
| 417 if (context.IsEmpty()) | 417 if (context.IsEmpty()) |
| 418 return; | 418 return; |
| 419 v8::Context::Scope contextScope(context); | 419 v8::Context::Scope contextScope(context); |
| 420 V8ScriptRunner::compileAndRunInternalScript(v8String("if (gc) gc();", isolat
e), isolate); | 420 V8ScriptRunner::compileAndRunInternalScript(v8String("if (gc) gc();", isolat
e), isolate); |
| 421 } | 421 } |
| 422 | 422 |
| 423 } // namespace WebCore | 423 } // namespace WebCore |
| OLD | NEW |