X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..b80e619319b1def83d1e8b4f84042b661be1be7f:/runtime/ArgList.cpp diff --git a/runtime/ArgList.cpp b/runtime/ArgList.cpp index 5ead733..ab2b5d7 100644 --- a/runtime/ArgList.cpp +++ b/runtime/ArgList.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -30,28 +30,23 @@ namespace JSC { void ArgList::getSlice(int startIndex, ArgList& result) const { - ASSERT(!result.m_isReadOnly); - - const_iterator start = min(begin() + startIndex, end()); - result.m_vector.appendRange(start, end()); - result.m_size = result.m_vector.size(); - result.m_buffer = result.m_vector.data(); + if (startIndex <= 0 || static_cast(startIndex) >= m_argCount) { + result = ArgList(m_args, 0); + return; + } + result = ArgList(m_args + startIndex, m_argCount - startIndex); } -void ArgList::markLists(ListSet& markSet) +void MarkedArgumentBuffer::markLists(MarkStack& markStack, ListSet& markSet) { ListSet::iterator end = markSet.end(); for (ListSet::iterator it = markSet.begin(); it != end; ++it) { - ArgList* list = *it; - - iterator end2 = list->end(); - for (iterator it2 = list->begin(); it2 != end2; ++it2) - if (!(*it2).marked()) - (*it2).mark(); + MarkedArgumentBuffer* list = *it; + markStack.appendValues(reinterpret_cast(list->m_buffer), list->m_size); } } -void ArgList::slowAppend(JSValuePtr v) +void MarkedArgumentBuffer::slowAppend(JSValue v) { // As long as our size stays within our Vector's inline // capacity, all our values are allocated on the stack, and