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 @@
#include "JSObject.h"
#include <wtf/Platform.h>
#if PLATFORM(DARWIN)
#if OS(DARWIN)
#include <mach-o/dyld.h>
static const int32_t webkitFirstVersionWithConcurrentGlobalContexts = 0x2100500; // 528.5.0
......@@ -63,7 +63,7 @@ void JSContextGroupRelease(JSContextGroupRef group)
JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass)
{
initializeThreading();
#if PLATFORM(DARWIN)
#if OS(DARWIN)
// 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.
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
......@@ -74,7 +74,7 @@ JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass)
JSLock lock(LockForReal);
return JSGlobalContextCreateInGroup(toRef(&JSGlobalData::sharedInstance()), globalObjectClass);
}
#endif // PLATFORM(DARWIN)
#endif // OS(DARWIN)
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>
Add missing files to the build system - make distcheck build fix.
......
......@@ -30,7 +30,7 @@
#include "MacroAssemblerARM.h"
#if PLATFORM(LINUX)
#if OS(LINUX)
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
......@@ -43,7 +43,7 @@ namespace JSC {
static bool isVFPPresent()
{
#if PLATFORM(LINUX)
#if OS(LINUX)
int fd = open("/proc/self/auxv", O_RDONLY);
if (fd > 0) {
Elf32_auxv_t aux;
......
......@@ -945,7 +945,7 @@ private:
friend class MacroAssemblerX86;
#if CPU(X86)
#if PLATFORM(MAC)
#if OS(MAC_OS_X)
// All X86 Macs are guaranteed to support at least SSE2,
static bool isSSE2Present()
......@@ -953,7 +953,7 @@ private:
return true;
}
#else // PLATFORM(MAC)
#else // OS(MAC_OS_X)
enum SSE2CheckState {
NotCheckedSSE2,
......@@ -996,7 +996,7 @@ private:
static SSE2CheckState s_sse2CheckState;
#endif // PLATFORM(MAC)
#endif // OS(MAC_OS_X)
#elif !defined(NDEBUG) // CPU(X86)
// On x86-64 we should never be checking for SSE2 in a non-debug build,
......
......@@ -33,7 +33,7 @@
#include "Interpreter.h"
#include "Opcode.h"
#if !PLATFORM(WIN_OS)
#if !OS(WINDOWS)
#include <unistd.h>
#endif
......@@ -91,7 +91,7 @@ void SamplingFlags::stop() {}
uint32_t SamplingFlags::s_flags = 1 << 15;
#if PLATFORM(WIN_OS)
#if OS(WINDOWS)
static void sleepForMicroseconds(unsigned us)
{
......
......@@ -25,7 +25,7 @@
#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)
#define JS_EXPORTDATA __declspec(dllexport)
#else
......@@ -35,14 +35,14 @@
#define JS_EXPORTDATA
#endif
#if PLATFORM(WIN_OS)
#if OS(WINDOWS)
// If we don't define these, they get defined in windef.h.
// We want to use std::min and std::max
#define max max
#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.
#ifndef _CRT_RAND_S
#define _CRT_RAND_S
......@@ -51,7 +51,7 @@
#endif
#if PLATFORM(FREEBSD) || PLATFORM(OPENBSD)
#if OS(FREEBSD) || OS(OPENBSD)
#define HAVE_PTHREAD_NP_H 1
#endif
......
......@@ -36,7 +36,7 @@ RegisterFile::~RegisterFile()
#if HAVE(MMAP)
munmap(m_buffer, ((m_max - m_start) + m_maxGlobals) * sizeof(Register));
#elif HAVE(VIRTUALALLOC)
#if PLATFORM(WINCE)
#if OS(WINCE)
VirtualFree(m_buffer, DWORD(m_commitEnd) - DWORD(m_buffer), MEM_DECOMMIT);
#endif
VirtualFree(m_buffer, 0, MEM_RELEASE);
......
......@@ -176,7 +176,7 @@ namespace JSC {
#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));
if (m_buffer == MAP_FAILED) {
#if PLATFORM(WINCE)
#if OS(WINCE)
fprintf(stderr, "Could not allocate register file: %d\n", GetLastError());
#else
fprintf(stderr, "Could not allocate register file: %d\n", errno);
......@@ -186,7 +186,7 @@ namespace JSC {
#elif HAVE(VIRTUALALLOC)
m_buffer = static_cast<Register*>(VirtualAlloc(0, roundUpAllocationSize(bufferLength, commitSize), MEM_RESERVE, PAGE_READWRITE));
if (!m_buffer) {
#if PLATFORM(WINCE)
#if OS(WINCE)
fprintf(stderr, "Could not allocate register file: %d\n", GetLastError());
#else
fprintf(stderr, "Could not allocate register file: %d\n", errno);
......@@ -196,7 +196,7 @@ namespace JSC {
size_t committedSize = roundUpAllocationSize(maxGlobals * sizeof(Register), commitSize);
void* commitCheck = VirtualAlloc(m_buffer, committedSize, MEM_COMMIT, PAGE_READWRITE);
if (commitCheck != m_buffer) {
#if PLATFORM(WINCE)
#if OS(WINCE)
fprintf(stderr, "Could not allocate register file: %d\n", GetLastError());
#else
fprintf(stderr, "Could not allocate register file: %d\n", errno);
......@@ -242,7 +242,7 @@ namespace JSC {
if (newEnd > m_commitEnd) {
size_t size = roundUpAllocationSize(reinterpret_cast<char*>(newEnd) - reinterpret_cast<char*>(m_commitEnd), commitSize);
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());
#else
fprintf(stderr, "Could not allocate register file: %d\n", errno);
......
......@@ -34,12 +34,12 @@
#include <wtf/UnusedParam.h>
#include <wtf/Vector.h>
#if PLATFORM(IPHONE)
#if OS(IPHONE_OS)
#include <libkern/OSCacheControl.h>
#include <sys/mman.h>
#endif
#if PLATFORM(SYMBIAN)
#if OS(SYMBIAN)
#include <e32std.h>
#endif
......@@ -85,7 +85,7 @@ private:
struct Allocation {
char* pages;
size_t size;
#if PLATFORM(SYMBIAN)
#if OS(SYMBIAN)
RChunk* chunk;
#endif
};
......@@ -190,13 +190,13 @@ public:
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)
{
sys_dcache_flush(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)
{
asm volatile (
......@@ -212,12 +212,12 @@ public:
: "r" (code), "r" (reinterpret_cast<char*>(code) + size)
: "r0", "r1", "r2");
}
#elif PLATFORM(SYMBIAN)
#elif OS(SYMBIAN)
static void cacheFlush(void* code, size_t 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)
{
asm volatile (
......
......@@ -29,7 +29,7 @@
#include <errno.h>
#if ENABLE(ASSEMBLER) && PLATFORM(MAC) && CPU(X86_64)
#if ENABLE(ASSEMBLER) && OS(DARWIN) && CPU(X86_64)
#include "TCSpinLock.h"
#include <mach/mach_init.h>
......
......@@ -27,7 +27,7 @@
#include "ExecutableAllocator.h"
#if ENABLE(ASSEMBLER) && PLATFORM(UNIX) && !PLATFORM(SYMBIAN)
#if ENABLE(ASSEMBLER) && OS(UNIX) && !OS(SYMBIAN)
#include <sys/mman.h>
#include <unistd.h>
......@@ -35,7 +35,7 @@
namespace JSC {
#if !(PLATFORM(MAC) && CPU(X86_64))
#if !(OS(DARWIN) && CPU(X86_64))
void ExecutableAllocator::intializePageSize()
{
......@@ -57,7 +57,7 @@ void ExecutablePool::systemRelease(const ExecutablePool::Allocation& alloc)
ASSERT_UNUSED(result, !result);
}
#endif // !(PLATFORM(MAC) && CPU(X86_64))
#endif // !(OS(DARWIN) && CPU(X86_64))
#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
void ExecutableAllocator::reprotectRegion(void* start, size_t size, ProtectionSeting setting)
......
......@@ -22,7 +22,7 @@
#include "ExecutableAllocator.h"
#if ENABLE(ASSEMBLER) && PLATFORM(SYMBIAN)
#if ENABLE(ASSEMBLER) && OS(SYMBIAN)
#include <e32hal.h>
#include <e32std.h>
......
......@@ -27,7 +27,7 @@
#include "ExecutableAllocator.h"
#if ENABLE(ASSEMBLER) && PLATFORM(WIN_OS)
#if ENABLE(ASSEMBLER) && OS(WINDOWS)
#include "windows.h"
......
......@@ -160,7 +160,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
* stack pointer by the right amount after the call.
*/
#if COMPILER(MSVC) || PLATFORM(LINUX)
#if COMPILER(MSVC) || OS(LINUX)
#if COMPILER(MSVC)
#pragma pack(push)
#pragma pack(4)
......@@ -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(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)
addPtr(Imm32(OBJECT_OFFSETOF(NativeCallFrameStructure, result)), stackPointerRegister, X86Registers::ecx);
......@@ -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
* stack pointer by the right amount after the call.
*/
#if COMPILER(MSVC) || PLATFORM(LINUX)
#if COMPILER(MSVC) || OS(LINUX)
struct NativeCallFrameStructure {
// CallFrame* callFrame; // passed in EDX
JSObject* callee;
......@@ -1701,7 +1701,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
loadPtr(Address(regT1, -(int)sizeof(Register)), regT1);
storePtr(regT1, Address(stackPointerRegister, OBJECT_OFFSETOF(NativeCallFrameStructure, thisValue)));
#if COMPILER(MSVC) || PLATFORM(LINUX)
#if COMPILER(MSVC) || OS(LINUX)
// ArgList is passed by reference so is stackPointerRegister + 4 * sizeof(Register)
addPtr(Imm32(OBJECT_OFFSETOF(NativeCallFrameStructure, result)), stackPointerRegister, X86Registers::ecx);
......
......@@ -64,31 +64,37 @@ using namespace std;
namespace JSC {
#if PLATFORM(DARWIN) || PLATFORM(WIN_OS)
#if OS(DARWIN) || OS(WINDOWS)
#define SYMBOL_STRING(name) "_" #name
#else
#define SYMBOL_STRING(name) #name
#endif
#if PLATFORM(IPHONE)
#if OS(IPHONE_OS)
#define THUMB_FUNC_PARAM(name) SYMBOL_STRING(name)
#else
#define THUMB_FUNC_PARAM(name)
#endif
#if PLATFORM(LINUX) && CPU(X86_64)
#if OS(LINUX) && CPU(X86_64)
#define SYMBOL_STRING_RELOCATION(name) #name "@plt"
#else
#define SYMBOL_STRING_RELOCATION(name) SYMBOL_STRING(name)
#endif
#if PLATFORM(DARWIN)
#if OS(DARWIN)
// Mach-O platform
#define HIDE_SYMBOL(name) ".private_extern _" #name
#elif PLATFORM(AIX)
#elif OS(AIX)
// IBM's own file format
#define HIDE_SYMBOL(name) ".lglobl " #name
#elif PLATFORM(LINUX) || PLATFORM(FREEBSD) || PLATFORM(OPENBSD) || PLATFORM(SOLARIS) || (PLATFORM(HPUX) && CPU(IA64)) || PLATFORM(SYMBIAN) || PLATFORM(NETBSD)
#elif OS(LINUX) \
|| OS(FREEBSD) \
|| OS(OPENBSD) \
|| OS(SOLARIS) \
|| (OS(HPUX) && CPU(IA64)) \
|| OS(SYMBIAN) \
|| OS(NETBSD)
// ELF platform
#define HIDE_SYMBOL(name) ".hidden " #name
#else
......
......@@ -37,7 +37,7 @@
#include <stdlib.h>
#include <string.h>
#if !PLATFORM(WIN_OS)
#if !OS(WINDOWS)
#include <unistd.h>
#endif
......@@ -54,7 +54,7 @@
#include <signal.h>
#endif
#if COMPILER(MSVC) && !PLATFORM(WINCE)
#if COMPILER(MSVC) && !OS(WINCE)
#include <crtdbg.h>
#include <windows.h>
#include <mmsystem.h>
......@@ -313,7 +313,7 @@ int jscmain(int argc, char** argv, JSGlobalData*);
int main(int argc, char** argv)
{
#if defined(_DEBUG) && PLATFORM(WIN_OS)
#if defined(_DEBUG) && OS(WINDOWS)
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
......@@ -322,7 +322,7 @@ int main(int argc, char** argv)
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
#endif
#if COMPILER(MSVC) && !PLATFORM(WINCE)
#if COMPILER(MSVC) && !OS(WINCE)
timeBeginPeriod(1);
#endif
......
......@@ -43,7 +43,7 @@
// Default values for bison.
#define YYDEBUG 0 // Set to 1 to debug a parse error.
#define jscyydebug 0 // Set to 1 to debug a parse error.
#if !PLATFORM(DARWIN)
#if !OS(DARWIN)
// Avoid triggering warnings in older bison by not setting this on the Darwin platform.
// FIXME: Is this still needed?
#define YYERROR_VERBOSE
......
......@@ -33,7 +33,7 @@
#include <stdio.h>
#include <wtf/DateMath.h>
#if PLATFORM(WIN_OS)
#if OS(WINDOWS)
#include <windows.h>
#endif
......@@ -43,7 +43,7 @@ namespace JSC {
static double getCount()
{
#if PLATFORM(WIN_OS)
#if OS(WINDOWS)
static LARGE_INTEGER frequency = {0};
if (!frequency.QuadPart)
QueryPerformanceFrequency(&frequency);
......
......@@ -45,7 +45,7 @@
#include <wtf/UnusedParam.h>
#include <wtf/VMTags.h>
#if PLATFORM(DARWIN)
#if OS(DARWIN)
#include <mach/mach_init.h>
#include <mach/mach_port.h>
......@@ -53,29 +53,29 @@
#include <mach/thread_act.h>
#include <mach/vm_map.h>
#elif PLATFORM(SYMBIAN)
#elif OS(SYMBIAN)
#include <e32std.h>
#include <e32cmn.h>
#include <unistd.h>
#elif PLATFORM(WIN_OS)
#elif OS(WINDOWS)
#include <windows.h>
#include <malloc.h>
#elif PLATFORM(HAIKU)
#elif OS(HAIKU)
#include <OS.h>
#elif PLATFORM(UNIX)
#elif OS(UNIX)
#include <stdlib.h>
#if !PLATFORM(HAIKU)
#if !OS(HAIKU)
#include <sys/mman.h>
#endif
#include <unistd.h>
#if PLATFORM(SOLARIS)
#if OS(SOLARIS)
#include <thread.h>
#else
#include <pthread.h>
......@@ -85,7 +85,7 @@
#include <pthread_np.h>
#endif
#if PLATFORM(QNX)
#if OS(QNX)
#include <fcntl.h>
#include <sys/procfs.h>
#include <stdio.h>
......@@ -109,16 +109,16 @@ const size_t ALLOCATIONS_PER_COLLECTION = 3600;
// a PIC branch in Mach-O binaries, see <rdar://problem/5971391>.
#define MIN_ARRAY_SIZE (static_cast<size_t>(14))
#if PLATFORM(SYMBIAN)
#if OS(SYMBIAN)
const size_t MAX_NUM_BLOCKS = 256; // Max size of collector heap set to 16 MB
static RHeap* userChunk = 0;
#endif
#if ENABLE(JSC_MULTIPLE_THREADS)
#if PLATFORM(DARWIN)
#if OS(DARWIN)
typedef mach_port_t PlatformThread;