diff options
author | Ben Murdoch <benm@google.com> | 2009-08-11 17:01:47 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2009-08-11 18:21:02 +0100 |
commit | 0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch) | |
tree | 2943df35f62d885c89d01063cc528dd73b480fea /JavaScriptCore/interpreter/RegisterFile.h | |
parent | 7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff) | |
download | external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2 |
Merge in WebKit r47029.
Diffstat (limited to 'JavaScriptCore/interpreter/RegisterFile.h')
-rw-r--r-- | JavaScriptCore/interpreter/RegisterFile.h | 26 |
1 files changed, 21 insertions, 5 deletions
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 <stdio.h> #include <wtf/Noncopyable.h> #include <wtf/VMTags.h> #if HAVE(MMAP) #include <errno.h> -#include <stdio.h> #include <sys/mman.h> #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<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) + 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<Register*>(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<Register*>(reinterpret_cast<char*>(m_buffer) + committedSize); @@ -222,7 +234,11 @@ 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) + 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<Register*>(reinterpret_cast<char*>(m_commitEnd) + size); |