Commit acbcc283 authored by mjs@apple.com's avatar mjs@apple.com

2010-01-04 Maciej Stachowiak <mjs@apple.com>

        Reviewed by Darin Fisher.

        Reorganize, document and rename OS() platform macros.
        https://bugs.webkit.org/show_bug.cgi?id=33198

        * wtf/Platform.h: Rename, reorganize and document OS() macros.

        Adapt to name changes. Also fixed a few incorrect OS checks.

        * API/JSContextRef.cpp:
        * assembler/MacroAssemblerARM.cpp:
        (JSC::isVFPPresent):
        * assembler/MacroAssemblerX86Common.h:
        * bytecode/SamplingTool.cpp:
        * config.h:
        * interpreter/RegisterFile.cpp:
        (JSC::RegisterFile::~RegisterFile):
        * interpreter/RegisterFile.h:
        (JSC::RegisterFile::RegisterFile):
        (JSC::RegisterFile::grow):
        * jit/ExecutableAllocator.h:
        * jit/ExecutableAllocatorFixedVMPool.cpp:
        * jit/ExecutableAllocatorPosix.cpp:
        * jit/ExecutableAllocatorSymbian.cpp:
        * jit/ExecutableAllocatorWin.cpp:
        * jit/JITOpcodes.cpp:
        (JSC::JIT::privateCompileCTIMachineTrampolines):
        * jit/JITStubs.cpp:
        * jsc.cpp:
        (main):
        * parser/Grammar.y:
        * profiler/ProfileNode.cpp:
        (JSC::getCount):
        * runtime/Collector.cpp:
        (JSC::Heap::Heap):
        (JSC::Heap::allocateBlock):
        (JSC::Heap::freeBlockPtr):
        (JSC::currentThreadStackBase):
        (JSC::getCurrentPlatformThread):
        (JSC::suspendThread):
        (JSC::resumeThread):
        (JSC::getPlatformThreadRegisters):
        (JSC::otherThreadStackPointer):
        * runtime/Collector.h:
        * runtime/DateConstructor.cpp:
        * runtime/DatePrototype.cpp:
        (JSC::formatLocaleDate):
        * runtime/InitializeThreading.cpp:
        (JSC::initializeThreading):
        * runtime/MarkStack.h:
        (JSC::MarkStack::MarkStackArray::shrinkAllocation):
        * runtime/MarkStackPosix.cpp:
        * runtime/MarkStackSymbian.cpp:
        * runtime/MarkStackWin.cpp:
        * runtime/StringPrototype.cpp:
        (JSC::stringProtoFuncLastIndexOf):
        * runtime/TimeoutChecker.cpp:
        (JSC::getCPUTime):
        * runtime/UString.cpp:
        (JSC::UString::from):
        * wtf/Assertions.cpp:
        * wtf/Assertions.h:
        * wtf/CurrentTime.cpp:
        (WTF::lowResUTCTime):
        * wtf/CurrentTime.h:
        (WTF::getLocalTime):
        * wtf/DateMath.cpp:
        * wtf/FastMalloc.cpp:
        (WTF::TCMalloc_ThreadCache::InitModule):
        (WTF::TCMallocStats::):
        * wtf/FastMalloc.h:
        * wtf/MathExtras.h:
        * wtf/RandomNumber.cpp:
        (WTF::randomNumber):
        * wtf/RandomNumberSeed.h:
        (WTF::initializeRandomNumberGenerator):
        * wtf/StringExtras.h:
        * wtf/TCSpinLock.h:
        (TCMalloc_SpinLock::Unlock):
        (TCMalloc_SlowLock):
        * wtf/TCSystemAlloc.cpp:
        * wtf/ThreadSpecific.h:
        (WTF::::destroy):
        * wtf/Threading.h:
        * wtf/ThreadingPthreads.cpp:
        (WTF::initializeThreading):
        (WTF::isMainThread):
        * wtf/ThreadingWin.cpp:
        (WTF::wtfThreadEntryPoint):
        (WTF::createThreadInternal):
        * wtf/VMTags.h:
        * wtf/unicode/icu/CollatorICU.cpp:
        (WTF::Collator::userDefault):
        * wtf/win/MainThreadWin.cpp:
        (WTF::initializeMainThreadPlatform):
