X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/93a3786624b2768d89bfa27e46598dc64e2fb70a..2656c66b5b30d5597e842a751c7f19ad6c2fe31a:/runtime/ArgList.h diff --git a/runtime/ArgList.h b/runtime/ArgList.h index 84a0cdd..9aafc90 100644 --- a/runtime/ArgList.h +++ b/runtime/ArgList.h @@ -46,7 +46,7 @@ public: MarkedArgumentBuffer() : m_size(0) , m_capacity(inlineCapacity) - , m_buffer(&m_inlineBuffer[m_capacity - 1]) + , m_buffer(m_inlineBuffer) , m_markSet(0) { } @@ -104,14 +104,14 @@ private: EncodedJSValue& slotFor(int item) const { - return m_buffer[-item]; + return m_buffer[item]; } EncodedJSValue* mallocBase() { if (m_capacity == static_cast(inlineCapacity)) return 0; - return &slotFor(m_capacity - 1); + return &slotFor(0); } int m_size; @@ -139,6 +139,7 @@ private: }; class ArgList { + friend class Interpreter; friend class JIT; public: ArgList() @@ -163,7 +164,7 @@ public: { if (i >= m_argCount) return jsUndefined(); - return m_args[-i]; + return m_args[i]; } bool isEmpty() const { return !m_argCount; } @@ -172,6 +173,8 @@ public: JS_EXPORT_PRIVATE void getSlice(int startIndex, ArgList& result) const; private: + JSValue* data() const { return m_args; } + JSValue* m_args; int m_argCount; };