diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/dfg/DFGAbstractHeap.h | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGAbstractHeap.h')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGAbstractHeap.h | 106 |
1 files changed, 42 insertions, 64 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractHeap.h b/Source/JavaScriptCore/dfg/DFGAbstractHeap.h index 4dec8fa03..b42b0bbf1 100644 --- a/Source/JavaScriptCore/dfg/DFGAbstractHeap.h +++ b/Source/JavaScriptCore/dfg/DFGAbstractHeap.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2015 Apple Inc. All rights reserved. + * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #ifndef DFGAbstractHeap_h #define DFGAbstractHeap_h +#include <wtf/Platform.h> + #if ENABLE(DFG_JIT) #include "VirtualRegister.h" @@ -34,47 +36,45 @@ namespace JSC { namespace DFG { -// Implements a four-level type hierarchy: +// Implements a three-level type hierarchy: // - World is the supertype of all of the things. -// - Stack with a TOP payload is a direct subtype of World -// - Stack with a non-TOP payload is a direct subtype of Stack with a TOP payload. -// - Heap is a direct subtype of World. -// - SideState is a direct subtype of World. -// - Any other kind with TOP payload is the direct subtype of Heap. -// - Any other kind with non-TOP payload is the direct subtype of the same kind with a TOP payload. +// - Kind with TOP payload is the direct subtype of World. +// - Kind with non-TOP payload is the direct subtype of its corresponding TOP Kind. #define FOR_EACH_ABSTRACT_HEAP_KIND(macro) \ macro(InvalidAbstractHeap) \ macro(World) \ - macro(Stack) \ - macro(Heap) \ + macro(Arguments_numArguments) \ + macro(Arguments_overrideLength) \ + macro(Arguments_registers) \ + macro(Arguments_slowArguments) \ + macro(ArrayBuffer_data) \ + macro(Butterfly_arrayBuffer) \ macro(Butterfly_publicLength) \ macro(Butterfly_vectorLength) \ - macro(GetterSetter_getter) \ - macro(GetterSetter_setter) \ - macro(JSCell_structureID) \ - macro(JSCell_indexingType) \ - macro(JSCell_typeInfoFlags) \ - macro(JSCell_typeInfoType) \ + macro(JSArrayBufferView_length) \ + macro(JSArrayBufferView_mode) \ + macro(JSArrayBufferView_vector) \ + macro(JSCell_structure) \ + macro(JSFunction_executable) \ + macro(JSFunction_scopeChain) \ macro(JSObject_butterfly) \ - macro(JSPropertyNameEnumerator_cachedPropertyNames) \ + macro(JSVariableObject_registers) \ macro(NamedProperties) \ macro(IndexedInt32Properties) \ macro(IndexedDoubleProperties) \ macro(IndexedContiguousProperties) \ - macro(IndexedArrayStorageProperties) \ macro(ArrayStorageProperties) \ - macro(DirectArgumentsProperties) \ - macro(ScopeProperties) \ + macro(Variables) \ macro(TypedArrayProperties) \ - macro(HeapObjectCount) /* Used to reflect the fact that some allocations reveal object identity */\ + macro(GCState) \ + macro(BarrierState) \ macro(RegExpState) \ - macro(MathDotRandomState) \ macro(InternalState) \ macro(Absolute) \ /* Use this for writes only, to indicate that this may fire watchpoints. Usually this is never directly written but instead we test to see if a node clobbers this; it just so happens that you have to write world to clobber it. */\ macro(Watchpoint_fire) \ - /* Use these for reads only, just to indicate that if the world got clobbered, then this operation will not work. */\ + /* Use this for reads only, just to indicate that if the world got clobbered, then this operation will not work. */\ macro(MiscFields) \ /* Use this for writes only, just to indicate that hoisting the node is invalid. This works because we don't hoist anything that has any side effects at all. */\ macro(SideState) @@ -133,11 +133,6 @@ public: return m_value; } - int32_t value32() const - { - return static_cast<int32_t>(value()); - } - bool operator==(const Payload& other) const { return m_isTop == other.m_isTop @@ -192,7 +187,7 @@ public: AbstractHeap(AbstractHeapKind kind, Payload payload) { - ASSERT(kind != InvalidAbstractHeap && kind != World && kind != Heap && kind != SideState); + ASSERT(kind != InvalidAbstractHeap && kind != World); m_value = encode(kind, payload); } @@ -210,49 +205,32 @@ public: return payloadImpl(); } - AbstractHeap supertype() const + bool isDisjoint(const AbstractHeap& other) { ASSERT(kind() != InvalidAbstractHeap); - switch (kind()) { - case World: - return AbstractHeap(); - case Heap: - case SideState: - return World; - default: - if (payload().isTop()) { - if (kind() == Stack) - return World; - return Heap; - } - return AbstractHeap(kind()); - } - } - - bool isStrictSubtypeOf(const AbstractHeap& other) const - { - AbstractHeap current = *this; - while (current.kind() != World) { - current = current.supertype(); - if (current == other) - return true; - } - return false; - } - - bool isSubtypeOf(const AbstractHeap& other) const - { - return *this == other || isStrictSubtypeOf(other); + ASSERT(other.kind() != InvalidAbstractHeap); + if (kind() == World) + return false; + if (other.kind() == World) + return false; + if (kind() != other.kind()) + return true; + return payload().isDisjoint(other.payload()); } - bool overlaps(const AbstractHeap& other) const + bool overlaps(const AbstractHeap& other) { - return *this == other || isStrictSubtypeOf(other) || other.isStrictSubtypeOf(*this); + return !isDisjoint(other); } - bool isDisjoint(const AbstractHeap& other) const + AbstractHeap supertype() const { - return !overlaps(other); + ASSERT(kind() != InvalidAbstractHeap); + if (kind() == World) + return AbstractHeap(); + if (payload().isTop()) + return World; + return AbstractHeap(kind()); } unsigned hash() const |