X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/6fe7ccc865dc7d7541b93c5bcaf6368d2c98a174..refs/heads/master:/heap/Local.h?ds=inline diff --git a/heap/Local.h b/heap/Local.h index 5d1f064..14c4dee 100644 --- a/heap/Local.h +++ b/heap/Local.h @@ -27,7 +27,7 @@ #define Local_h #include "Handle.h" -#include "JSGlobalData.h" +#include "VM.h" /* A strongly referenced handle whose lifetime is temporary, limited to a given @@ -44,8 +44,8 @@ template class Local : public Handle { public: typedef typename Handle::ExternalType ExternalType; - Local(JSGlobalData&, ExternalType = ExternalType()); - Local(JSGlobalData&, Handle); + Local(VM&, ExternalType = ExternalType()); + Local(VM&, Handle); Local(const Local&); // Adopting constructor. Used to return a Local to a calling function. Local& operator=(ExternalType); @@ -56,14 +56,14 @@ private: void set(ExternalType); }; -template inline Local::Local(JSGlobalData& globalData, ExternalType value) - : Handle(globalData.heap.handleStack()->push()) +template inline Local::Local(VM& vm, ExternalType value) + : Handle(vm.heap.handleStack()->push()) { set(value); } -template inline Local::Local(JSGlobalData& globalData, Handle other) - : Handle(globalData.heap.handleStack()->push()) +template inline Local::Local(VM& vm, Handle other) + : Handle(vm.heap.handleStack()->push()) { set(other.get()); } @@ -101,8 +101,8 @@ template inline void Local::set(ExternalType externalType) template class LocalStack { typedef typename Handle::ExternalType ExternalType; public: - LocalStack(JSGlobalData& globalData) - : m_globalData(globalData) + LocalStack(VM& vm) + : m_vm(vm) , m_count(0) { } @@ -122,7 +122,7 @@ public: void push(ExternalType value) { if (m_count == m_stack.size()) - m_stack.append(Local(m_globalData, value)); + m_stack.append(Local(m_vm, value)); else m_stack[m_count] = value; m_count++; @@ -132,7 +132,7 @@ public: unsigned size() const { return m_count; } private: - JSGlobalData& m_globalData; + VM& m_vm; Vector, inlineCapacity> m_stack; unsigned m_count; }; @@ -141,7 +141,7 @@ private: namespace WTF { -template struct VectorTraits > : SimpleClassVectorTraits { +template struct VectorTraits> : SimpleClassVectorTraits { static const bool needsDestruction = false; static const bool canInitializeWithMemset = false; static const bool canCompareWithMemcmp = false;