From 0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 11 Aug 2009 17:01:47 +0100 Subject: Merge in WebKit r47029. --- JavaScriptCore/interpreter/RegisterFile.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'JavaScriptCore/interpreter/RegisterFile.h') diff --git a/JavaScriptCore/interpreter/RegisterFile.h b/JavaScriptCore/interpreter/RegisterFile.h index 09a3963..b5f7452 100644 --- a/JavaScriptCore/interpreter/RegisterFile.h +++ b/JavaScriptCore/interpreter/RegisterFile.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,12 +32,12 @@ #include "Collector.h" #include "ExecutableAllocator.h" #include "Register.h" +#include #include #include #if HAVE(MMAP) #include -#include #include #endif @@ -92,7 +92,7 @@ namespace JSC { class JSGlobalObject; - class RegisterFile : Noncopyable { + class RegisterFile : public Noncopyable { friend class JIT; public: enum CallFrameHeaderEntry { @@ -136,8 +136,8 @@ namespace JSC { Register* lastGlobal() const { return m_start - m_numGlobals; } - void markGlobals(Heap* heap) { heap->markConservatively(lastGlobal(), m_start); } - void markCallFrames(Heap* heap) { heap->markConservatively(m_start, m_end); } + void markGlobals(MarkStack& markStack, Heap* heap) { heap->markConservatively(markStack, lastGlobal(), m_start); } + void markCallFrames(MarkStack& markStack, Heap* heap) { heap->markConservatively(markStack, m_start, m_end); } private: void releaseExcessCapacity(); @@ -176,19 +176,31 @@ namespace JSC { #if HAVE(MMAP) m_buffer = static_cast(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) + fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); +#else fprintf(stderr, "Could not allocate register file: %d\n", errno); +#endif CRASH(); } #elif HAVE(VIRTUALALLOC) m_buffer = static_cast(VirtualAlloc(0, roundUpAllocationSize(bufferLength, commitSize), MEM_RESERVE, PAGE_READWRITE)); if (!m_buffer) { +#if PLATFORM(WINCE) + fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); +#else fprintf(stderr, "Could not allocate register file: %d\n", errno); +#endif CRASH(); } 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) + fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); +#else fprintf(stderr, "Could not allocate register file: %d\n", errno); +#endif CRASH(); } m_commitEnd = reinterpret_cast(reinterpret_cast(m_buffer) + committedSize); @@ -222,7 +234,11 @@ namespace JSC { if (newEnd > m_commitEnd) { size_t size = roundUpAllocationSize(reinterpret_cast(newEnd) - reinterpret_cast(m_commitEnd), commitSize); if (!VirtualAlloc(m_commitEnd, size, MEM_COMMIT, PAGE_READWRITE)) { +#if PLATFORM(WINCE) + fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); +#else fprintf(stderr, "Could not allocate register file: %d\n", errno); +#endif CRASH(); } m_commitEnd = reinterpret_cast(reinterpret_cast(m_commitEnd) + size); -- cgit v1.1