Title: [161030] branches/jsCStack/Source/_javascript_Core
- Revision
- 161030
- Author
- [email protected]
- Date
- 2013-12-23 15:42:52 -0800 (Mon, 23 Dec 2013)
Log Message
CStack: Cosmetic: rename JSStack::m_commitEnd to m_commitTop.
https://bugs.webkit.org/show_bug.cgi?id=126186
Not yet reviewed.
In the JSStack constructor, m_commitEnd is initialized to highAddress()
which is the address just above the start of the stack. This is
appropriate because no memory has been committed for the stack yet i.e.
highAddress() - m_commitEnd should equal 0.
When we grow the stack in growSlowCase, we set m_commitEnd to
m_commitEnd - delta, where delta is some even multiple of commitSize
(some units of page size). This means that if there is memory committed,
m_commitEnd would point to an allocatable slot in the stack, not past it.
Hence, m_commitEnd should more appropriately be named m_commitTop.
* interpreter/JSStack.cpp:
(JSC::JSStack::JSStack):
(JSC::JSStack::~JSStack):
(JSC::JSStack::growSlowCase):
(JSC::JSStack::releaseExcessCapacity):
* interpreter/JSStack.h:
* interpreter/JSStackInlines.h:
(JSC::JSStack::shrink):
(JSC::JSStack::installTrapsAfterFrame):
Modified Paths
Diff
Modified: branches/jsCStack/Source/_javascript_Core/ChangeLog (161029 => 161030)
--- branches/jsCStack/Source/_javascript_Core/ChangeLog 2013-12-23 23:28:53 UTC (rev 161029)
+++ branches/jsCStack/Source/_javascript_Core/ChangeLog 2013-12-23 23:42:52 UTC (rev 161030)
@@ -1,5 +1,33 @@
2013-12-23 Mark Lam <[email protected]>
+ CStack: Cosmetic: rename JSStack::m_commitEnd to m_commitTop.
+ https://bugs.webkit.org/show_bug.cgi?id=126186
+
+ Not yet reviewed.
+
+ In the JSStack constructor, m_commitEnd is initialized to highAddress()
+ which is the address just above the start of the stack. This is
+ appropriate because no memory has been committed for the stack yet i.e.
+ highAddress() - m_commitEnd should equal 0.
+
+ When we grow the stack in growSlowCase, we set m_commitEnd to
+ m_commitEnd - delta, where delta is some even multiple of commitSize
+ (some units of page size). This means that if there is memory committed,
+ m_commitEnd would point to an allocatable slot in the stack, not past it.
+ Hence, m_commitEnd should more appropriately be named m_commitTop.
+
+ * interpreter/JSStack.cpp:
+ (JSC::JSStack::JSStack):
+ (JSC::JSStack::~JSStack):
+ (JSC::JSStack::growSlowCase):
+ (JSC::JSStack::releaseExcessCapacity):
+ * interpreter/JSStack.h:
+ * interpreter/JSStackInlines.h:
+ (JSC::JSStack::shrink):
+ (JSC::JSStack::installTrapsAfterFrame):
+
+2013-12-23 Mark Lam <[email protected]>
+
CStack: Cosmetic: rename JSStack::m_useableEnd to m_useableTop.
https://bugs.webkit.org/show_bug.cgi?id=126184.
Modified: branches/jsCStack/Source/_javascript_Core/interpreter/JSStack.cpp (161029 => 161030)
--- branches/jsCStack/Source/_javascript_Core/interpreter/JSStack.cpp 2013-12-23 23:28:53 UTC (rev 161029)
+++ branches/jsCStack/Source/_javascript_Core/interpreter/JSStack.cpp 2013-12-23 23:42:52 UTC (rev 161030)
@@ -58,7 +58,7 @@
m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitSize), OSAllocator::JSVMStackPages);
setStackLimit(highAddress());
- m_commitEnd = highAddress();
+ m_commitTop = highAddress();
m_lastStackTop = baseOfStack();
@@ -72,8 +72,8 @@
JSStack::~JSStack()
{
void* highAddress = reinterpret_cast<void*>(static_cast<char*>(m_reservation.base()) + m_reservation.size());
- m_reservation.decommit(reinterpret_cast<void*>(m_commitEnd), reinterpret_cast<intptr_t>(highAddress) - reinterpret_cast<intptr_t>(m_commitEnd));
- addToCommittedByteCount(-(reinterpret_cast<intptr_t>(highAddress) - reinterpret_cast<intptr_t>(m_commitEnd)));
+ m_reservation.decommit(reinterpret_cast<void*>(m_commitTop), reinterpret_cast<intptr_t>(highAddress) - reinterpret_cast<intptr_t>(m_commitTop));
+ addToCommittedByteCount(-(reinterpret_cast<intptr_t>(highAddress) - reinterpret_cast<intptr_t>(m_commitTop)));
m_reservation.deallocate();
}
@@ -81,7 +81,7 @@
{
// If we have already committed enough memory to satisfy this request,
// just update the end pointer and return.
- if (newEnd >= m_commitEnd) {
+ if (newEnd >= m_commitTop) {
setStackLimit(newEnd);
return true;
}
@@ -89,15 +89,15 @@
// Compute the chunk size of additional memory to commit, and see if we
// have it is still within our budget. If not, we'll fail to grow and
// return false.
- long delta = roundUpAllocationSize(reinterpret_cast<char*>(m_commitEnd) - reinterpret_cast<char*>(newEnd), commitSize);
- if (reinterpret_cast<char*>(m_commitEnd) - delta <= reinterpret_cast<char*>(m_useableTop))
+ long delta = roundUpAllocationSize(reinterpret_cast<char*>(m_commitTop) - reinterpret_cast<char*>(newEnd), commitSize);
+ if (reinterpret_cast<char*>(m_commitTop) - delta <= reinterpret_cast<char*>(m_useableTop))
return false;
// Otherwise, the growth is still within our budget. Go ahead and commit
// it and return true.
- m_reservation.commit(reinterpret_cast<char*>(m_commitEnd) - delta, delta);
+ m_reservation.commit(reinterpret_cast<char*>(m_commitTop) - delta, delta);
addToCommittedByteCount(delta);
- m_commitEnd = reinterpret_cast_ptr<Register*>(reinterpret_cast<char*>(m_commitEnd) - delta);
+ m_commitTop = reinterpret_cast_ptr<Register*>(reinterpret_cast<char*>(m_commitTop) - delta);
setStackLimit(newEnd);
return true;
}
@@ -127,10 +127,10 @@
void JSStack::releaseExcessCapacity()
{
- ptrdiff_t delta = reinterpret_cast<uintptr_t>(highAddress()) - reinterpret_cast<uintptr_t>(m_commitEnd);
- m_reservation.decommit(m_commitEnd, delta);
+ ptrdiff_t delta = reinterpret_cast<uintptr_t>(highAddress()) - reinterpret_cast<uintptr_t>(m_commitTop);
+ m_reservation.decommit(m_commitTop, delta);
addToCommittedByteCount(-delta);
- m_commitEnd = highAddress();
+ m_commitTop = highAddress();
}
void JSStack::initializeThreading()
Modified: branches/jsCStack/Source/_javascript_Core/interpreter/JSStack.h (161029 => 161030)
--- branches/jsCStack/Source/_javascript_Core/interpreter/JSStack.h 2013-12-23 23:28:53 UTC (rev 161029)
+++ branches/jsCStack/Source/_javascript_Core/interpreter/JSStack.h 2013-12-23 23:42:52 UTC (rev 161030)
@@ -176,7 +176,7 @@
CallFrame*& m_topCallFrame;
#if ENABLE(LLINT_C_LOOP)
Register* m_end;
- Register* m_commitEnd;
+ Register* m_commitTop;
Register* m_useableTop;
PageReservation m_reservation;
Register* m_lastStackTop;
Modified: branches/jsCStack/Source/_javascript_Core/interpreter/JSStackInlines.h (161029 => 161030)
--- branches/jsCStack/Source/_javascript_Core/interpreter/JSStackInlines.h 2013-12-23 23:28:53 UTC (rev 161029)
+++ branches/jsCStack/Source/_javascript_Core/interpreter/JSStackInlines.h 2013-12-23 23:42:52 UTC (rev 161030)
@@ -176,7 +176,7 @@
if (newEnd >= m_end)
return;
setStackLimit(newEnd);
- if (m_end == baseOfStack() && (m_commitEnd - baseOfStack()) >= maxExcessCapacity)
+ if (m_end == baseOfStack() && (m_commitTop - baseOfStack()) >= maxExcessCapacity)
releaseExcessCapacity();
}
@@ -285,7 +285,7 @@
const int sizeOfTrap = 64;
int32_t* startOfTrap = reinterpret_cast<int32_t*>(topOfFrame);
int32_t* endOfTrap = startOfTrap - sizeOfTrap;
- int32_t* endOfCommitedMemory = reinterpret_cast<int32_t*>(m_commitEnd);
+ int32_t* endOfCommitedMemory = reinterpret_cast<int32_t*>(m_commitTop);
// Make sure we're not exceeding the amount of available memory to write to:
if (endOfTrap < endOfCommitedMemory)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes