Skip to content

Commit

Permalink
Merge r174142 - CSS JIT: Enable multiple stack references allocation …
Browse files Browse the repository at this point in the history
…by allocateUninitialized

https://bugs.webkit.org/show_bug.cgi?id=135293

Reviewed by Benjamin Poulain.

* cssjit/StackAllocator.h:
(WebCore::StackAllocator::stackTop):
    Add stackTop method to check references are allocated easily.
(WebCore::StackAllocator::allocateUninitialized):

Canonical link: https://commits.webkit.org/154760.94@webkitgtk/2.6
git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@174945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Constellation authored and carlosgcampos committed Oct 21, 2014
1 parent 4383da1 commit 645b8b6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
12 changes: 12 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,15 @@
2014-09-30 Yusuke Suzuki <utatane.tea@gmail.com>

CSS JIT: Enable multiple stack references allocation by allocateUninitialized
https://bugs.webkit.org/show_bug.cgi?id=135293

Reviewed by Benjamin Poulain.

* cssjit/StackAllocator.h:
(WebCore::StackAllocator::stackTop):
Add stackTop method to check references are allocated easily.
(WebCore::StackAllocator::allocateUninitialized):

2014-09-29 Brian J. Burg <burg@cs.washington.edu>

Web Inspector: InspectorValues should use references for out parameters
Expand Down
33 changes: 30 additions & 3 deletions Source/WebCore/cssjit/StackAllocator.h
Expand Up @@ -59,18 +59,45 @@ class StackAllocator {
{
}

StackReference stackTop()
{
return StackReference(m_offsetFromTop + stackUnitInBytes());
}

~StackAllocator()
{
RELEASE_ASSERT(!m_offsetFromTop);
RELEASE_ASSERT(!m_hasFunctionCallPadding);
}

StackReference allocateUninitialized()
{
return allocateUninitialized(1)[0];
}

StackReferenceVector allocateUninitialized(unsigned count)
{
RELEASE_ASSERT(!m_hasFunctionCallPadding);
m_assembler.addPtrNoFlags(JSC::MacroAssembler::TrustedImm32(-stackUnitInBytes()), JSC::MacroAssembler::stackPointerRegister);
m_offsetFromTop += stackUnitInBytes();
return StackReference(m_offsetFromTop);
StackReferenceVector stackReferences;
unsigned oldOffsetFromTop = m_offsetFromTop;
#if CPU(ARM64)
for (unsigned i = 0; i < count - 1; i += 2) {
m_offsetFromTop += stackUnitInBytes();
stackReferences.append(StackReference(m_offsetFromTop - stackUnitInBytes() / 2));
stackReferences.append(StackReference(m_offsetFromTop));
}
if (count % 2) {
m_offsetFromTop += stackUnitInBytes();
stackReferences.append(StackReference(m_offsetFromTop));
}
#else
for (unsigned i = 0; i < count; ++i) {
m_offsetFromTop += stackUnitInBytes();
stackReferences.append(StackReference(m_offsetFromTop));
}
#endif
m_assembler.addPtrNoFlags(JSC::MacroAssembler::TrustedImm32(-(m_offsetFromTop - oldOffsetFromTop)), JSC::MacroAssembler::stackPointerRegister);
return stackReferences;
}

StackReferenceVector push(const Vector<JSC::MacroAssembler::RegisterID>& registerIDs)
Expand Down

0 comments on commit 645b8b6

Please sign in to comment.