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 6855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6866 return Integer::New(isolate, static_cast<int32_t>(value)); | 6866 return Integer::New(isolate, static_cast<int32_t>(value)); |
6867 } | 6867 } |
6868 ENTER_V8(internal_isolate); | 6868 ENTER_V8(internal_isolate); |
6869 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value); | 6869 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value); |
6870 return Utils::IntegerToLocal(result); | 6870 return Utils::IntegerToLocal(result); |
6871 } | 6871 } |
6872 | 6872 |
6873 | 6873 |
6874 void Isolate::CollectAllGarbage(const char* gc_reason) { | 6874 void Isolate::CollectAllGarbage(const char* gc_reason) { |
6875 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); | 6875 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); |
6876 DCHECK(heap->gc_state() == i::Heap::NOT_IN_GC); | |
Michael Starzinger
2015/08/31 14:42:48
nit: DCHECK_EQ?
Michael Lippautz
2015/08/31 15:00:54
Done.
| |
6876 if (heap->incremental_marking()->IsStopped()) { | 6877 if (heap->incremental_marking()->IsStopped()) { |
6877 if (heap->incremental_marking()->CanBeActivated()) { | 6878 if (heap->incremental_marking()->CanBeActivated()) { |
6878 heap->StartIncrementalMarking( | 6879 heap->StartIncrementalMarking( |
6879 i::Heap::kNoGCFlags, | 6880 i::Heap::kNoGCFlags, |
6880 kGCCallbackFlagSynchronousPhantomCallbackProcessing, gc_reason); | 6881 kGCCallbackFlagSynchronousPhantomCallbackProcessing, gc_reason); |
6881 } else { | 6882 } else { |
6882 heap->CollectAllGarbage( | 6883 heap->CollectAllGarbage( |
6883 i::Heap::kNoGCFlags, gc_reason, | 6884 i::Heap::kNoGCFlags, gc_reason, |
6884 kGCCallbackFlagSynchronousPhantomCallbackProcessing); | 6885 kGCCallbackFlagSynchronousPhantomCallbackProcessing); |
6885 } | 6886 } |
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8408 Address callback_address = | 8409 Address callback_address = |
8409 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8410 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8410 VMState<EXTERNAL> state(isolate); | 8411 VMState<EXTERNAL> state(isolate); |
8411 ExternalCallbackScope call_scope(isolate, callback_address); | 8412 ExternalCallbackScope call_scope(isolate, callback_address); |
8412 callback(info); | 8413 callback(info); |
8413 } | 8414 } |
8414 | 8415 |
8415 | 8416 |
8416 } // namespace internal | 8417 } // namespace internal |
8417 } // namespace v8 | 8418 } // namespace v8 |
OLD | NEW |