Commit ea563365 authored by lrn@chromium.org's avatar lrn@chromium.org

Create build structure for X64.

Possible to attempt to build for X64.
Build will be unsuccessful, since all x64 source files are
missing and pointers are reinterpreted as integers everywhere.

Review URL: http://codereview.chromium.org/99186


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1817 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2beedf11
......@@ -131,10 +131,25 @@ LIBRARY_FLAGS = {
'-Wstrict-aliasing=2'],
'CPPPATH': ANDROID_INCLUDES,
},
'wordsize:64': {
'wordsize:32': {
'CCFLAGS': ['-m32'],
'CPPDEFINES': ['ILP32'],
'LINKFLAGS': ['-m32']
},
'wordsize:64': {
'CCFLAGS': ['-m64'],
'CPPDEFINES': ['LP64'],
'LINKFLAGS': ['-m64']
},
'arch:ia32': {
'CPPDEFINES': ['V8_ARCH_IA32']
},
'arch:arm': {
'CPPDEFINES': ['V8_ARCH_ARM']
},
'arch:x64': {
'CPPDEFINES': ['V8_ARCH_X64']
},
'prof:oprofile': {
'CPPDEFINES': ['ENABLE_OPROFILE_AGENT']
}
......@@ -175,7 +190,7 @@ LIBRARY_FLAGS = {
'LINKFLAGS': ['/LTCG'],
'ARFLAGS': ['/LTCG'],
}
},
}
}
}
......@@ -190,9 +205,6 @@ V8_EXTRA_FLAGS = {
'arch:arm': {
'CPPDEFINES': ['ARM']
},
'arch:android': {
'CPPDEFINES': ['ARM']
},
'os:win32': {
'WARNINGFLAGS': ['-pedantic', '-Wno-long-long']
},
......@@ -298,10 +310,16 @@ CCTEST_EXTRA_FLAGS = {
'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
}
},
'wordsize:64': {
'wordsize:32': {
'CCFLAGS': ['-m32'],
'CPPDEFINES': ['ILP32'],
'LINKFLAGS': ['-m32']
},
'wordsize:64': {
'CCFLAGS': ['-m64'],
'CPPDEFINES': ['LP64'],
'LINKFLAGS': ['-m64']
},
},
'msvc': {
'all': {
......@@ -349,10 +367,16 @@ SAMPLE_FLAGS = {
'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
}
},
'wordsize:64': {
'wordsize:32': {
'CCFLAGS': ['-m32'],
'CPPDEFINES': ['ILP32'],
'LINKFLAGS': ['-m32']
},
'wordsize:64': {
'CCFLAGS': ['-m64'],
'CPPDEFINES': ['LP64'],
'LINKFLAGS': ['-m64']
},
'mode:release': {
'CCFLAGS': ['-O2']
},
......@@ -466,17 +490,17 @@ SIMPLE_OPTIONS = {
'toolchain': {
'values': ['gcc', 'msvc'],
'default': TOOLCHAIN_GUESS,
'help': 'the toolchain to use'
'help': 'the toolchain to use (' + TOOLCHAIN_GUESS + ')'
},
'os': {
'values': ['freebsd', 'linux', 'macos', 'win32', 'android'],
'default': OS_GUESS,
'help': 'the os to build for'
'help': 'the os to build for (' + OS_GUESS + ')'
},
'arch': {
'values':['arm', 'ia32'],
'values':['arm', 'ia32', 'x64'],
'default': ARCH_GUESS,
'help': 'the architecture to build for'
'help': 'the architecture to build for (' + ARCH_GUESS + ')'
},
'snapshot': {
'values': ['on', 'off', 'nobuild'],
......@@ -505,7 +529,7 @@ SIMPLE_OPTIONS = {
},
'wordsize': {
'values': ['64', '32'],
'default': WORDSIZE_GUESS,
'default': '32', # WORDSIZE_GUESS,
'help': 'the word size'
},
'simulator': {
......@@ -565,6 +589,8 @@ def VerifyOptions(env):
Abort("Profiling on windows only supported for static library.")
if env['prof'] == 'oprofile' and env['os'] != 'linux':
Abort("OProfile is only supported on Linux.")
if env['wordsize'] == '64' and (env['os'] != 'linux' or env['arch'] != 'x64'):
Abort("64 bit compilation only allowed on Linux OS and x64 architecture.")
for (name, option) in SIMPLE_OPTIONS.iteritems():
if (not option.get('default')) and (name not in ARGUMENTS):
message = ("A value for option %s must be specified (%s)." %
......
......@@ -57,16 +57,26 @@ SOURCES = {
'arm/codegen-arm.cc', 'arm/cpu-arm.cc', 'arm/disasm-arm.cc',
'arm/debug-arm.cc', 'arm/frames-arm.cc', 'arm/ic-arm.cc',
'arm/jump-target-arm.cc', 'arm/macro-assembler-arm.cc',
'arm/regexp-macro-assembler-arm.cc',
'arm/register-allocator-arm.cc', 'arm/stub-cache-arm.cc',
'arm/regexp-macro-assembler-arm.cc', 'arm/virtual-frame-arm.cc'
'arm/virtual-frame-arm.cc'
],
'arch:ia32': [
'ia32/assembler-ia32.cc', 'ia32/builtins-ia32.cc',
'ia32/codegen-ia32.cc', 'ia32/cpu-ia32.cc', 'ia32/disasm-ia32.cc',
'ia32/debug-ia32.cc', 'ia32/frames-ia32.cc', 'ia32/ic-ia32.cc',
'ia32/jump-target-ia32.cc', 'ia32/macro-assembler-ia32.cc',
'ia32/regexp-macro-assembler-ia32.cc',
'ia32/register-allocator-ia32.cc', 'ia32/stub-cache-ia32.cc',
'ia32/regexp-macro-assembler-ia32.cc', 'ia32/virtual-frame-ia32.cc'
'ia32/virtual-frame-ia32.cc'
],
'arch:x64': [
'x64/assembler-x64.cc', 'x64/builtins-x64.cc',
'x64/codegen-x64.cc', 'x64/cpu-x64.cc', 'x64/disasm-x64.cc',
'x64/debug-x64.cc', 'x64/frames-x64.cc', 'x64/ic-x64.cc',
'x64/jump-target-x64.cc', 'x64/macro-assembler-x64.cc',
# 'x64/regexp-macro-assembler-x64.cc',
'x64/stub-cache-x64.cc'
],
'simulator:arm': ['arm/simulator-arm.cc'],
'os:freebsd': ['platform-freebsd.cc', 'platform-posix.cc'],
......
......@@ -76,9 +76,15 @@
enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT };
#ifdef ARM
#ifdef V8_ARCH_ARM
#include "arm/codegen-arm.h"
#else
#endif
#ifdef V8_ARCH_X64
#include "x64/codegen-x64.h"
#endif
#ifdef V8_ARCH_IA32
#include "ia32/codegen-ia32.h"
#endif
......
......@@ -32,9 +32,15 @@
#include "api.h"
#include "codegen-inl.h"
#ifdef ARM
#ifdef V8_ARCH_ARM
#include "arm/simulator-arm.h"
#else // ia32
#endif
#ifdef V8_ARCH_X64
#include "x64/simulator-x64.h"
#endif
#ifdef V8_ARCH_IA32
#include "ia32/simulator-ia32.h"
#endif
......
......@@ -29,9 +29,15 @@
#define V8_FRAMES_INL_H_
#include "frames.h"
#ifdef ARM
#ifdef V8_ARCH_ARM
#include "arm/frames-arm.h"
#else
#endif
#ifdef V8_ARCH_X64
#include "x64/frames-x64.h"
#endif
#ifdef V8_ARCH_IA32
#include "ia32/frames-ia32.h"
#endif
......
......@@ -73,7 +73,7 @@ typedef byte* Address;
typedef uint16_t uc16;
typedef signed int uc32;
#ifndef ARM
#if defined(V8_ARCH_IA32) || defined(V8_ARCH_X64)
#define CAN_READ_UNALIGNED 1
#endif
......
......@@ -42,9 +42,16 @@
#include "regexp-macro-assembler-irregexp.h"
#include "regexp-stack.h"
#ifdef ARM
#ifdef V8_ARCH_ARM
#include "arm/regexp-macro-assembler-arm.h"
#else // IA32
#endif
#ifdef V8_ARCH_X64
#include "x64/macro-assembler-x64.h"
#include "x64/regexp-macro-assembler-x64.h"
#endif
#ifdef V8_ARCH_IA32
#include "ia32/macro-assembler-ia32.h"
#include "ia32/regexp-macro-assembler-ia32.h"
#endif
......@@ -424,9 +431,13 @@ Handle<Object> RegExpImpl::IrregexpExec(Handle<JSRegExp> jsregexp,
Handle<String> original_subject = subject;
Handle<FixedArray> regexp(FixedArray::cast(jsregexp->data()));
if (UseNativeRegexp()) {
#ifdef ARM
#ifdef V8_ARCH_ARM
UNREACHABLE();
#else
#endif
#ifdef V8_ARCH_X64
UNIMPLEMENTED();
#endif
#ifdef V8_ARCH_IA32
RegExpMacroAssemblerIA32::Result res;
do {
bool is_ascii = StringShape(*subject).IsAsciiRepresentation();
......@@ -4434,9 +4445,13 @@ RegExpEngine::CompilationResult RegExpEngine::Compile(RegExpCompileData* data,
NodeInfo info = *node->info();
if (RegExpImpl::UseNativeRegexp()) {
#ifdef ARM
#ifdef V8_ARCH_ARM
UNREACHABLE();
#else // IA32
#endif
#ifdef V8_ARCH_X64
UNREACHABLE();
#endif
#ifdef V8_ARCH_IA32
RegExpMacroAssemblerIA32::Mode mode;
if (is_ascii) {
mode = RegExpMacroAssemblerIA32::ASCII;
......
......@@ -37,9 +37,13 @@ class RegExpMacroAssembler;
class RegExpImpl {
public:
static inline bool UseNativeRegexp() {
#ifdef ARM
#ifdef V8_ARCH_ARM
return false;
#else
#endif
#ifdef V8_ARCH_X64
return false;
#endif
#ifdef V8_ARCH_IA32
return FLAG_regexp_native;
#endif
}
......
......@@ -28,23 +28,29 @@
#ifndef V8_MACRO_ASSEMBLER_H_
#define V8_MACRO_ASSEMBLER_H_
#ifdef ARM
#ifdef V8_ARCH_ARM
#include "arm/constants-arm.h"
#include "assembler.h"
#include "arm/assembler-arm.h"
#include "arm/assembler-arm-inl.h"
#include "code.h" // must be after assembler_*.h
#include "arm/macro-assembler-arm.h"
#endif
#else // ia32
#ifdef V8_ARCH_X64
#include "assembler.h"
#include "x64/assembler-x64.h"
#include "x64/assembler-x64-inl.h"
#include "code.h" // must be after assembler_*.h
#include "x64/macro-assembler-x64.h"
#endif
#ifdef V8_ARCH_IA32
#include "assembler.h"
#include "ia32/assembler-ia32.h"
#include "ia32/assembler-ia32-inl.h"
#include "code.h" // must be after assembler_*.h
#include "ia32/macro-assembler-ia32.h"
#endif
#endif // V8_MACRO_ASSEMBLER_H_
......@@ -171,7 +171,7 @@ void OS::Abort() {
void OS::DebugBreak() {
#if defined (__arm__) || defined(__thumb__)
#if defined(__arm__) || defined(__thumb__)
asm("bkpt 0");
#else
asm("int $3");
......
......@@ -171,6 +171,8 @@ void OS::Abort() {
void OS::DebugBreak() {
// TODO(lrn): Introduce processor define for runtime system (!= V8_ARCH_x,
// which is the architecture of generated code).
#if defined(__arm__) || defined(__thumb__)
asm("bkpt 0");
#else
......@@ -598,7 +600,7 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
// Extracting the sample from the context is extremely machine dependent.
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
mcontext_t& mcontext = ucontext->uc_mcontext;
#if defined (__arm__) || defined(__thumb__)
#if defined(__arm__) || defined(__thumb__)
sample.pc = mcontext.gregs[R15];
sample.sp = mcontext.gregs[R13];
sample.fp = mcontext.gregs[R11];
......
......@@ -202,9 +202,15 @@ class FrameElement BASE_EMBEDDED {
} } // namespace v8::internal
#ifdef ARM
#ifdef V8_ARCH_ARM
#include "arm/virtual-frame-arm.h"
#else // ia32
#endif
#ifdef V8_ARCH_X64
#include "x64/virtual-frame-x64.h"
#endif
#ifdef V8_ARCH_IA32
#include "ia32/virtual-frame-ia32.h"
#endif
......
......@@ -1369,6 +1369,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
V8_ARCH_IA32,
DEBUG,
);
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
......@@ -1408,6 +1409,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
V8_ARCH_IA32,
NDEBUG,
);
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
......@@ -1447,6 +1449,7 @@
DEPLOYMENT_POSTPROCESSING = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
V8_ARCH_IA32,
ENABLE_DISASSEMBLER,
ENABLE_LOGGING_AND_PROFILING,
);
......@@ -1488,7 +1491,7 @@
DEPLOYMENT_POSTPROCESSING = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
ARM,
V8_ARCH_ARM,
ENABLE_DISASSEMBLER,
ENABLE_LOGGING_AND_PROFILING,
);
......@@ -1504,7 +1507,7 @@
DEPLOYMENT_POSTPROCESSING = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
ARM,
V8_ARCH_ARM,
);
HEADER_SEARCH_PATHS = ../src;
PRODUCT_NAME = "v8-arm";
......
......@@ -6,7 +6,7 @@
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="ARM"
PreprocessorDefinitions="V8_ARCH_ARM"
DisableSpecificWarnings="4996"
/>
</VisualStudioPropertySheet>
......@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -79,7 +79,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="arm"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="V8_ARCH_IA32"
/>
</VisualStudioPropertySheet>
......@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="4"
InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -70,7 +70,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="4"
InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......
......@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="4"
InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -69,7 +69,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="4"
InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......
......@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -79,7 +79,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......
......@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -79,7 +79,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......
......@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -79,7 +79,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......
......@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -79,7 +79,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......
......@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="4"
InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -70,7 +70,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="4"
InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......
......@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="10"
InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -36,7 +36,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="10"
InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment