summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/interpreter/RegisterFile.h
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/interpreter/RegisterFile.h')
-rw-r--r--JavaScriptCore/interpreter/RegisterFile.h26
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);