2010-01-04  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin Fisher.

        Reorganize, document and rename OS() platform macros.
        https://bugs.webkit.org/show_bug.cgi?id=33198

        Adapt to name changes.

        * src/ChromiumBridge.cpp:
        * src/EditorClientImpl.cpp:
        (WebKit::EditorClientImpl::isSelectTrailingWhitespaceEnabled):
        (WebKit::):
        (WebKit::EditorClientImpl::handleEditingKeyboardEvent):
        * src/FrameLoaderClientImpl.cpp:
        (WebKit::FrameLoaderClientImpl::createPlugin):
        * src/GraphicsContext3D.cpp:
        (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
        (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal):
        (WebCore::GraphicsContext3DInternal::makeContextCurrent):
        * src/WebFrameImpl.cpp:
        (WebKit::WebFrameImpl::selectionAsText):
        (WebKit::WebFrameImpl::printPage):
        * src/WebPluginContainerImpl.cpp:
        (WebKit::WebPluginContainerImpl::handleMouseEvent):
        (WebKit::WebPluginContainerImpl::handleKeyboardEvent):
        * src/WebViewImpl.cpp:
        (WebKit::WebViewImpl::mouseDown):
        (WebKit::WebViewImpl::mouseContextMenu):
        (WebKit::WebViewImpl::mouseUp):
        (WebKit::WebViewImpl::keyEvent):
        (WebKit::WebViewImpl::sendContextMenuEvent):
        (WebKit::WebViewImpl::setScrollbarColors):
        (WebKit::WebViewImpl::navigationPolicyFromMouseEvent):
2010-01-04  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin Fisher.

        Reorganize, document and rename OS() platform macros.
        https://bugs.webkit.org/show_bug.cgi?id=33198

        Adapt to name changes.

        * webkit/webkitwebsettings.cpp:
        (webkit_get_user_agent):
2010-01-04  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin Fisher.

        Reorganize, document and rename OS() platform macros.
        https://bugs.webkit.org/show_bug.cgi?id=33198

        Adapt to name changes. Also fixed a few incorrect OS checks.

        * accessibility/AccessibilityObject.h:
        * config.h:
        * dom/SelectElement.cpp:
        (WebCore::SelectElement::listBoxDefaultEventHandler):
        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::platform):
        * loader/CachedFont.cpp:
        * loader/FTPDirectoryDocument.cpp:
        * loader/FTPDirectoryParser.cpp:
        * page/EventHandler.cpp:
        * page/Frame.cpp:
        (WebCore::Frame::setUseSecureKeyboardEntry):
        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::platform):
        * page/Page.h:
        * page/Settings.cpp:
        (WebCore::Settings::Settings):
        * page/Settings.h:
        * page/chromium/DragControllerChromium.cpp:
        (WebCore::DragController::isCopyKeyDown):
        * page/chromium/EventHandlerChromium.cpp:
        (WebCore::EventHandler::accessKeyModifiers):
        * page/win/EventHandlerWin.cpp:
        (WebCore::EventHandler::createDraggingClipboard):
        * platform/FileSystem.h:
        * platform/KeyboardCodes.h:
        * platform/PurgeableBuffer.h:
        * platform/chromium/ChromiumBridge.h:
        * platform/chromium/ClipboardChromium.cpp:
        (WebCore::ClipboardChromium::writeRange):
        * platform/chromium/ClipboardUtilitiesChromium.cpp:
        * platform/chromium/ClipboardUtilitiesChromium.h:
        * platform/chromium/PasteboardChromium.cpp:
        (WebCore::Pasteboard::writeSelection):
        (WebCore::Pasteboard::writePlainText):
        (WebCore::Pasteboard::documentFragment):
        * platform/chromium/PlatformKeyboardEventChromium.cpp:
        (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
        (WebCore::PlatformKeyboardEvent::currentCapsLockState):
        * platform/chromium/PopupMenuChromium.cpp:
        (WebCore::PopupListBox::layout):
        (WebCore::PopupMenu::show):
        * platform/graphics/BitmapImage.h:
        (WebCore::BitmapImage::mayFillWithSolidColor):
        * platform/graphics/FloatPoint.h:
        * platform/graphics/FloatRect.h:
        * platform/graphics/FloatSize.h:
        * platform/graphics/FontCache.cpp:
        (WebCore::alternateFamilyName):
        * platform/graphics/FontCache.h:
        * platform/graphics/FontFastPath.cpp:
        (WebCore::Font::glyphDataForCharacter):
        * platform/graphics/GlyphBuffer.h:
        (WebCore::GlyphBuffer::advanceAt):
        (WebCore::GlyphBuffer::add):
        * platform/graphics/Gradient.h:
        * platform/graphics/GraphicsContext.cpp:
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/ImageSource.h:
        * platform/graphics/IntRect.h:
        * platform/graphics/MediaPlayer.cpp:
        * platform/graphics/Path.h:
        * platform/graphics/Pattern.h:
        * platform/graphics/SimpleFontData.h:
        * platform/graphics/cg/ColorCG.cpp:
        * platform/graphics/cg/GraphicsContextCG.cpp:
        * platform/graphics/chromium/FontCustomPlatformData.cpp:
        (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
        (WebCore::FontCustomPlatformData::fontPlatformData):
        (WebCore::createFontCustomPlatformData):
        * platform/graphics/chromium/FontCustomPlatformData.h:
        * platform/graphics/chromium/FontPlatformData.h:
        * platform/graphics/opentype/OpenTypeUtilities.cpp:
        * platform/graphics/opentype/OpenTypeUtilities.h:
        * platform/graphics/qt/GraphicsContextQt.cpp:
        (WebCore::GraphicsContext::getWindowsContext):
        * platform/graphics/qt/ImageQt.cpp:
        * platform/graphics/skia/GraphicsContextSkia.cpp:
        (WebCore::GraphicsContext::clipToImageBuffer):
        * platform/graphics/skia/ImageBufferSkia.cpp:
        (WebCore::ImageBuffer::ImageBuffer):
        * platform/graphics/skia/PlatformContextSkia.cpp:
        (PlatformContextSkia::State::State):
        (PlatformContextSkia::PlatformContextSkia):
        (PlatformContextSkia::save):
        (PlatformContextSkia::restore):
        * platform/graphics/skia/PlatformContextSkia.h:
        * platform/graphics/win/IconWin.cpp:
        (WebCore::Icon::createIconForFiles):
        (WebCore::Icon::paint):
        * platform/graphics/wx/GraphicsContextWx.cpp:
        * platform/gtk/FileSystemGtk.cpp:
        (WebCore::filenameToString):
        (WebCore::filenameFromString):
        (WebCore::filenameForDisplay):
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        * platform/network/curl/ResourceHandleManager.cpp:
        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::):
        * platform/text/String.cpp:
        (WebCore::String::format):
        (WebCore::String::number):
        * platform/text/TextEncoding.cpp:
        (WebCore::TextEncoding::encode):
        * platform/text/TextEncodingRegistry.cpp:
        (WebCore::buildBaseTextCodecMaps):
        (WebCore::extendTextCodecMaps):
        * platform/text/TextStream.cpp:
        * platform/text/TextStream.h:
        * platform/text/qt/TextCodecQt.cpp:
        (WebCore::TextCodecQt::decode):
        * platform/win/PlatformMouseEventWin.cpp:
        (WebCore::messageToEventType):
        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
        * platform/win/PlatformScreenWin.cpp:
        (WebCore::deviceInfoForWidget):
        (WebCore::screenIsMonochrome):
        * platform/win/PopupMenuWin.cpp:
        (WebCore::PopupMenu::show):
        (WebCore::PopupMenu::paint):
        (WebCore::PopupMenu::registerClass):
        (WebCore::PopupMenu::PopupMenuWndProc):
        (WebCore::PopupMenu::wndProc):
        * platform/win/SystemTimeWin.cpp:
        (WebCore::userIdleTime):
        * platform/wx/FileSystemWx.cpp:
        (WebCore::unloadModule):
        * plugins/PluginDatabase.cpp:
        * plugins/PluginPackage.cpp:
        (WebCore::PluginPackage::compareFileVersion):
        * plugins/PluginPackage.h:
        * plugins/PluginView.cpp:
        (WebCore::PluginView::setFrameRect):
        (WebCore::PluginView::stop):
        (WebCore::PluginView::PluginView):
        * plugins/PluginView.h:
        * plugins/win/PluginDatabaseWin.cpp:
        (WebCore::addWindowsMediaPlayerPluginDirectory):
        (WebCore::addMacromediaPluginDirectories):
        * plugins/win/PluginPackageWin.cpp:
        (WebCore::PluginPackage::load):
        * plugins/win/PluginViewWin.cpp:
        (WebCore::registerPluginView):
        (WebCore::PluginView::wndProc):
        (WebCore::PluginView::updatePluginWidget):
        (WebCore::PluginView::paintIntoTransformedContext):
        (WebCore::PluginView::paintWindowedPluginIntoContext):
        (WebCore::PluginView::paint):
        (WebCore::PluginView::handleMouseEvent):
        (WebCore::PluginView::setParent):
        (WebCore::PluginView::setNPWindowRect):
        (WebCore::PluginView::platformStart):
2010-01-04  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin Fisher.

        Reorganize, document and rename OS() platform macros.
        https://bugs.webkit.org/show_bug.cgi?id=33198

        Adapt to name changes.
        
        * DumpRenderTree/DumpRenderTree.h:
        * DumpRenderTree/config.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ff1030ca
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "JSObject.h" #include "JSObject.h"
#include <wtf/Platform.h> #include <wtf/Platform.h>
#if PLATFORM(DARWIN) #if OS(DARWIN)
#include <mach-o/dyld.h> #include <mach-o/dyld.h>
static const int32_t webkitFirstVersionWithConcurrentGlobalContexts = 0x2100500; // 528.5.0 static const int32_t webkitFirstVersionWithConcurrentGlobalContexts = 0x2100500; // 528.5.0
...@@ -63,7 +63,7 @@ void JSContextGroupRelease(JSContextGroupRef group) ...@@ -63,7 +63,7 @@ void JSContextGroupRelease(JSContextGroupRef group)
JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass) JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass)
{ {
initializeThreading(); initializeThreading();
#if PLATFORM(DARWIN) #if OS(DARWIN)
// When running on Tiger or Leopard, or if the application was linked before JSGlobalContextCreate was changed // When running on Tiger or Leopard, or if the application was linked before JSGlobalContextCreate was changed
// to use a unique JSGlobalData, we use a shared one for compatibility. // to use a unique JSGlobalData, we use a shared one for compatibility.
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
...@@ -74,7 +74,7 @@ JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass) ...@@ -74,7 +74,7 @@ JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass)
JSLock lock(LockForReal); JSLock lock(LockForReal);
return JSGlobalContextCreateInGroup(toRef(&JSGlobalData::sharedInstance()), globalObjectClass); return JSGlobalContextCreateInGroup(toRef(&JSGlobalData::sharedInstance()), globalObjectClass);
} }
#endif // PLATFORM(DARWIN) #endif // OS(DARWIN)
return JSGlobalContextCreateInGroup(0, globalObjectClass); return JSGlobalContextCreateInGroup(0, globalObjectClass);
} }
......
2010-01-04 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin Fisher.
Reorganize, document and rename OS() platform macros.
https://bugs.webkit.org/show_bug.cgi?id=33198
* wtf/Platform.h: Rename, reorganize and document OS() macros.
Adapt to name changes. Also fixed a few incorrect OS checks.
* API/JSContextRef.cpp:
* assembler/MacroAssemblerARM.cpp:
(JSC::isVFPPresent):
* assembler/MacroAssemblerX86Common.h:
* bytecode/SamplingTool.cpp:
* config.h:
* interpreter/RegisterFile.cpp:
(JSC::RegisterFile::~RegisterFile):
* interpreter/RegisterFile.h:
(JSC::RegisterFile::RegisterFile):
(JSC::RegisterFile::grow):
* jit/ExecutableAllocator.h:
* jit/ExecutableAllocatorFixedVMPool.cpp:
* jit/ExecutableAllocatorPosix.cpp:
* jit/ExecutableAllocatorSymbian.cpp:
* jit/ExecutableAllocatorWin.cpp:
* jit/JITOpcodes.cpp:
(JSC::JIT::privateCompileCTIMachineTrampolines):
* jit/JITStubs.cpp:
* jsc.cpp:
(main):
* parser/Grammar.y:
* profiler/ProfileNode.cpp:
(JSC::getCount):
* runtime/Collector.cpp:
(JSC::Heap::Heap):
(JSC::Heap::allocateBlock):
(JSC::Heap::freeBlockPtr):
(JSC::currentThreadStackBase):
(JSC::getCurrentPlatformThread):
(JSC::suspendThread):
(JSC::resumeThread):
(JSC::getPlatformThreadRegisters):
(JSC::otherThreadStackPointer):
* runtime/Collector.h:
* runtime/DateConstructor.cpp:
* runtime/DatePrototype.cpp:
(JSC::formatLocaleDate):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/MarkStack.h:
(JSC::MarkStack::MarkStackArray::shrinkAllocation):
* runtime/MarkStackPosix.cpp:
* runtime/MarkStackSymbian.cpp:
* runtime/MarkStackWin.cpp:
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncLastIndexOf):
* runtime/TimeoutChecker.cpp:
(JSC::getCPUTime):
* runtime/UString.cpp:
(JSC::UString::from):
* wtf/Assertions.cpp:
* wtf/Assertions.h:
* wtf/CurrentTime.cpp:
(WTF::lowResUTCTime):
* wtf/CurrentTime.h:
(WTF::getLocalTime):
* wtf/DateMath.cpp:
* wtf/FastMalloc.cpp:
(WTF::TCMalloc_ThreadCache::InitModule):
(WTF::TCMallocStats::):
* wtf/FastMalloc.h:
* wtf/MathExtras.h:
* wtf/RandomNumber.cpp:
(WTF::randomNumber):
* wtf/RandomNumberSeed.h:
(WTF::initializeRandomNumberGenerator):
* wtf/StringExtras.h:
* wtf/TCSpinLock.h:
(TCMalloc_SpinLock::Unlock):
(TCMalloc_SlowLock):
* wtf/TCSystemAlloc.cpp:
* wtf/ThreadSpecific.h:
(WTF::::destroy):
* wtf/Threading.h:
* wtf/ThreadingPthreads.cpp:
(WTF::initializeThreading):
(WTF::isMainThread):
* wtf/ThreadingWin.cpp:
(WTF::wtfThreadEntryPoint):
(WTF::createThreadInternal):
* wtf/VMTags.h:
* wtf/unicode/icu/CollatorICU.cpp:
(WTF::Collator::userDefault):
* wtf/win/MainThreadWin.cpp:
(WTF::initializeMainThreadPlatform):
2010-01-04 Gustavo Noronha Silva <gns@gnome.org> 2010-01-04 Gustavo Noronha Silva <gns@gnome.org>
Add missing files to the build system - make distcheck build fix. Add missing files to the build system - make distcheck build fix.
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "MacroAssemblerARM.h" #include "MacroAssemblerARM.h"
#if PLATFORM(LINUX) #if OS(LINUX)
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
...@@ -43,7 +43,7 @@ namespace JSC { ...@@ -43,7 +43,7 @@ namespace JSC {
static bool isVFPPresent() static bool isVFPPresent()
{ {
#if PLATFORM(LINUX) #if OS(LINUX)
int fd = open("/proc/self/auxv", O_RDONLY); int fd = open("/proc/self/auxv", O_RDONLY);
if (fd > 0) { if (fd > 0) {
Elf32_auxv_t aux; Elf32_auxv_t aux;
......
...@@ -945,7 +945,7 @@ private: ...@@ -945,7 +945,7 @@ private:
friend class MacroAssemblerX86; friend class MacroAssemblerX86;
#if CPU(X86) #if CPU(X86)
#if PLATFORM(MAC) #if OS(MAC_OS_X)
// All X86 Macs are guaranteed to support at least SSE2, // All X86 Macs are guaranteed to support at least SSE2,
static bool isSSE2Present() static bool isSSE2Present()
...@@ -953,7 +953,7 @@ private: ...@@ -953,7 +953,7 @@ private:
return true; return true;
} }
#else // PLATFORM(MAC) #else // OS(MAC_OS_X)
enum SSE2CheckState { enum SSE2CheckState {
NotCheckedSSE2, NotCheckedSSE2,
...@@ -996,7 +996,7 @@ private: ...@@ -996,7 +996,7 @@ private:
static SSE2CheckState s_sse2CheckState; static SSE2CheckState s_sse2CheckState;
#endif // PLATFORM(MAC) #endif // OS(MAC_OS_X)
#elif !defined(NDEBUG) // CPU(X86) #elif !defined(NDEBUG) // CPU(X86)
// On x86-64 we should never be checking for SSE2 in a non-debug build, // On x86-64 we should never be checking for SSE2 in a non-debug build,
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "Interpreter.h" #include "Interpreter.h"
#include "Opcode.h" #include "Opcode.h"
#if !PLATFORM(WIN_OS) #if !OS(WINDOWS)
#include <unistd.h> #include <unistd.h>
#endif #endif
...@@ -91,7 +91,7 @@ void SamplingFlags::stop() {} ...@@ -91,7 +91,7 @@ void SamplingFlags::stop() {}
uint32_t SamplingFlags::s_flags = 1 << 15; uint32_t SamplingFlags::s_flags = 1 << 15;
#if PLATFORM(WIN_OS) #if OS(WINDOWS)
static void sleepForMicroseconds(unsigned us) static void sleepForMicroseconds(unsigned us)
{ {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <wtf/Platform.h> #include <wtf/Platform.h>
#if PLATFORM(WIN_OS) && !defined(BUILDING_WX__) && !COMPILER(GCC) #if OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
#if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF) #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
#define JS_EXPORTDATA __declspec(dllexport) #define JS_EXPORTDATA __declspec(dllexport)
#else #else
...@@ -35,14 +35,14 @@ ...@@ -35,14 +35,14 @@
#define JS_EXPORTDATA #define JS_EXPORTDATA
#endif #endif
#if PLATFORM(WIN_OS) #if OS(WINDOWS)
// If we don't define these, they get defined in windef.h. // If we don't define these, they get defined in windef.h.
// We want to use std::min and std::max // We want to use std::min and std::max
#define max max #define max max
#define min min #define min min
#if !COMPILER(MSVC7) && !PLATFORM(WINCE) #if !COMPILER(MSVC7) && !OS(WINCE)
// We need to define this before the first #include of stdlib.h or it won't contain rand_s. // We need to define this before the first #include of stdlib.h or it won't contain rand_s.
#ifndef _CRT_RAND_S #ifndef _CRT_RAND_S
#define _CRT_RAND_S #define _CRT_RAND_S
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#endif #endif
#if PLATFORM(FREEBSD) || PLATFORM(OPENBSD) #if OS(FREEBSD) || OS(OPENBSD)
#define HAVE_PTHREAD_NP_H 1 #define HAVE_PTHREAD_NP_H 1
#endif #endif
......
...@@ -36,7 +36,7 @@ RegisterFile::~RegisterFile() ...@@ -36,7 +36,7 @@ RegisterFile::~RegisterFile()
#if HAVE(MMAP) #if HAVE(MMAP)
munmap(m_buffer, ((m_max - m_start) + m_maxGlobals) * sizeof(Register)); munmap(m_buffer, ((m_max - m_start) + m_maxGlobals) * sizeof(Register));
#elif HAVE(VIRTUALALLOC) #elif HAVE(VIRTUALALLOC)
#if PLATFORM(WINCE) #if OS(WINCE)
VirtualFree(m_buffer, DWORD(m_commitEnd) - DWORD(m_buffer), MEM_DECOMMIT); VirtualFree(m_buffer, DWORD(m_commitEnd) - DWORD(m_buffer), MEM_DECOMMIT);
#endif #endif
VirtualFree(m_buffer, 0, MEM_RELEASE); VirtualFree(m_buffer, 0, MEM_RELEASE);
......
...@@ -176,7 +176,7 @@ namespace JSC { ...@@ -176,7 +176,7 @@ namespace JSC {
#if HAVE(MMAP) #if HAVE(MMAP)
m_buffer = static_cast<Register*>(mmap(0, bufferLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, VM_TAG_FOR_REGISTERFILE_MEMORY, 0)); m_buffer = static_cast<Register*>(mmap(0, bufferLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, VM_TAG_FOR_REGISTERFILE_MEMORY, 0));
if (m_buffer == MAP_FAILED) { if (m_buffer == MAP_FAILED) {
#if PLATFORM(WINCE) #if OS(WINCE)
fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); fprintf(stderr, "Could not allocate register file: %d\n", GetLastError());
#else #else
fprintf(stderr, "Could not allocate register file: %d\n", errno); fprintf(stderr, "Could not allocate register file: %d\n", errno);
...@@ -186,7 +186,7 @@ namespace JSC { ...@@ -186,7 +186,7 @@ namespace JSC {
#elif HAVE(VIRTUALALLOC) #elif HAVE(VIRTUALALLOC)
m_buffer = static_cast<Register*>(VirtualAlloc(0, roundUpAllocationSize(bufferLength, commitSize), MEM_RESERVE, PAGE_READWRITE)); m_buffer = static_cast<Register*>(VirtualAlloc(0, roundUpAllocationSize(bufferLength, commitSize), MEM_RESERVE, PAGE_READWRITE));
if (!m_buffer) { if (!m_buffer) {
#if PLATFORM(WINCE) #if OS(WINCE)
fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); fprintf(stderr, "Could not allocate register file: %d\n", GetLastError());
#else #else
fprintf(stderr, "Could not allocate register file: %d\n", errno); fprintf(stderr, "Could not allocate register file: %d\n", errno);
...@@ -196,7 +196,7 @@ namespace JSC { ...@@ -196,7 +196,7 @@ namespace JSC {
size_t committedSize = roundUpAllocationSize(maxGlobals * sizeof(Register), commitSize); size_t committedSize = roundUpAllocationSize(maxGlobals * sizeof(Register), commitSize);
void* commitCheck = VirtualAlloc(m_buffer, committedSize, MEM_COMMIT, PAGE_READWRITE); void* commitCheck = VirtualAlloc(m_buffer, committedSize, MEM_COMMIT, PAGE_READWRITE);
if (commitCheck != m_buffer) { if (commitCheck != m_buffer) {
#if PLATFORM(WINCE) #if OS(WINCE)
fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); fprintf(stderr, "Could not allocate register file: %d\n", GetLastError());
#else #else
fprintf(stderr, "Could not allocate register file: %d\n", errno); fprintf(stderr, "Could not allocate register file: %d\n", errno);
...@@ -242,7 +242,7 @@ namespace JSC { ...@@ -242,7 +242,7 @@ namespace JSC {
if (newEnd > m_commitEnd) { if (newEnd > m_commitEnd) {
size_t size = roundUpAllocationSize(reinterpret_cast<char*>(newEnd) - reinterpret_cast<char*>(m_commitEnd), commitSize); size_t size = roundUpAllocationSize(reinterpret_cast<char*>(newEnd) - reinterpret_cast<char*>(m_commitEnd), commitSize);
if (!VirtualAlloc(m_commitEnd, size, MEM_COMMIT, PAGE_READWRITE)) { if (!VirtualAlloc(m_commitEnd, size, MEM_COMMIT, PAGE_READWRITE)) {
#if PLATFORM(WINCE) #if OS(WINCE)
fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); fprintf(stderr, "Could not allocate register file: %d\n", GetLastError());
#else #else
fprintf(stderr, "Could not allocate register file: %d\n", errno); fprintf(stderr, "Could not allocate register file: %d\n", errno);
......
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
#include <wtf/UnusedParam.h> #include <wtf/UnusedParam.h>
#include <wtf/Vector.h> #include <wtf/Vector.h>
#if PLATFORM(IPHONE) #if OS(IPHONE_OS)
#include <libkern/OSCacheControl.h> #include <libkern/OSCacheControl.h>
#include <sys/mman.h> #include <sys/mman.h>
#endif #endif
#if PLATFORM(SYMBIAN) #if OS(SYMBIAN)
#include <e32std.h> #include <e32std.h>
#endif #endif
...@@ -85,7 +85,7 @@ private: ...@@ -85,7 +85,7 @@ private:
struct Allocation { struct Allocation {
char* pages; char* pages;
size_t size; size_t size;
#if PLATFORM(SYMBIAN) #if OS(SYMBIAN)
RChunk* chunk; RChunk* chunk;
#endif #endif
}; };
...@@ -190,13 +190,13 @@ public: ...@@ -190,13 +190,13 @@ public:
static void cacheFlush(void*, size_t) static void cacheFlush(void*, size_t)
{ {
} }
#elif CPU(ARM_THUMB2) && PLATFORM(IPHONE) #elif CPU(ARM_THUMB2) && OS(IPHONE_OS)
static void cacheFlush(void* code, size_t size) static void cacheFlush(void* code, size_t size)
{ {
sys_dcache_flush(code, size); sys_dcache_flush(code, size);
sys_icache_invalidate(code, size); sys_icache_invalidate(code, size);
} }
#elif CPU(ARM_THUMB2) && PLATFORM(LINUX) #elif CPU(ARM_THUMB2) && OS(LINUX)
static void cacheFlush(void* code, size_t size) static void cacheFlush(void* code, size_t size)
{ {
asm volatile ( asm volatile (
...@@ -212,12 +212,12 @@ public: ...@@ -212,12 +212,12 @@ public:
: "r" (code), "r" (reinterpret_cast<char*>(code) + size) : "r" (code), "r" (reinterpret_cast<char*>(code) + size)
: "r0", "r1", "r2"); : "r0", "r1", "r2");
} }
#elif PLATFORM(SYMBIAN) #elif OS(SYMBIAN)
static void cacheFlush(void* code, size_t size) static void cacheFlush(void* code, size_t size)
{ {
User::IMB_Range(code, static_cast<char*>(code) + size); User::IMB_Range(code, static_cast<char*>(code) + size);
} }
#elif CPU(ARM_TRADITIONAL) && PLATFORM(LINUX) #elif CPU(ARM_TRADITIONAL) && OS(LINUX)
static void cacheFlush(void* code, size_t size) static void cacheFlush(void* code, size_t size)
{ {
asm volatile ( asm volatile (
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <errno.h> #include <errno.h>
#if ENABLE(ASSEMBLER) && PLATFORM(MAC) && CPU(X86_64) #if ENABLE(ASSEMBLER) && OS(DARWIN) && CPU(X86_64)
#include "TCSpinLock.h" #include "TCSpinLock.h"
#include <mach/mach_init.h> #include <mach/mach_init.h>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "ExecutableAllocator.h" #include "ExecutableAllocator.h"
#if ENABLE(ASSEMBLER) && PLATFORM(UNIX) && !PLATFORM(SYMBIAN) #if ENABLE(ASSEMBLER) && OS(UNIX) && !OS(SYMBIAN)
#include <sys/mman.h> #include <sys/mman.h>
#include <unistd.h> #include <unistd.h>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
namespace JSC { namespace JSC {
#if !(PLATFORM(MAC) && CPU(X86_64)) #if !(OS(DARWIN) && CPU(X86_64))
void ExecutableAllocator::intializePageSize() void ExecutableAllocator::intializePageSize()
{ {
...@@ -57,7 +57,7 @@ void ExecutablePool::systemRelease(const ExecutablePool::Allocation& alloc) ...@@ -57,7 +57,7 @@ void ExecutablePool::systemRelease(const ExecutablePool::Allocation& alloc)
ASSERT_UNUSED(result, !result); ASSERT_UNUSED(result, !result);
} }
#endif // !(PLATFORM(MAC) && CPU(X86_64)) #endif // !(OS(DARWIN) && CPU(X86_64))
#if ENABLE(ASSEMBLER_WX_EXCLUSIVE) #if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
void ExecutableAllocator::reprotectRegion(void* start, size_t size, ProtectionSeting setting) void ExecutableAllocator::reprotectRegion(void* start, size_t size, ProtectionSeting setting)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "ExecutableAllocator.h" #include "ExecutableAllocator.h"
#if ENABLE(ASSEMBLER) && PLATFORM(SYMBIAN) #if ENABLE(ASSEMBLER) && OS(SYMBIAN)
#include <e32hal.h> #include <e32hal.h>
#include <e32std.h> #include <e32std.h>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "ExecutableAllocator.h" #include "ExecutableAllocator.h"
#if ENABLE(ASSEMBLER) && PLATFORM(WIN_OS) #if ENABLE(ASSEMBLER) && OS(WINDOWS)
#include "windows.h" #include "windows.h"
......
...@@ -160,7 +160,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable ...@@ -160,7 +160,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
* stack pointer by the right amount after the call. * stack pointer by the right amount after the call.
*/ */
#if COMPILER(MSVC) || PLATFORM(LINUX) #if COMPILER(MSVC) || OS(LINUX)
#if COMPILER(MSVC) #if COMPILER(MSVC)
#pragma pack(push) #pragma pack(push)
#pragma pack(4) #pragma pack(4)
...@@ -223,7 +223,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable ...@@ -223,7 +223,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
storePtr(regT2, Address(stackPointerRegister, OBJECT_OFFSETOF(NativeCallFrameStructure, thisValue) + OBJECT_OFFSETOF(JSValue, u.asBits.payload))); storePtr(regT2, Address(stackPointerRegister, OBJECT_OFFSETOF(NativeCallFrameStructure, thisValue) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
storePtr(regT3, Address(stackPointerRegister, OBJECT_OFFSETOF(NativeCallFrameStructure, thisValue) + OBJECT_OFFSETOF(JSValue, u.asBits.tag))); storePtr(regT3, Address(stackPointerRegister, OBJECT_OFFSETOF(NativeCallFrameStructure, thisValue) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
#if COMPILER(MSVC) || PLATFORM(LINUX) #if COMPILER(MSVC) || OS(LINUX)
// ArgList is passed by reference so is stackPointerRegister + 4 * sizeof(Register) // ArgList is passed by reference so is stackPointerRegister + 4 * sizeof(Register)
addPtr(Imm32(OBJECT_OFFSETOF(NativeCallFrameStructure, result)), stackPointerRegister, X86Registers::ecx); addPtr(Imm32(OBJECT_OFFSETOF(NativeCallFrameStructure, result)), stackPointerRegister, X86Registers::ecx);
...@@ -1648,7 +1648,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable ...@@ -1648,7 +1648,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
* not the rest of the callframe so we need a nice way to ensure we increment the * not the rest of the callframe so we need a nice way to ensure we increment the
* stack pointer by the right amount after the call. * stack pointer by the right amount after the call.
*/ */
#if COMPILER(MSVC) || PLATFORM(LINUX) #if COMPILER(MSVC) || OS(LINUX)
struct NativeCallFrameStructure { struct NativeCallFrameStructure {
// CallFrame* callFrame; // passed in EDX // CallFrame* callFrame; // passed in EDX
JSObject* callee; JSObject* callee;
...@@ -1701,7 +1701,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable ...@@ -1701,7 +1701,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
loadPtr(Address(regT1, -(int)sizeof(Register)), regT1); loadPtr(Address(regT1, -(int)sizeof(Register)), regT1);
storePtr(regT1, Address(stackPointerRegister, OBJECT_OFFSETOF(NativeCallFrameStructure, thisValue))); storePtr(regT1, Address(stackPointerRegister, OBJECT_OFFSETOF(NativeCallFrameStructure, thisValue)));