Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1784)

Unified Diff: Source/wtf/StackBounds.cpp

Issue 13901012: Remove OS(WINCE) as blink and chromium does not support WinCe. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/wtf/StackBounds.cpp
diff --git a/Source/wtf/StackBounds.cpp b/Source/wtf/StackBounds.cpp
index a272ce3de90d7c4c318d36750ff9edace89de32f..806ea2c78642e393fa857d069ec990083c43e949 100644
--- a/Source/wtf/StackBounds.cpp
+++ b/Source/wtf/StackBounds.cpp
@@ -60,7 +60,7 @@ namespace WTF {
// These platforms should now be working correctly:
// DARWIN, QNX, UNIX
// These platforms are not:
-// WINDOWS, SOLARIS, OPENBSD, WINCE
+// WINDOWS, SOLARIS, OPENBSD
//
// FIXME: remove this! - this code unsafely guesses at stack sizes!
#if OS(WINDOWS) || OS(SOLARIS) || OS(OPENBSD)
@@ -153,76 +153,6 @@ void StackBounds::initialize()
m_origin = static_cast<char*>(stackBase) + stackSize;
}
-#elif OS(WINCE)
-
-static bool detectGrowingDownward(void* previousFrame)
-{
- // Find the address of this stack frame by taking the address of a local variable.
- int thisFrame;
- return previousFrame > &thisFrame;
-}
-
-static inline bool isPageWritable(void* page)
-{
- MEMORY_BASIC_INFORMATION memoryInformation;
- DWORD result = VirtualQuery(page, &memoryInformation, sizeof(memoryInformation));
-
- // return false on error, including ptr outside memory
- if (result != sizeof(memoryInformation))
- return false;
-
- DWORD protect = memoryInformation.Protect & ~(PAGE_GUARD | PAGE_NOCACHE);
- return protect == PAGE_READWRITE
- || protect == PAGE_WRITECOPY
- || protect == PAGE_EXECUTE_READWRITE
- || protect == PAGE_EXECUTE_WRITECOPY;
-}
-
-static inline void* getLowerStackBound(char* currentPage, DWORD pageSize)
-{
- while (currentPage > 0) {
- // check for underflow
- if (currentPage >= reinterpret_cast<char*>(pageSize))
- currentPage -= pageSize;
- else
- currentPage = 0;
-
- if (!isPageWritable(currentPage))
- return currentPage + pageSize;
- }
-
- return 0;
-}
-
-static inline void* getUpperStackBound(char* currentPage, DWORD pageSize)
-{
- do {
- // guaranteed to complete because isPageWritable returns false at end of memory
- currentPage += pageSize;
- } while (isPageWritable(currentPage));
-
- return currentPage - pageSize;
-}
-
-void StackBounds::initialize()
-{
- // find the address of this stack frame by taking the address of a local variable
- void* thisFrame = &thisFrame;
- bool isGrowingDownward = detectGrowingDownward(thisFrame);
-
- SYSTEM_INFO systemInfo;
- GetSystemInfo(&systemInfo);
- DWORD pageSize = systemInfo.dwPageSize;
-
- // scan all of memory starting from this frame, and return the last writeable page found
- char* currentPage = reinterpret_cast<char*>(reinterpret_cast<DWORD>(thisFrame) & ~(pageSize - 1));
- void* lowerStackBound = getLowerStackBound(currentPage, pageSize);
- void* upperStackBound = getUpperStackBound(currentPage, pageSize);
-
- m_origin = isGrowingDownward ? upperStackBound : lowerStackBound;
- m_bound = isGrowingDownward ? lowerStackBound : upperStackBound;
-}
-
#elif OS(WINDOWS)
void StackBounds::initialize()

Powered by Google App Engine
This is Rietveld 408576698