diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/jit/JITStubRoutine.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/JavaScriptCore/jit/JITStubRoutine.h')
-rw-r--r-- | Source/JavaScriptCore/jit/JITStubRoutine.h | 48 |
1 files changed, 13 insertions, 35 deletions
diff --git a/Source/JavaScriptCore/jit/JITStubRoutine.h b/Source/JavaScriptCore/jit/JITStubRoutine.h index 020ef6907..2bf37fab4 100644 --- a/Source/JavaScriptCore/jit/JITStubRoutine.h +++ b/Source/JavaScriptCore/jit/JITStubRoutine.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2014 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,17 +23,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef JITStubRoutine_h -#define JITStubRoutine_h - -#include <wtf/Platform.h> +#pragma once #if ENABLE(JIT) #include "ExecutableAllocator.h" #include "MacroAssemblerCodeRef.h" -#include <wtf/RefCounted.h> -#include <wtf/Vector.h> namespace JSC { @@ -61,24 +56,22 @@ public: // Use this if you want to pass a CodePtr to someone who insists on taking // a RefPtr<JITStubRoutine>. - static PassRefPtr<JITStubRoutine> createSelfManagedRoutine( + static Ref<JITStubRoutine> createSelfManagedRoutine( MacroAssemblerCodePtr rawCodePointer) { - return adoptRef(new JITStubRoutine(MacroAssemblerCodeRef::createSelfManagedCodeRef(rawCodePointer))); + return adoptRef(*new JITStubRoutine(MacroAssemblerCodeRef::createSelfManagedCodeRef(rawCodePointer))); } virtual ~JITStubRoutine(); + virtual void aboutToDie() { } // MacroAssemblerCodeRef is copyable, but at the cost of reference // counting churn. Returning a reference is a good way of reducing // the churn. const MacroAssemblerCodeRef& code() const { return m_code; } - static MacroAssemblerCodePtr asCodePtr(PassRefPtr<JITStubRoutine> stubRoutine) + static MacroAssemblerCodePtr asCodePtr(Ref<JITStubRoutine>&& stubRoutine) { - if (!stubRoutine) - return MacroAssemblerCodePtr(); - MacroAssemblerCodePtr result = stubRoutine->code().code(); ASSERT(!!result); return result; @@ -104,29 +97,15 @@ public: static bool canPerformRangeFilter() { -#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED) return true; -#else - return false; -#endif } static uintptr_t filteringStartAddress() { -#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED) return startOfFixedExecutableMemoryPool; -#else - UNREACHABLE_FOR_PLATFORM(); - return 0; -#endif } static size_t filteringExtentSize() { -#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED) return fixedExecutableMemoryPoolSize; -#else - UNREACHABLE_FOR_PLATFORM(); - return 0; -#endif } static bool passesFilter(uintptr_t address) { @@ -141,6 +120,11 @@ public: return true; } + + // Return true if you are still valid after. Return false if you are now invalid. If you return + // false, you will usually not do any clearing because the idea is that you will simply be + // destroyed. + virtual bool visitWeak(VM&); protected: virtual void observeZeroRefCount(); @@ -150,15 +134,9 @@ protected: }; // Helper for the creation of simple stub routines that need no help from the GC. -#define FINALIZE_CODE_FOR_STUB(patchBuffer, dataLogFArguments) \ - (adoptRef(new JITStubRoutine(FINALIZE_CODE((patchBuffer), dataLogFArguments)))) - -#define FINALIZE_CODE_FOR_DFG_STUB(patchBuffer, dataLogFArguments) \ - (adoptRef(new JITStubRoutine(FINALIZE_DFG_CODE((patchBuffer), dataLogFArguments)))) +#define FINALIZE_CODE_FOR_STUB(codeBlock, patchBuffer, dataLogFArguments) \ + (adoptRef(new JITStubRoutine(FINALIZE_CODE_FOR((codeBlock), (patchBuffer), dataLogFArguments)))) } // namespace JSC #endif // ENABLE(JIT) - -#endif // JITStubRoutine_h - |