OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); | 391 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); |
392 | 392 |
393 // If we don't do this then we end up with a stray root pointing at the | 393 // If we don't do this then we end up with a stray root pointing at the |
394 // context even after we have disposed of the context. | 394 // context even after we have disposed of the context. |
395 internal_isolate->heap()->CollectAllAvailableGarbage("mksnapshot"); | 395 internal_isolate->heap()->CollectAllAvailableGarbage("mksnapshot"); |
396 | 396 |
397 // GC may have cleared weak cells, so compact any WeakFixedArrays | 397 // GC may have cleared weak cells, so compact any WeakFixedArrays |
398 // found on the heap. | 398 // found on the heap. |
399 i::HeapIterator iterator(internal_isolate->heap(), | 399 i::HeapIterator iterator(internal_isolate->heap(), |
400 i::HeapIterator::kFilterUnreachable); | 400 i::HeapObjectsFiltering::kFilterUnreachable); |
401 for (i::HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) { | 401 for (i::HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) { |
402 if (o->IsPrototypeInfo()) { | 402 if (o->IsPrototypeInfo()) { |
403 i::Object* prototype_users = i::PrototypeInfo::cast(o)->prototype_users(); | 403 i::Object* prototype_users = i::PrototypeInfo::cast(o)->prototype_users(); |
404 if (prototype_users->IsWeakFixedArray()) { | 404 if (prototype_users->IsWeakFixedArray()) { |
405 i::WeakFixedArray* array = i::WeakFixedArray::cast(prototype_users); | 405 i::WeakFixedArray* array = i::WeakFixedArray::cast(prototype_users); |
406 array->Compact<i::JSObject::PrototypeRegistryCompactionCallback>(); | 406 array->Compact<i::JSObject::PrototypeRegistryCompactionCallback>(); |
407 } | 407 } |
408 } else if (o->IsScript()) { | 408 } else if (o->IsScript()) { |
409 i::Object* shared_list = i::Script::cast(o)->shared_function_infos(); | 409 i::Object* shared_list = i::Script::cast(o)->shared_function_infos(); |
410 if (shared_list->IsWeakFixedArray()) { | 410 if (shared_list->IsWeakFixedArray()) { |
(...skipping 8387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8798 Address callback_address = | 8798 Address callback_address = |
8799 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8799 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8800 VMState<EXTERNAL> state(isolate); | 8800 VMState<EXTERNAL> state(isolate); |
8801 ExternalCallbackScope call_scope(isolate, callback_address); | 8801 ExternalCallbackScope call_scope(isolate, callback_address); |
8802 callback(info); | 8802 callback(info); |
8803 } | 8803 } |
8804 | 8804 |
8805 | 8805 |
8806 } // namespace internal | 8806 } // namespace internal |
8807 } // namespace v8 | 8807 } // namespace v8 |
OLD | NEW |