2009-05-02 05:04:19 -04:00
|
|
|
#ifndef __FACTOR_MASTER_H__
|
|
|
|
#define __FACTOR_MASTER_H__
|
|
|
|
|
2011-05-20 18:11:50 -04:00
|
|
|
#ifndef _THREAD_SAFE
|
2009-08-28 15:23:01 -04:00
|
|
|
#define _THREAD_SAFE
|
2011-05-20 18:11:50 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _REENTRANT
|
2009-08-28 15:23:01 -04:00
|
|
|
#define _REENTRANT
|
2011-05-20 18:11:50 -04:00
|
|
|
#endif
|
2009-08-28 15:23:01 -04:00
|
|
|
|
2009-05-02 05:04:19 -04:00
|
|
|
#include <errno.h>
|
|
|
|
|
2009-05-05 12:07:20 -04:00
|
|
|
/* C headers */
|
2009-05-02 05:04:19 -04:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <time.h>
|
2010-08-01 19:14:20 -04:00
|
|
|
#include <wchar.h>
|
2013-05-13 00:28:25 -04:00
|
|
|
#include <stdint.h>
|
2009-05-02 05:04:19 -04:00
|
|
|
|
2009-05-05 12:07:20 -04:00
|
|
|
/* C++ headers */
|
2009-10-06 03:39:12 -04:00
|
|
|
#include <algorithm>
|
2010-09-17 23:52:27 -04:00
|
|
|
#include <list>
|
2009-10-19 03:21:11 -04:00
|
|
|
#include <map>
|
2009-10-03 09:47:05 -04:00
|
|
|
#include <set>
|
2009-10-06 03:39:12 -04:00
|
|
|
#include <vector>
|
2009-10-21 21:12:57 -04:00
|
|
|
#include <iostream>
|
2010-08-01 19:14:20 -04:00
|
|
|
#include <iomanip>
|
2011-11-07 20:44:21 -05:00
|
|
|
#include <limits>
|
2014-07-03 14:20:08 -04:00
|
|
|
#include <string>
|
2011-11-07 20:44:21 -05:00
|
|
|
|
2011-05-20 18:11:50 -04:00
|
|
|
#define FACTOR_STRINGIZE_I(x) #x
|
|
|
|
#define FACTOR_STRINGIZE(x) FACTOR_STRINGIZE_I(x)
|
2010-03-01 20:56:17 -05:00
|
|
|
|
2010-03-01 16:32:07 -05:00
|
|
|
/* Record compiler version */
|
|
|
|
#if defined(__clang__)
|
2013-05-11 22:13:10 -04:00
|
|
|
#define FACTOR_COMPILER_VERSION "Clang (GCC " __VERSION__ ")"
|
2010-03-01 16:32:07 -05:00
|
|
|
#elif defined(__INTEL_COMPILER)
|
2013-05-11 22:13:10 -04:00
|
|
|
#define FACTOR_COMPILER_VERSION \
|
|
|
|
"Intel C Compiler " FACTOR_STRINGIZE(__INTEL_COMPILER)
|
2010-03-01 16:32:07 -05:00
|
|
|
#elif defined(__GNUC__)
|
2013-05-11 22:13:10 -04:00
|
|
|
#define FACTOR_COMPILER_VERSION "GCC " __VERSION__
|
2010-03-01 16:32:07 -05:00
|
|
|
#elif defined(_MSC_FULL_VER)
|
2013-05-11 22:13:10 -04:00
|
|
|
#define FACTOR_COMPILER_VERSION \
|
|
|
|
"Microsoft Visual C++ " FACTOR_STRINGIZE(_MSC_FULL_VER)
|
2010-03-01 16:32:07 -05:00
|
|
|
#else
|
2013-05-11 22:13:10 -04:00
|
|
|
#define FACTOR_COMPILER_VERSION "unknown"
|
2010-03-01 16:32:07 -05:00
|
|
|
#endif
|
|
|
|
|
2013-08-19 11:34:29 -04:00
|
|
|
/* Record compilation time */
|
|
|
|
#define FACTOR_COMPILE_TIME __TIMESTAMP__
|
|
|
|
|
2010-01-13 08:18:49 -05:00
|
|
|
/* Detect target CPU type */
|
|
|
|
#if defined(__arm__)
|
2013-05-11 22:13:10 -04:00
|
|
|
#define FACTOR_ARM
|
2010-01-24 08:17:18 -05:00
|
|
|
#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
|
2013-05-11 22:13:10 -04:00
|
|
|
#define FACTOR_AMD64
|
|
|
|
#define FACTOR_64
|
2010-01-24 08:17:18 -05:00
|
|
|
#elif defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_IX86)
|
2013-05-11 22:13:10 -04:00
|
|
|
#define FACTOR_X86
|
|
|
|
#elif(defined(__POWERPC__) || defined(__ppc__) || defined(_ARCH_PPC)) && \
|
|
|
|
(defined(__PPC64__) || defined(__64BIT__))
|
|
|
|
#define FACTOR_PPC64
|
|
|
|
#define FACTOR_PPC
|
|
|
|
#define FACTOR_64
|
2010-01-13 08:18:49 -05:00
|
|
|
#elif defined(__POWERPC__) || defined(__ppc__) || defined(_ARCH_PPC)
|
2013-05-11 22:13:10 -04:00
|
|
|
#define FACTOR_PPC32
|
|
|
|
#define FACTOR_PPC
|
2010-01-13 08:18:49 -05:00
|
|
|
#else
|
2013-05-11 22:13:10 -04:00
|
|
|
#error "Unsupported architecture"
|
2010-01-13 08:18:49 -05:00
|
|
|
#endif
|
|
|
|
|
2010-01-16 09:43:22 -05:00
|
|
|
#if defined(_MSC_VER)
|
2013-05-11 22:13:10 -04:00
|
|
|
#define WINDOWS
|
|
|
|
#define WINNT
|
2010-01-16 09:43:22 -05:00
|
|
|
#elif defined(WIN32)
|
2013-05-11 22:13:10 -04:00
|
|
|
#define WINDOWS
|
2010-01-16 09:43:22 -05:00
|
|
|
#endif
|
|
|
|
|
2009-10-03 09:47:05 -04:00
|
|
|
/* Forward-declare this since it comes up in function prototypes */
|
2013-05-11 22:13:10 -04:00
|
|
|
namespace factor { struct factor_vm; }
|
2009-10-03 09:47:05 -04:00
|
|
|
|
2009-05-05 12:07:20 -04:00
|
|
|
/* Factor headers */
|
2011-11-17 23:42:30 -05:00
|
|
|
#include "assert.hpp"
|
2009-05-02 05:04:19 -04:00
|
|
|
#include "layouts.hpp"
|
2009-08-18 15:40:26 -04:00
|
|
|
#include "platform.hpp"
|
2009-08-18 15:49:22 -04:00
|
|
|
#include "primitives.hpp"
|
2009-05-04 02:00:30 -04:00
|
|
|
#include "segments.hpp"
|
2010-06-11 20:06:00 -04:00
|
|
|
#include "gc_info.hpp"
|
2009-05-04 02:00:30 -04:00
|
|
|
#include "contexts.hpp"
|
2009-05-02 05:04:19 -04:00
|
|
|
#include "run.hpp"
|
2009-11-05 20:03:51 -05:00
|
|
|
#include "objects.hpp"
|
2011-10-28 18:42:33 -04:00
|
|
|
#include "sampling_profiler.hpp"
|
2009-05-02 05:04:19 -04:00
|
|
|
#include "errors.hpp"
|
|
|
|
#include "bignumint.hpp"
|
|
|
|
#include "bignum.hpp"
|
2009-12-02 01:48:41 -05:00
|
|
|
#include "booleans.hpp"
|
2009-11-23 19:51:08 -05:00
|
|
|
#include "instruction_operands.hpp"
|
2009-11-07 17:16:09 -05:00
|
|
|
#include "code_blocks.hpp"
|
2009-10-20 16:15:05 -04:00
|
|
|
#include "bump_allocator.hpp"
|
2009-11-01 21:15:42 -05:00
|
|
|
#include "bitwise_hacks.hpp"
|
2009-10-20 16:15:05 -04:00
|
|
|
#include "mark_bits.hpp"
|
2009-10-26 23:08:35 -04:00
|
|
|
#include "free_list.hpp"
|
2010-06-11 20:06:00 -04:00
|
|
|
#include "fixup.hpp"
|
|
|
|
#include "tuples.hpp"
|
2009-10-20 16:15:05 -04:00
|
|
|
#include "free_list_allocator.hpp"
|
2009-05-04 05:50:24 -04:00
|
|
|
#include "write_barrier.hpp"
|
2009-10-20 16:15:05 -04:00
|
|
|
#include "object_start_map.hpp"
|
2009-10-20 23:20:49 -04:00
|
|
|
#include "nursery_space.hpp"
|
2009-10-07 16:48:09 -04:00
|
|
|
#include "aging_space.hpp"
|
|
|
|
#include "tenured_space.hpp"
|
2009-10-07 15:05:09 -04:00
|
|
|
#include "data_heap.hpp"
|
2009-10-27 22:31:28 -04:00
|
|
|
#include "code_heap.hpp"
|
2009-10-08 03:11:29 -04:00
|
|
|
#include "gc.hpp"
|
2009-05-02 05:04:19 -04:00
|
|
|
#include "strings.hpp"
|
|
|
|
#include "float_bits.hpp"
|
|
|
|
#include "io.hpp"
|
|
|
|
#include "image.hpp"
|
2009-10-16 12:39:22 -04:00
|
|
|
#include "callbacks.hpp"
|
2009-11-05 02:07:59 -05:00
|
|
|
#include "dispatch.hpp"
|
2010-01-05 21:47:36 -05:00
|
|
|
#include "entry_points.hpp"
|
2011-11-07 15:51:49 -05:00
|
|
|
#include "safepoints.hpp"
|
2009-08-17 16:37:12 -04:00
|
|
|
#include "vm.hpp"
|
2009-10-31 03:30:48 -04:00
|
|
|
#include "allot.hpp"
|
2009-08-17 16:37:15 -04:00
|
|
|
#include "tagged.hpp"
|
2009-11-02 19:10:34 -05:00
|
|
|
#include "data_roots.hpp"
|
|
|
|
#include "code_roots.hpp"
|
2009-11-22 14:37:39 -05:00
|
|
|
#include "generic_arrays.hpp"
|
2010-06-11 20:06:00 -04:00
|
|
|
#include "callstack.hpp"
|
2009-10-24 04:54:53 -04:00
|
|
|
#include "slot_visitor.hpp"
|
2009-10-07 16:48:09 -04:00
|
|
|
#include "collector.hpp"
|
|
|
|
#include "copying_collector.hpp"
|
|
|
|
#include "nursery_collector.hpp"
|
|
|
|
#include "aging_collector.hpp"
|
|
|
|
#include "to_tenured_collector.hpp"
|
2009-10-24 04:54:53 -04:00
|
|
|
#include "code_block_visitor.hpp"
|
2009-10-07 16:48:09 -04:00
|
|
|
#include "full_collector.hpp"
|
2009-09-29 14:53:10 -04:00
|
|
|
#include "arrays.hpp"
|
|
|
|
#include "math.hpp"
|
|
|
|
#include "byte_arrays.hpp"
|
2009-05-02 05:04:19 -04:00
|
|
|
#include "jit.hpp"
|
2009-05-02 10:19:09 -04:00
|
|
|
#include "quotations.hpp"
|
2009-05-02 05:04:19 -04:00
|
|
|
#include "inline_cache.hpp"
|
2010-03-29 02:23:21 -04:00
|
|
|
#include "mvm.hpp"
|
2009-05-02 05:04:19 -04:00
|
|
|
#include "factor.hpp"
|
|
|
|
#include "utilities.hpp"
|
|
|
|
|
|
|
|
#endif /* __FACTOR_MASTER_H__ */
|