From: mark@chromium.org Date: Mon, 17 May 2010 15:41:35 +0000 (+0000) Subject: Allow build-time selection between ia32 and x86_64 in the GYP/Xcode Mac X-Git-Tag: upstream/4.7.83~21796 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e9b5d7855bf910858def5587f748e5c039fa13d4;p=platform%2Fupstream%2Fv8.git Allow build-time selection between ia32 and x86_64 in the GYP/Xcode Mac Chromium build. v8.gyp no longer sets any V8_TARGET_ARCH_* macro on the Mac. Instead, the proper V8_TARGET_ARCH_* macro will be set by src/globals.h in the same way as the V8_HOST_ARCH_* macro when it detects that no target macro is currently defined. The Mac build will attempt to compile all ia32 and x86_64 .cc files. #ifdef guards in each of these target-specific source files prevent their compilation when the associated target is not selected. For completeness, these #ifdef guards are also provided for the arm and mips .cc files. BUG=706 TEST=x86_64 Mac GYP/Xcode-based Chromium build (still depends on other changes) Review URL: http://codereview.chromium.org/2133003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4666 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc index 474a74e..1bcf99d 100644 --- a/src/arm/assembler-arm.cc +++ b/src/arm/assembler-arm.cc @@ -36,6 +36,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) && defined(V8_ARM_VARIANT_ARM) + #include "arm/assembler-arm-inl.h" #include "serialize.h" @@ -2257,3 +2259,5 @@ void Assembler::CheckConstPool(bool force_emit, bool require_jump) { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM && V8_ARM_VARIANT_ARM diff --git a/src/arm/assembler-thumb2.cc b/src/arm/assembler-thumb2.cc index e31c429..3cee835 100644 --- a/src/arm/assembler-thumb2.cc +++ b/src/arm/assembler-thumb2.cc @@ -36,6 +36,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) && defined(V8_ARM_VARIANT_THUMB) + #include "arm/assembler-thumb2-inl.h" #include "serialize.h" @@ -1876,3 +1878,5 @@ void Assembler::CheckConstPool(bool force_emit, bool require_jump) { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM && V8_ARM_VARIANT_THUMB diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc index 5718cb3..da3189a 100644 --- a/src/arm/builtins-arm.cc +++ b/src/arm/builtins-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "codegen-inl.h" #include "debug.h" #include "runtime.h" @@ -1311,3 +1313,5 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc index 68ae026..e3fd18b 100644 --- a/src/arm/codegen-arm.cc +++ b/src/arm/codegen-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "bootstrapper.h" #include "codegen-inl.h" #include "compiler.h" @@ -10020,3 +10022,5 @@ void StringAddStub::Generate(MacroAssembler* masm) { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/constants-arm.cc b/src/arm/constants-arm.cc index 2e37120..4e186d1 100644 --- a/src/arm/constants-arm.cc +++ b/src/arm/constants-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "constants-arm.h" @@ -128,3 +130,5 @@ int Registers::Number(const char* name) { } } // namespace assembler::arm + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/cpu-arm.cc b/src/arm/cpu-arm.cc index d50c203..3d3e6ae 100644 --- a/src/arm/cpu-arm.cc +++ b/src/arm/cpu-arm.cc @@ -32,6 +32,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "cpu.h" #include "macro-assembler.h" @@ -136,3 +138,5 @@ void CPU::DebugBreak() { } } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/debug-arm.cc b/src/arm/debug-arm.cc index d02ba76..3eb0777 100644 --- a/src/arm/debug-arm.cc +++ b/src/arm/debug-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "codegen-inl.h" #include "debug.h" @@ -237,3 +239,5 @@ const int Debug::kFrameDropperFrameSize = -1; #endif // ENABLE_DEBUGGER_SUPPORT } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/disasm-arm.cc b/src/arm/disasm-arm.cc index 4051096..0ac7d19 100644 --- a/src/arm/disasm-arm.cc +++ b/src/arm/disasm-arm.cc @@ -56,6 +56,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "constants-arm.h" #include "disasm.h" #include "macro-assembler.h" @@ -1356,3 +1358,5 @@ void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) { } // namespace disasm + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/fast-codegen-arm.cc b/src/arm/fast-codegen-arm.cc index 5dedc29..48eaf46 100644 --- a/src/arm/fast-codegen-arm.cc +++ b/src/arm/fast-codegen-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "codegen-inl.h" #include "fast-codegen.h" #include "scopes.h" @@ -236,3 +238,5 @@ void FastCodeGenerator::Generate(CompilationInfo* compilation_info) { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/frames-arm.cc b/src/arm/frames-arm.cc index 0cb7f12..e564e83 100644 --- a/src/arm/frames-arm.cc +++ b/src/arm/frames-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "frames-inl.h" #ifdef V8_ARM_VARIANT_THUMB #include "arm/assembler-thumb2-inl.h" @@ -121,3 +123,5 @@ Address InternalFrame::GetCallerStackPointer() const { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index 6680af9..7a826da 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "codegen-inl.h" #include "compiler.h" #include "debug.h" @@ -1877,3 +1879,5 @@ void FullCodeGenerator::ExitFinallyBlock() { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc index c308d69..f1a2643 100644 --- a/src/arm/ic-arm.cc +++ b/src/arm/ic-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "assembler-arm.h" #include "codegen.h" #include "codegen-inl.h" @@ -1841,3 +1843,5 @@ void StoreIC::GenerateArrayLength(MacroAssembler* masm) { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/jump-target-arm.cc b/src/arm/jump-target-arm.cc index 8d182be..3c43d16 100644 --- a/src/arm/jump-target-arm.cc +++ b/src/arm/jump-target-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "codegen-inl.h" #include "jump-target-inl.h" #include "register-allocator-inl.h" @@ -136,3 +138,5 @@ void JumpTarget::DoBind() { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc index c4b153f..e356d55 100644 --- a/src/arm/macro-assembler-arm.cc +++ b/src/arm/macro-assembler-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "bootstrapper.h" #include "codegen-inl.h" #include "debug.h" @@ -1725,3 +1727,5 @@ void CodePatcher::Emit(Address addr) { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/regexp-macro-assembler-arm.cc b/src/arm/regexp-macro-assembler-arm.cc index 64fe5d6..e8910f4 100644 --- a/src/arm/regexp-macro-assembler-arm.cc +++ b/src/arm/regexp-macro-assembler-arm.cc @@ -26,6 +26,9 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "v8.h" + +#if defined(V8_TARGET_ARCH_ARM) + #include "unicode.h" #include "log.h" #include "ast.h" @@ -1255,3 +1258,5 @@ void RegExpCEntryStub::Generate(MacroAssembler* masm_) { #endif // V8_INTERPRETED_REGEXP }} // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/register-allocator-arm.cc b/src/arm/register-allocator-arm.cc index ad0c7f9..3b35574 100644 --- a/src/arm/register-allocator-arm.cc +++ b/src/arm/register-allocator-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "codegen-inl.h" #include "register-allocator-inl.h" @@ -57,3 +59,5 @@ Result RegisterAllocator::AllocateByteRegisterWithoutSpilling() { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/simulator-arm.cc b/src/arm/simulator-arm.cc index e4601f3..e72a879 100644 --- a/src/arm/simulator-arm.cc +++ b/src/arm/simulator-arm.cc @@ -29,6 +29,8 @@ #include #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "disasm.h" #include "assembler.h" #include "arm/constants-arm.h" @@ -2731,3 +2733,5 @@ uintptr_t Simulator::PopAddress() { } } // namespace assembler::arm #endif // __arm__ + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc index 877354c..e73d862 100644 --- a/src/arm/stub-cache-arm.cc +++ b/src/arm/stub-cache-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "ic-inl.h" #include "codegen-inl.h" #include "stub-cache.h" @@ -2153,3 +2155,5 @@ Object* ConstructStubCompiler::CompileConstructStub( #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/arm/virtual-frame-arm.cc b/src/arm/virtual-frame-arm.cc index f7b337d..51dd68b 100644 --- a/src/arm/virtual-frame-arm.cc +++ b/src/arm/virtual-frame-arm.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_ARM) + #include "codegen-inl.h" #include "register-allocator-inl.h" #include "scopes.h" @@ -749,3 +751,5 @@ void VirtualFrame::SpillAll() { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_ARM diff --git a/src/globals.h b/src/globals.h index 981ea16..292d8d8 100644 --- a/src/globals.h +++ b/src/globals.h @@ -59,6 +59,24 @@ namespace internal { #error Host architecture was not detected as supported by v8 #endif +// Target architecture detection. This may be set externally. If not, detect +// in the same way as the host architecture, that is, target the native +// environment as presented by the compiler. +#if !defined(V8_TARGET_ARCH_X64) && !defined(V8_TARGET_ARCH_IA32) && \ + !defined(V8_TARGET_ARCH_ARM) && !defined(V8_TARGET_ARCH_MIPS) +#if defined(_M_X64) || defined(__x86_64__) +#define V8_TARGET_ARCH_X64 1 +#elif defined(_M_IX86) || defined(__i386__) +#define V8_TARGET_ARCH_IA32 1 +#elif defined(__ARMEL__) +#define V8_TARGET_ARCH_ARM 1 +#elif defined(_MIPS_ARCH_MIPS32R2) +#define V8_TARGET_ARCH_MIPS 1 +#else +#error Target architecture was not detected as supported by v8 +#endif +#endif + // Check for supported combinations of host and target architectures. #if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32) #error Target architecture ia32 is only supported on ia32 host diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc index 0d3f01d..a452793 100644 --- a/src/ia32/assembler-ia32.cc +++ b/src/ia32/assembler-ia32.cc @@ -36,6 +36,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "disassembler.h" #include "macro-assembler.h" #include "serialize.h" @@ -2535,3 +2537,5 @@ void LogGeneratedCodeCoverage(const char* file_line) { #endif } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc index 030688a..6086258 100644 --- a/src/ia32/builtins-ia32.cc +++ b/src/ia32/builtins-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "codegen-inl.h" namespace v8 { @@ -1256,3 +1258,5 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc index 4393e44..4364cb4 100644 --- a/src/ia32/codegen-ia32.cc +++ b/src/ia32/codegen-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "bootstrapper.h" #include "codegen-inl.h" #include "compiler.h" @@ -13291,3 +13293,5 @@ void StringCompareStub::Generate(MacroAssembler* masm) { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/cpu-ia32.cc b/src/ia32/cpu-ia32.cc index 2107ad9..b15140f 100644 --- a/src/ia32/cpu-ia32.cc +++ b/src/ia32/cpu-ia32.cc @@ -33,6 +33,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "cpu.h" #include "macro-assembler.h" @@ -77,3 +79,5 @@ void CPU::DebugBreak() { } } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/debug-ia32.cc b/src/ia32/debug-ia32.cc index d142b11..9780f3b 100644 --- a/src/ia32/debug-ia32.cc +++ b/src/ia32/debug-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "codegen-inl.h" #include "debug.h" @@ -261,3 +263,5 @@ const int Debug::kFrameDropperFrameSize = 5; #endif // ENABLE_DEBUGGER_SUPPORT } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/disasm-ia32.cc b/src/ia32/disasm-ia32.cc index 06c62ec..58c22af 100644 --- a/src/ia32/disasm-ia32.cc +++ b/src/ia32/disasm-ia32.cc @@ -30,6 +30,9 @@ #include #include "v8.h" + +#if defined(V8_TARGET_ARCH_IA32) + #include "disasm.h" namespace disasm { @@ -1439,3 +1442,5 @@ int Disassembler::ConstantPoolSizeAt(byte* instruction) { return -1; } } // namespace disasm + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/fast-codegen-ia32.cc b/src/ia32/fast-codegen-ia32.cc index 61e2b5e..b749e59 100644 --- a/src/ia32/fast-codegen-ia32.cc +++ b/src/ia32/fast-codegen-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "codegen-inl.h" #include "fast-codegen.h" #include "data-flow.h" @@ -948,3 +950,5 @@ void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/frames-ia32.cc b/src/ia32/frames-ia32.cc index 5c900be..212cfde 100644 --- a/src/ia32/frames-ia32.cc +++ b/src/ia32/frames-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "frames-inl.h" namespace v8 { @@ -109,3 +111,5 @@ Address InternalFrame::GetCallerStackPointer() const { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index e9838ad..5ea7026 100644 --- a/src/ia32/full-codegen-ia32.cc +++ b/src/ia32/full-codegen-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "codegen-inl.h" #include "compiler.h" #include "debug.h" @@ -2012,3 +2014,5 @@ void FullCodeGenerator::ExitFinallyBlock() { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc index 4929c8a..644d200 100644 --- a/src/ia32/ic-ia32.cc +++ b/src/ia32/ic-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "codegen-inl.h" #include "ic-inl.h" #include "runtime.h" @@ -1643,3 +1645,5 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/jump-target-ia32.cc b/src/ia32/jump-target-ia32.cc index cba6508..76c0d02 100644 --- a/src/ia32/jump-target-ia32.cc +++ b/src/ia32/jump-target-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "codegen-inl.h" #include "jump-target-inl.h" #include "register-allocator-inl.h" @@ -431,3 +433,5 @@ void BreakTarget::Bind(Result* arg) { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc index a7d2834..ba2fe2d 100644 --- a/src/ia32/macro-assembler-ia32.cc +++ b/src/ia32/macro-assembler-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "bootstrapper.h" #include "codegen-inl.h" #include "debug.h" @@ -1706,3 +1708,5 @@ CodePatcher::~CodePatcher() { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/regexp-macro-assembler-ia32.cc b/src/ia32/regexp-macro-assembler-ia32.cc index d9dddd6..b0de827 100644 --- a/src/ia32/regexp-macro-assembler-ia32.cc +++ b/src/ia32/regexp-macro-assembler-ia32.cc @@ -26,6 +26,9 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "v8.h" + +#if defined(V8_TARGET_ARCH_IA32) + #include "unicode.h" #include "log.h" #include "ast.h" @@ -1241,3 +1244,5 @@ void RegExpMacroAssemblerIA32::LoadCurrentCharacterUnchecked(int cp_offset, #endif // V8_INTERPRETED_REGEXP }} // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/register-allocator-ia32.cc b/src/ia32/register-allocator-ia32.cc index 73fefb3..d840c0c 100644 --- a/src/ia32/register-allocator-ia32.cc +++ b/src/ia32/register-allocator-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "codegen-inl.h" #include "register-allocator-inl.h" #include "virtual-frame-inl.h" @@ -151,3 +153,5 @@ Result RegisterAllocator::AllocateByteRegisterWithoutSpilling() { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc index 189c0e4..d7b05cf 100644 --- a/src/ia32/stub-cache-ia32.cc +++ b/src/ia32/stub-cache-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "ic-inl.h" #include "codegen-inl.h" #include "stub-cache.h" @@ -2387,3 +2389,5 @@ Object* ConstructStubCompiler::CompileConstructStub( #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ia32/virtual-frame-ia32.cc b/src/ia32/virtual-frame-ia32.cc index 10aaa52..e22df6e 100644 --- a/src/ia32/virtual-frame-ia32.cc +++ b/src/ia32/virtual-frame-ia32.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_IA32) + #include "codegen-inl.h" #include "register-allocator-inl.h" #include "scopes.h" @@ -1310,3 +1312,5 @@ void VirtualFrame::Push(Expression* expr) { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_IA32 diff --git a/src/mips/assembler-mips.cc b/src/mips/assembler-mips.cc index 4a91624..d9617dc 100644 --- a/src/mips/assembler-mips.cc +++ b/src/mips/assembler-mips.cc @@ -34,6 +34,9 @@ #include "v8.h" + +#if defined(V8_TARGET_ARCH_MIPS) + #include "mips/assembler-mips-inl.h" #include "serialize.h" @@ -1206,3 +1209,4 @@ void Assembler::set_target_address_at(Address pc, Address target) { } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc index 04bcfeb..26fea25 100644 --- a/src/mips/builtins-mips.cc +++ b/src/mips/builtins-mips.cc @@ -29,6 +29,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "codegen-inl.h" #include "debug.h" #include "runtime.h" @@ -200,3 +202,4 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/codegen-mips.cc b/src/mips/codegen-mips.cc index ca1edd4..f8b88d7 100644 --- a/src/mips/codegen-mips.cc +++ b/src/mips/codegen-mips.cc @@ -28,6 +28,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "bootstrapper.h" #include "codegen-inl.h" #include "compiler.h" @@ -1426,3 +1428,5 @@ int CompareStub::MinorKey() { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/constants-mips.cc b/src/mips/constants-mips.cc index a5ef9f8..49502bd 100644 --- a/src/mips/constants-mips.cc +++ b/src/mips/constants-mips.cc @@ -26,6 +26,9 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "v8.h" + +#if defined(V8_TARGET_ARCH_MIPS) + #include "constants-mips.h" namespace assembler { @@ -321,3 +324,5 @@ Instruction::Type Instruction::InstructionType() const { } } } // namespace assembler::mips + +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/cpu-mips.cc b/src/mips/cpu-mips.cc index f592257..659fc01 100644 --- a/src/mips/cpu-mips.cc +++ b/src/mips/cpu-mips.cc @@ -35,6 +35,9 @@ #endif // #ifdef __mips #include "v8.h" + +#if defined(V8_TARGET_ARCH_MIPS) + #include "cpu.h" namespace v8 { @@ -67,3 +70,4 @@ void CPU::DebugBreak() { } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/debug-mips.cc b/src/mips/debug-mips.cc index cdb35ae..8c40930 100644 --- a/src/mips/debug-mips.cc +++ b/src/mips/debug-mips.cc @@ -29,6 +29,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "codegen-inl.h" #include "debug.h" @@ -126,3 +128,4 @@ const int Debug::kFrameDropperFrameSize = -1; } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/disasm-mips.cc b/src/mips/disasm-mips.cc index cab72d1..959a4a2 100644 --- a/src/mips/disasm-mips.cc +++ b/src/mips/disasm-mips.cc @@ -57,6 +57,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "constants-mips.h" #include "disasm.h" #include "macro-assembler.h" @@ -782,3 +784,4 @@ void Disassembler::Disassemble(FILE* f, byte_* begin, byte_* end) { } // namespace disasm +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/fast-codegen-mips.cc b/src/mips/fast-codegen-mips.cc index 48a0ce6..186f9fa 100644 --- a/src/mips/fast-codegen-mips.cc +++ b/src/mips/fast-codegen-mips.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "codegen-inl.h" #include "fast-codegen.h" @@ -72,3 +74,4 @@ void FastCodeGenerator::EmitBitOr() { } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/frames-mips.cc b/src/mips/frames-mips.cc index cdc880d..0fce3cd 100644 --- a/src/mips/frames-mips.cc +++ b/src/mips/frames-mips.cc @@ -28,6 +28,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "frames-inl.h" #include "mips/assembler-mips-inl.h" @@ -97,3 +99,4 @@ Address InternalFrame::GetCallerStackPointer() const { } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 3c29e99..afda2cb 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "codegen-inl.h" #include "compiler.h" #include "debug.h" @@ -271,3 +273,5 @@ void FullCodeGenerator::ExitFinallyBlock() { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/ic-mips.cc b/src/mips/ic-mips.cc index 8c90921..519fe62 100644 --- a/src/mips/ic-mips.cc +++ b/src/mips/ic-mips.cc @@ -29,6 +29,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "codegen-inl.h" #include "ic-inl.h" #include "runtime.h" @@ -215,3 +217,4 @@ void StoreIC::GenerateArrayLength(MacroAssembler* masm) { } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/jump-target-mips.cc b/src/mips/jump-target-mips.cc index 4bd9102..408f75e 100644 --- a/src/mips/jump-target-mips.cc +++ b/src/mips/jump-target-mips.cc @@ -28,6 +28,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "codegen-inl.h" #include "jump-target-inl.h" #include "register-allocator-inl.h" @@ -170,3 +172,4 @@ void BreakTarget::Bind(Result* arg) { } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index c276af5..e096028 100644 --- a/src/mips/macro-assembler-mips.cc +++ b/src/mips/macro-assembler-mips.cc @@ -29,6 +29,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "bootstrapper.h" #include "codegen-inl.h" #include "debug.h" @@ -1321,3 +1323,4 @@ void MacroAssembler::AlignStack(int offset) { } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/register-allocator-mips.cc b/src/mips/register-allocator-mips.cc index f48d3a6..2c5d61b 100644 --- a/src/mips/register-allocator-mips.cc +++ b/src/mips/register-allocator-mips.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "codegen-inl.h" #include "register-allocator-inl.h" @@ -58,3 +60,4 @@ Result RegisterAllocator::AllocateByteRegisterWithoutSpilling() { } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc index bdb3b7f..886b9e4 100644 --- a/src/mips/simulator-mips.cc +++ b/src/mips/simulator-mips.cc @@ -29,6 +29,8 @@ #include #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "disasm.h" #include "assembler.h" #include "globals.h" // Need the BitCast @@ -1646,3 +1648,4 @@ uintptr_t Simulator::PopAddress() { #endif // __mips +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc index 0b2d2c3..faaacbc 100644 --- a/src/mips/stub-cache-mips.cc +++ b/src/mips/stub-cache-mips.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "ic-inl.h" #include "codegen-inl.h" #include "stub-cache.h" @@ -398,3 +400,4 @@ Object* ConstructStubCompiler::CompileConstructStub( } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips/virtual-frame-mips.cc b/src/mips/virtual-frame-mips.cc index c2116de..b61ce75 100644 --- a/src/mips/virtual-frame-mips.cc +++ b/src/mips/virtual-frame-mips.cc @@ -29,6 +29,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_MIPS) + #include "codegen-inl.h" #include "register-allocator-inl.h" #include "scopes.h" @@ -314,3 +316,4 @@ void VirtualFrame::EmitArgumentSlots(RegList reglist) { } } // namespace v8::internal +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc index fcfa8d0..2f47ebd 100644 --- a/src/x64/assembler-x64.cc +++ b/src/x64/assembler-x64.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "macro-assembler.h" #include "serialize.h" @@ -2740,3 +2742,5 @@ const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask | 1 << RelocInfo::JS_RETURN; } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc index c55a4ea..8099feb 100644 --- a/src/x64/builtins-x64.cc +++ b/src/x64/builtins-x64.cc @@ -26,6 +26,9 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "v8.h" + +#if defined(V8_TARGET_ARCH_X64) + #include "codegen-inl.h" #include "macro-assembler.h" @@ -1296,3 +1299,5 @@ void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { } } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc index d9586cc..4a247b3 100644 --- a/src/x64/codegen-x64.cc +++ b/src/x64/codegen-x64.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "bootstrapper.h" #include "codegen-inl.h" #include "compiler.h" @@ -11589,3 +11591,5 @@ ModuloFunction CreateModuloFunction() { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/cpu-x64.cc b/src/x64/cpu-x64.cc index cc20c58..a43a02b 100644 --- a/src/x64/cpu-x64.cc +++ b/src/x64/cpu-x64.cc @@ -33,6 +33,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "cpu.h" #include "macro-assembler.h" @@ -77,3 +79,5 @@ void CPU::DebugBreak() { } } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/debug-x64.cc b/src/x64/debug-x64.cc index 5470912..706017a 100644 --- a/src/x64/debug-x64.cc +++ b/src/x64/debug-x64.cc @@ -28,6 +28,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "codegen-inl.h" #include "debug.h" @@ -216,3 +218,5 @@ void BreakLocationIterator::SetDebugBreakAtReturn() { #endif // ENABLE_DEBUGGER_SUPPORT } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/disasm-x64.cc b/src/x64/disasm-x64.cc index bd912cd..44ffe5f 100644 --- a/src/x64/disasm-x64.cc +++ b/src/x64/disasm-x64.cc @@ -30,6 +30,9 @@ #include #include "v8.h" + +#if defined(V8_TARGET_ARCH_X64) + #include "disasm.h" namespace disasm { @@ -1671,3 +1674,5 @@ void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) { } } // namespace disasm + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/fast-codegen-x64.cc b/src/x64/fast-codegen-x64.cc index 5e76901..13eef03 100644 --- a/src/x64/fast-codegen-x64.cc +++ b/src/x64/fast-codegen-x64.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "codegen-inl.h" #include "fast-codegen.h" #include "scopes.h" @@ -244,3 +246,5 @@ void FastCodeGenerator::Generate(CompilationInfo* compilation_info) { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/frames-x64.cc b/src/x64/frames-x64.cc index 6a0527c..85ebc95 100644 --- a/src/x64/frames-x64.cc +++ b/src/x64/frames-x64.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "frames-inl.h" namespace v8 { @@ -107,3 +109,5 @@ byte* ArgumentsAdaptorFrame::GetCallerStackPointer() const { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index a34a94e..348861b 100644 --- a/src/x64/full-codegen-x64.cc +++ b/src/x64/full-codegen-x64.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "codegen-inl.h" #include "compiler.h" #include "debug.h" @@ -1991,3 +1993,5 @@ void FullCodeGenerator::ExitFinallyBlock() { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc index 88fcfd1..56c4882 100644 --- a/src/x64/ic-x64.cc +++ b/src/x64/ic-x64.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "codegen-inl.h" #include "ic-inl.h" #include "runtime.h" @@ -1619,3 +1621,5 @@ void StoreIC::GenerateArrayLength(MacroAssembler* masm) { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/jump-target-x64.cc b/src/x64/jump-target-x64.cc index 9b08c1f..1208b0d 100644 --- a/src/x64/jump-target-x64.cc +++ b/src/x64/jump-target-x64.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "codegen-inl.h" #include "jump-target-inl.h" #include "register-allocator-inl.h" @@ -431,3 +433,5 @@ void BreakTarget::Bind(Result* arg) { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc index f9b444b..7183a8a 100644 --- a/src/x64/macro-assembler-x64.cc +++ b/src/x64/macro-assembler-x64.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "bootstrapper.h" #include "codegen-inl.h" #include "assembler-x64.h" @@ -2766,3 +2768,5 @@ CodePatcher::~CodePatcher() { } } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/regexp-macro-assembler-x64.cc b/src/x64/regexp-macro-assembler-x64.cc index d9b75b1..383399e 100644 --- a/src/x64/regexp-macro-assembler-x64.cc +++ b/src/x64/regexp-macro-assembler-x64.cc @@ -26,6 +26,9 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "v8.h" + +#if defined(V8_TARGET_ARCH_X64) + #include "serialize.h" #include "unicode.h" #include "log.h" @@ -1368,3 +1371,5 @@ void RegExpMacroAssemblerX64::LoadCurrentCharacterUnchecked(int cp_offset, #endif // V8_INTERPRETED_REGEXP }} // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/register-allocator-x64.cc b/src/x64/register-allocator-x64.cc index cf29593..1f5467e 100644 --- a/src/x64/register-allocator-x64.cc +++ b/src/x64/register-allocator-x64.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "codegen-inl.h" #include "register-allocator-inl.h" #include "virtual-frame-inl.h" @@ -85,3 +87,5 @@ Result RegisterAllocator::AllocateByteRegisterWithoutSpilling() { } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc index 384bca1..b7bf312 100644 --- a/src/x64/stub-cache-x64.cc +++ b/src/x64/stub-cache-x64.cc @@ -28,6 +28,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "ic-inl.h" #include "codegen-inl.h" #include "stub-cache.h" @@ -2367,3 +2369,5 @@ Object* ConstructStubCompiler::CompileConstructStub( #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/src/x64/virtual-frame-x64.cc b/src/x64/virtual-frame-x64.cc index 1e4374b..e140d9f 100644 --- a/src/x64/virtual-frame-x64.cc +++ b/src/x64/virtual-frame-x64.cc @@ -27,6 +27,8 @@ #include "v8.h" +#if defined(V8_TARGET_ARCH_X64) + #include "codegen-inl.h" #include "register-allocator-inl.h" #include "scopes.h" @@ -1163,3 +1165,5 @@ void VirtualFrame::PushTryHandler(HandlerType type) { #undef __ } } // namespace v8::internal + +#endif // V8_TARGET_ARCH_X64 diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp index aa32e0c..5985b9f 100644 --- a/tools/gyp/v8.gyp +++ b/tools/gyp/v8.gyp @@ -39,19 +39,28 @@ 'ENABLE_VMSTATE_TRACKING', ], 'conditions': [ - ['v8_target_arch=="arm"', { - 'defines': [ - 'V8_TARGET_ARCH_ARM', - ], - }], - ['v8_target_arch=="ia32"', { - 'defines': [ - 'V8_TARGET_ARCH_IA32', - ], - }], - ['v8_target_arch=="x64"', { - 'defines': [ - 'V8_TARGET_ARCH_X64', + ['OS!="mac"', { + # TODO(mark): The OS!="mac" conditional is temporary. It can be + # removed once the Mac Chromium build stops setting target_arch to + # ia32 and instead sets it to mac. Other checks in this file for + # OS=="mac" can be removed at that time as well. This can be cleaned + # up once http://crbug.com/44205 is fixed. + 'conditions': [ + ['v8_target_arch=="arm"', { + 'defines': [ + 'V8_TARGET_ARCH_ARM', + ], + }], + ['v8_target_arch=="ia32"', { + 'defines': [ + 'V8_TARGET_ARCH_IA32', + ], + }], + ['v8_target_arch=="x64"', { + 'defines': [ + 'V8_TARGET_ARCH_X64', + ], + }], ], }], ], @@ -477,7 +486,7 @@ }] ] }], - ['v8_target_arch=="ia32"', { + ['v8_target_arch=="ia32" or v8_target_arch=="mac" or OS=="mac"', { 'include_dirs+': [ '../../src/ia32', ], @@ -513,7 +522,7 @@ '../../src/ia32/virtual-frame-ia32.h', ], }], - ['v8_target_arch=="x64"', { + ['v8_target_arch=="x64" or v8_target_arch=="mac" or OS=="mac"', { 'include_dirs+': [ '../../src/x64', ],