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 6848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6859 bool fits_into_int32_t = (value & (1 << 31)) == 0; | 6859 bool fits_into_int32_t = (value & (1 << 31)) == 0; |
6860 if (fits_into_int32_t) { | 6860 if (fits_into_int32_t) { |
6861 return Integer::New(isolate, static_cast<int32_t>(value)); | 6861 return Integer::New(isolate, static_cast<int32_t>(value)); |
6862 } | 6862 } |
6863 ENTER_V8(internal_isolate); | 6863 ENTER_V8(internal_isolate); |
6864 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value); | 6864 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value); |
6865 return Utils::IntegerToLocal(result); | 6865 return Utils::IntegerToLocal(result); |
6866 } | 6866 } |
6867 | 6867 |
6868 | 6868 |
6869 void Isolate::CollectGarbage(const char* gc_reason) { | 6869 void Isolate::CollectAllGarbage(const char* gc_reason) { |
6870 reinterpret_cast<i::Isolate*>(this)->heap()->CollectGarbage(i::NEW_SPACE, | 6870 reinterpret_cast<i::Isolate*>(this)->heap()->CollectAllGarbage( |
6871 gc_reason); | 6871 i::Heap::kNoGCFlags, gc_reason); |
6872 } | 6872 } |
6873 | 6873 |
6874 | 6874 |
6875 HeapProfiler* Isolate::GetHeapProfiler() { | 6875 HeapProfiler* Isolate::GetHeapProfiler() { |
6876 i::HeapProfiler* heap_profiler = | 6876 i::HeapProfiler* heap_profiler = |
6877 reinterpret_cast<i::Isolate*>(this)->heap_profiler(); | 6877 reinterpret_cast<i::Isolate*>(this)->heap_profiler(); |
6878 return reinterpret_cast<HeapProfiler*>(heap_profiler); | 6878 return reinterpret_cast<HeapProfiler*>(heap_profiler); |
6879 } | 6879 } |
6880 | 6880 |
6881 | 6881 |
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8396 Address callback_address = | 8396 Address callback_address = |
8397 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8397 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8398 VMState<EXTERNAL> state(isolate); | 8398 VMState<EXTERNAL> state(isolate); |
8399 ExternalCallbackScope call_scope(isolate, callback_address); | 8399 ExternalCallbackScope call_scope(isolate, callback_address); |
8400 callback(info); | 8400 callback(info); |
8401 } | 8401 } |
8402 | 8402 |
8403 | 8403 |
8404 } // namespace internal | 8404 } // namespace internal |
8405 } // namespace v8 | 8405 } // namespace v8 |
OLD | NEW |