From: jkummerow@chromium.org Date: Fri, 28 Jun 2013 15:34:48 +0000 (+0000) Subject: Clean up the usage of V8_TARGET_ARCH_${arch} and V8_HOST_ARCH_${arch} X-Git-Tag: upstream/4.7.83~13621 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7a9bffbcf98213e4cd50a71b4293888ed11a58b;p=platform%2Fupstream%2Fv8.git Clean up the usage of V8_TARGET_ARCH_${arch} and V8_HOST_ARCH_${arch} R=jkummerow@chromium.org Review URL: https://codereview.chromium.org/18037002 Patch from Haitao Feng . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15391 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc index c6ea600..89c0a3b 100644 --- a/src/arm/assembler-arm.cc +++ b/src/arm/assembler-arm.cc @@ -36,7 +36,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "arm/assembler-arm-inl.h" #include "serialize.h" diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc index 6b3caf3..69ba00a 100644 --- a/src/arm/builtins-arm.cc +++ b/src/arm/builtins-arm.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "codegen.h" #include "debug.h" diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index 8e9237c..6af5cce 100755 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "bootstrapper.h" #include "code-stubs.h" @@ -3077,7 +3077,7 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, __ mov(r0, Operand(r4)); __ mov(r1, Operand(r6)); -#if defined(V8_HOST_ARCH_ARM) +#if V8_HOST_ARCH_ARM int frame_alignment = MacroAssembler::ActivationFrameAlignment(); int frame_alignment_mask = frame_alignment - 1; if (FLAG_debug_code) { @@ -7125,7 +7125,7 @@ void ProfileEntryHookStub::Generate(MacroAssembler* masm) { __ and_(sp, sp, Operand(-frame_alignment)); } -#if defined(V8_HOST_ARCH_ARM) +#if V8_HOST_ARCH_ARM int32_t entry_hook = reinterpret_cast(masm->isolate()->function_entry_hook()); __ mov(ip, Operand(entry_hook)); diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc index 5b2980a..60de5fc 100644 --- a/src/arm/codegen-arm.cc +++ b/src/arm/codegen-arm.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "codegen.h" #include "macro-assembler.h" diff --git a/src/arm/constants-arm.cc b/src/arm/constants-arm.cc index a130484..7d59a84 100644 --- a/src/arm/constants-arm.cc +++ b/src/arm/constants-arm.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "constants-arm.h" diff --git a/src/arm/cpu-arm.cc b/src/arm/cpu-arm.cc index 101cd9f..8766a24 100644 --- a/src/arm/cpu-arm.cc +++ b/src/arm/cpu-arm.cc @@ -32,7 +32,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "cpu.h" #include "macro-assembler.h" diff --git a/src/arm/debug-arm.cc b/src/arm/debug-arm.cc index 2f0a7c4..7faea08 100644 --- a/src/arm/debug-arm.cc +++ b/src/arm/debug-arm.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "codegen.h" #include "debug.h" diff --git a/src/arm/disasm-arm.cc b/src/arm/disasm-arm.cc index f55552d..6101bec 100644 --- a/src/arm/disasm-arm.cc +++ b/src/arm/disasm-arm.cc @@ -56,7 +56,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "constants-arm.h" #include "disasm.h" diff --git a/src/arm/frames-arm.cc b/src/arm/frames-arm.cc index 72fc5ce..b207180 100644 --- a/src/arm/frames-arm.cc +++ b/src/arm/frames-arm.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "assembler.h" #include "assembler-arm.h" diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index 357f0af..41f02be 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "code-stubs.h" #include "codegen.h" diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc index cc78151..89ebfde 100644 --- a/src/arm/ic-arm.cc +++ b/src/arm/ic-arm.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "assembler-arm.h" #include "code-stubs.h" diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc index fb379e2..9e4dc40 100644 --- a/src/arm/macro-assembler-arm.cc +++ b/src/arm/macro-assembler-arm.cc @@ -29,7 +29,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "bootstrapper.h" #include "codegen.h" @@ -985,19 +985,19 @@ void MacroAssembler::InitializeNewString(Register string, int MacroAssembler::ActivationFrameAlignment() { -#if defined(V8_HOST_ARCH_ARM) +#if V8_HOST_ARCH_ARM // Running on the real platform. Use the alignment as mandated by the local // environment. // Note: This will break if we ever start generating snapshots on one ARM // platform for another ARM platform with a different alignment. return OS::ActivationFrameAlignment(); -#else // defined(V8_HOST_ARCH_ARM) +#else // V8_HOST_ARCH_ARM // If we are using the simulator then we should always align to the expected // alignment. As the simulator is used to generate snapshots we do not know // if the target platform will need alignment, so this is controlled from a // flag. return FLAG_sim_stack_alignment; -#endif // defined(V8_HOST_ARCH_ARM) +#endif // V8_HOST_ARCH_ARM } @@ -3403,7 +3403,7 @@ void MacroAssembler::CallCFunctionHelper(Register function, // Make sure that the stack is aligned before calling a C function unless // running in the simulator. The simulator has its own alignment check which // provides more information. -#if defined(V8_HOST_ARCH_ARM) +#if V8_HOST_ARCH_ARM if (emit_debug_code()) { int frame_alignment = OS::ActivationFrameAlignment(); int frame_alignment_mask = frame_alignment - 1; diff --git a/src/arm/regexp-macro-assembler-arm.cc b/src/arm/regexp-macro-assembler-arm.cc index f05cba5..0acb737 100644 --- a/src/arm/regexp-macro-assembler-arm.cc +++ b/src/arm/regexp-macro-assembler-arm.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "unicode.h" #include "log.h" diff --git a/src/arm/simulator-arm.cc b/src/arm/simulator-arm.cc index a29d461..238632a 100644 --- a/src/arm/simulator-arm.cc +++ b/src/arm/simulator-arm.cc @@ -30,7 +30,7 @@ #include #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "disasm.h" #include "assembler.h" diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc index 21cb802..c154f9a 100644 --- a/src/arm/stub-cache-arm.cc +++ b/src/arm/stub-cache-arm.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_ARM #include "ic-inl.h" #include "codegen.h" diff --git a/src/assembler.cc b/src/assembler.cc index 626fd4f..b669e09 100644 --- a/src/assembler.cc +++ b/src/assembler.cc @@ -1308,7 +1308,7 @@ ExternalReference ExternalReference::address_of_the_hole_nan() { ExternalReference ExternalReference::re_check_stack_guard_state( Isolate* isolate) { Address function; -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 function = FUNCTION_ADDR(RegExpMacroAssemblerX64::CheckStackGuardState); #elif V8_TARGET_ARCH_IA32 function = FUNCTION_ADDR(RegExpMacroAssemblerIA32::CheckStackGuardState); diff --git a/src/atomicops.h b/src/atomicops.h index ebca91d..b18b54d 100644 --- a/src/atomicops.h +++ b/src/atomicops.h @@ -154,17 +154,17 @@ Atomic64 Release_Load(volatile const Atomic64* ptr); #if defined(THREAD_SANITIZER) #include "atomicops_internals_tsan.h" #elif defined(_MSC_VER) && \ - (defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64)) + (V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64) #include "atomicops_internals_x86_msvc.h" #elif defined(__APPLE__) && \ - (defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64)) + (V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64) #include "atomicops_internals_x86_macosx.h" #elif defined(__GNUC__) && \ - (defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64)) + (V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64) #include "atomicops_internals_x86_gcc.h" -#elif defined(__GNUC__) && defined(V8_HOST_ARCH_ARM) +#elif defined(__GNUC__) && V8_HOST_ARCH_ARM #include "atomicops_internals_arm_gcc.h" -#elif defined(__GNUC__) && defined(V8_HOST_ARCH_MIPS) +#elif defined(__GNUC__) && V8_HOST_ARCH_MIPS #include "atomicops_internals_mips_gcc.h" #else #error "Atomic operations are not supported on your platform" diff --git a/src/code-stubs.h b/src/code-stubs.h index c7076b6..d197c84 100644 --- a/src/code-stubs.h +++ b/src/code-stubs.h @@ -95,7 +95,7 @@ namespace internal { V(KeyedLoadField) // List of code stubs only used on ARM platforms. -#ifdef V8_TARGET_ARCH_ARM +#if V8_TARGET_ARCH_ARM #define CODE_STUB_LIST_ARM(V) \ V(GetProperty) \ V(SetProperty) \ @@ -107,7 +107,7 @@ namespace internal { #endif // List of code stubs only used on MIPS platforms. -#ifdef V8_TARGET_ARCH_MIPS +#if V8_TARGET_ARCH_MIPS #define CODE_STUB_LIST_MIPS(V) \ V(RegExpCEntry) \ V(DirectCEntry) diff --git a/src/execution.h b/src/execution.h index 3cdbf63..c6bf63d 100644 --- a/src/execution.h +++ b/src/execution.h @@ -253,7 +253,7 @@ class StackGuard { void EnableInterrupts(); void DisableInterrupts(); -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe); static const uintptr_t kIllegalLimit = V8_UINT64_C(0xfffffffffffffff8); #else diff --git a/src/flags.cc b/src/flags.cc index 282bf20..855e207 100644 --- a/src/flags.cc +++ b/src/flags.cc @@ -34,7 +34,7 @@ #include "smart-pointers.h" #include "string-stream.h" -#ifdef V8_TARGET_ARCH_ARM +#if V8_TARGET_ARCH_ARM #include "arm/assembler-arm-inl.h" #endif @@ -520,7 +520,7 @@ void FlagList::ResetAllFlags() { // static void FlagList::PrintHelp() { -#ifdef V8_TARGET_ARCH_ARM +#if V8_TARGET_ARCH_ARM CpuFeatures::PrintTarget(); CpuFeatures::Probe(); CpuFeatures::PrintFeatures(); diff --git a/src/frames.cc b/src/frames.cc index edd5ddd..e883c98 100644 --- a/src/frames.cc +++ b/src/frames.cc @@ -423,7 +423,7 @@ StackFrame::Type StackFrame::GetCallerState(State* state) const { Address StackFrame::UnpaddedFP() const { -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 if (!is_optimized()) return fp(); int32_t alignment_state = Memory::int32_at( fp() + JavaScriptFrameConstants::kDynamicAlignmentStateOffset); diff --git a/src/full-codegen.h b/src/full-codegen.h index dc5ac6a..7e64506 100644 --- a/src/full-codegen.h +++ b/src/full-codegen.h @@ -332,7 +332,7 @@ class FullCodeGenerator: public AstVisitor { // Helper function to split control flow and avoid a branch to the // fall-through label if it is set up. -#ifdef V8_TARGET_ARCH_MIPS +#if V8_TARGET_ARCH_MIPS void Split(Condition cc, Register lhs, const Operand& rhs, diff --git a/src/gdb-jit.cc b/src/gdb-jit.cc index dee115c..f4a7c2d 100644 --- a/src/gdb-jit.cc +++ b/src/gdb-jit.cc @@ -217,7 +217,7 @@ class DebugSectionBase : public ZoneObject { struct MachOSectionHeader { char sectname[16]; char segname[16]; -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 uint32_t addr; uint32_t size; #else @@ -525,7 +525,7 @@ class MachO BASE_EMBEDDED { uint32_t ncmds; uint32_t sizeofcmds; uint32_t flags; -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 uint32_t reserved; #endif }; @@ -534,7 +534,7 @@ class MachO BASE_EMBEDDED { uint32_t cmd; uint32_t cmdsize; char segname[16]; -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 uint32_t vmaddr; uint32_t vmsize; uint32_t fileoff; @@ -560,11 +560,11 @@ class MachO BASE_EMBEDDED { Writer::Slot WriteHeader(Writer* w) { ASSERT(w->position() == 0); Writer::Slot header = w->CreateSlotHere(); -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 header->magic = 0xFEEDFACEu; header->cputype = 7; // i386 header->cpusubtype = 3; // CPU_SUBTYPE_I386_ALL -#elif defined(V8_TARGET_ARCH_X64) +#elif V8_TARGET_ARCH_X64 header->magic = 0xFEEDFACFu; header->cputype = 7 | 0x01000000; // i386 | 64-bit ABI header->cpusubtype = 3; // CPU_SUBTYPE_I386_ALL @@ -585,7 +585,7 @@ class MachO BASE_EMBEDDED { uintptr_t code_size) { Writer::Slot cmd = w->CreateSlotHere(); -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 cmd->cmd = LC_SEGMENT_32; #else cmd->cmd = LC_SEGMENT_64; @@ -672,10 +672,10 @@ class ELF BASE_EMBEDDED { void WriteHeader(Writer* w) { ASSERT(w->position() == 0); Writer::Slot header = w->CreateSlotHere(); -#if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM const uint8_t ident[16] = { 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -#elif defined(V8_TARGET_ARCH_X64) +#elif V8_TARGET_ARCH_X64 const uint8_t ident[16] = { 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; #else @@ -683,14 +683,14 @@ class ELF BASE_EMBEDDED { #endif OS::MemCopy(header->ident, ident, 16); header->type = 1; -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 header->machine = 3; -#elif defined(V8_TARGET_ARCH_X64) +#elif V8_TARGET_ARCH_X64 // Processor identification value for x64 is 62 as defined in // System V ABI, AMD64 Supplement // http://www.x86-64.org/documentation/abi.pdf header->machine = 62; -#elif defined(V8_TARGET_ARCH_ARM) +#elif V8_TARGET_ARCH_ARM // Set to EM_ARM, defined as 40, in "ARM ELF File Format" at // infocenter.arm.com/help/topic/com.arm.doc.dui0101a/DUI0101A_Elf.pdf header->machine = 40; @@ -784,7 +784,7 @@ class ELFSymbol BASE_EMBEDDED { Binding binding() const { return static_cast(info >> 4); } -#if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_ARM) +#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM struct SerializedLayout { SerializedLayout(uint32_t name, uintptr_t value, @@ -807,7 +807,7 @@ class ELFSymbol BASE_EMBEDDED { uint8_t other; uint16_t section; }; -#elif defined(V8_TARGET_ARCH_X64) +#elif V8_TARGET_ARCH_X64 struct SerializedLayout { SerializedLayout(uint32_t name, uintptr_t value, @@ -921,7 +921,7 @@ class ELFSymbolTable : public ELFSection { class CodeDescription BASE_EMBEDDED { public: -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 enum StackState { POST_RBP_PUSH, POST_RBP_SET, @@ -984,7 +984,7 @@ class CodeDescription BASE_EMBEDDED { lineinfo_ != NULL; } -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 uintptr_t GetStackStateStartAddress(StackState state) const { ASSERT(state < STACK_STATE_MAX); return stack_state_start_addresses_[state]; @@ -1012,7 +1012,7 @@ class CodeDescription BASE_EMBEDDED { GDBJITLineInfo* lineinfo_; GDBJITInterface::CodeTag tag_; CompilationInfo* info_; -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 uintptr_t stack_state_start_addresses_[STACK_STATE_MAX]; #endif }; @@ -1106,13 +1106,13 @@ class DebugInfoSection : public DebugSection { w->Write(desc_->CodeStart() + desc_->CodeSize()); Writer::Slot fb_block_size = w->CreateSlotHere(); uintptr_t fb_block_start = w->position(); -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 w->Write(DW_OP_reg5); // The frame pointer's here on ia32 -#elif defined(V8_TARGET_ARCH_X64) +#elif V8_TARGET_ARCH_X64 w->Write(DW_OP_reg6); // and here on x64. -#elif defined(V8_TARGET_ARCH_ARM) +#elif V8_TARGET_ARCH_ARM UNIMPLEMENTED(); -#elif defined(V8_TARGET_ARCH_MIPS) +#elif V8_TARGET_ARCH_MIPS UNIMPLEMENTED(); #else #error Unsupported target architecture. @@ -1563,7 +1563,7 @@ class DebugLineSection : public DebugSection { }; -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 class UnwindInfoSection : public DebugSection { public: @@ -1797,7 +1797,7 @@ static void CreateDWARFSections(CodeDescription* desc, obj->AddSection(new(zone) DebugAbbrevSection(desc), zone); obj->AddSection(new(zone) DebugLineSection(desc), zone); } -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 obj->AddSection(new(zone) UnwindInfoSection(desc), zone); #endif } @@ -2015,7 +2015,7 @@ void GDBJITInterface::AddCode(Handle name, } static void AddUnwindInfo(CodeDescription* desc) { -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 if (desc->tag() == GDBJITInterface::FUNCTION) { // To avoid propagating unwinding information through // compilation pipeline we use an approximation. diff --git a/src/globals.h b/src/globals.h index 573e19a..baacf52 100644 --- a/src/globals.h +++ b/src/globals.h @@ -105,8 +105,8 @@ namespace internal { // 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 !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && \ + !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS #if defined(_M_X64) || defined(__x86_64__) #define V8_TARGET_ARCH_X64 1 #elif defined(_M_IX86) || defined(__i386__) @@ -121,18 +121,16 @@ namespace internal { #endif // Check for supported combinations of host and target architectures. -#if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 && !V8_HOST_ARCH_IA32 #error Target architecture ia32 is only supported on ia32 host #endif -#if defined(V8_TARGET_ARCH_X64) && !defined(V8_HOST_ARCH_X64) +#if V8_TARGET_ARCH_X64 && !V8_HOST_ARCH_X64 #error Target architecture x64 is only supported on x64 host #endif -#if (defined(V8_TARGET_ARCH_ARM) && \ - !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM))) +#if (V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM)) #error Target architecture arm is only supported on arm and ia32 host #endif -#if (defined(V8_TARGET_ARCH_MIPS) && \ - !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS))) +#if (V8_TARGET_ARCH_MIPS && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_MIPS)) #error Target architecture mips is only supported on mips and ia32 host #endif @@ -140,22 +138,22 @@ namespace internal { // Setting USE_SIMULATOR explicitly from the build script will force // the use of a simulated environment. #if !defined(USE_SIMULATOR) -#if (defined(V8_TARGET_ARCH_ARM) && !defined(V8_HOST_ARCH_ARM)) +#if (V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM) #define USE_SIMULATOR 1 #endif -#if (defined(V8_TARGET_ARCH_MIPS) && !defined(V8_HOST_ARCH_MIPS)) +#if (V8_TARGET_ARCH_MIPS && !V8_HOST_ARCH_MIPS) #define USE_SIMULATOR 1 #endif #endif // Determine architecture endiannes (we only support little-endian). -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #define V8_TARGET_LITTLE_ENDIAN 1 -#elif defined(V8_TARGET_ARCH_X64) +#elif V8_TARGET_ARCH_X64 #define V8_TARGET_LITTLE_ENDIAN 1 -#elif defined(V8_TARGET_ARCH_ARM) +#elif V8_TARGET_ARCH_ARM #define V8_TARGET_LITTLE_ENDIAN 1 -#elif defined(V8_TARGET_ARCH_MIPS) +#elif V8_TARGET_ARCH_MIPS #define V8_TARGET_LITTLE_ENDIAN 1 #else #error Unknown target architecture endiannes diff --git a/src/heap.cc b/src/heap.cc index 6196228..3fac601 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -66,7 +66,7 @@ Heap::Heap() : isolate_(NULL), // semispace_size_ should be a power of 2 and old_generation_size_ should be // a multiple of Page::kPageSize. -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #define LUMP_OF_MEMORY (2 * MB) code_range_size_(512*MB), #else diff --git a/src/heap.h b/src/heap.h index b3a4205..52ff64a 100644 --- a/src/heap.h +++ b/src/heap.h @@ -1955,7 +1955,7 @@ class Heap { int scan_on_scavenge_pages_; -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 static const int kMaxObjectSizeInNewSpace = 1024*KB; #else static const int kMaxObjectSizeInNewSpace = 512*KB; diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index 98fa93f..932fd47 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -1566,7 +1566,7 @@ HValue* HUnaryMathOperation::Canonicalize() { HValue* new_right = LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(right); if (new_right == NULL && -#ifdef V8_TARGET_ARCH_ARM +#if V8_TARGET_ARCH_ARM CpuFeatures::IsSupported(SUDIV) && #endif hdiv->observed_input_representation(2).IsSmiOrInteger32()) { diff --git a/src/hydrogen.cc b/src/hydrogen.cc index d3b9aa8..2cf7af4 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -7632,7 +7632,7 @@ bool HOptimizedGraphBuilder::TryInline(CallKind call_kind, return false; } -#if !defined(V8_TARGET_ARCH_IA32) +#if !V8_TARGET_ARCH_IA32 // Target must be able to use caller's context. CompilationInfo* outer_info = current_info(); if (target->context() != outer_info->closure()->context() || @@ -7781,7 +7781,7 @@ bool HOptimizedGraphBuilder::TryInline(CallKind call_kind, undefined, function_state()->inlining_kind(), undefined_receiver); -#ifdef V8_TARGET_ARCH_IA32 +#if V8_TARGET_ARCH_IA32 // IA32 only, overwrite the caller's context in the deoptimization // environment with the correct one. // diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc index c0b2abd..7bb643a 100644 --- a/src/ia32/assembler-ia32.cc +++ b/src/ia32/assembler-ia32.cc @@ -36,7 +36,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "disassembler.h" #include "macro-assembler.h" diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc index 93400ae..8aa6e4a 100644 --- a/src/ia32/builtins-ia32.cc +++ b/src/ia32/builtins-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "codegen.h" #include "deoptimizer.h" diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc index 8cd4685..29a4be2 100644 --- a/src/ia32/code-stubs-ia32.cc +++ b/src/ia32/code-stubs-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "bootstrapper.h" #include "code-stubs.h" diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc index d562238..da32c50 100644 --- a/src/ia32/codegen-ia32.cc +++ b/src/ia32/codegen-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "codegen.h" #include "heap.h" diff --git a/src/ia32/cpu-ia32.cc b/src/ia32/cpu-ia32.cc index 2d83cab..77ff169 100644 --- a/src/ia32/cpu-ia32.cc +++ b/src/ia32/cpu-ia32.cc @@ -33,7 +33,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "cpu.h" #include "macro-assembler.h" diff --git a/src/ia32/debug-ia32.cc b/src/ia32/debug-ia32.cc index a4c6bcc..db1d5a6 100644 --- a/src/ia32/debug-ia32.cc +++ b/src/ia32/debug-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "codegen.h" #include "debug.h" diff --git a/src/ia32/deoptimizer-ia32.cc b/src/ia32/deoptimizer-ia32.cc index 16befa9..6af2445 100644 --- a/src/ia32/deoptimizer-ia32.cc +++ b/src/ia32/deoptimizer-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "codegen.h" #include "deoptimizer.h" diff --git a/src/ia32/disasm-ia32.cc b/src/ia32/disasm-ia32.cc index 9eb0d29..14e5800 100644 --- a/src/ia32/disasm-ia32.cc +++ b/src/ia32/disasm-ia32.cc @@ -31,7 +31,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "disasm.h" diff --git a/src/ia32/frames-ia32.cc b/src/ia32/frames-ia32.cc index 61d6876..5570811 100644 --- a/src/ia32/frames-ia32.cc +++ b/src/ia32/frames-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "assembler.h" #include "assembler-ia32.h" diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index d04fdd4..cf3132d 100644 --- a/src/ia32/full-codegen-ia32.cc +++ b/src/ia32/full-codegen-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "code-stubs.h" #include "codegen.h" diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc index 10d6c86..eb6ccd9 100644 --- a/src/ia32/ic-ia32.cc +++ b/src/ia32/ic-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "codegen.h" #include "ic-inl.h" diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 694ae13..96fb98e 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "ia32/lithium-codegen-ia32.h" #include "ic.h" diff --git a/src/ia32/lithium-gap-resolver-ia32.cc b/src/ia32/lithium-gap-resolver-ia32.cc index 3da8f32..86bfe2f 100644 --- a/src/ia32/lithium-gap-resolver-ia32.cc +++ b/src/ia32/lithium-gap-resolver-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "ia32/lithium-gap-resolver-ia32.h" #include "ia32/lithium-codegen-ia32.h" diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index 04b8934..c01cf8c 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "lithium-allocator-inl.h" #include "ia32/lithium-ia32.h" diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc index 31e9e53..63477aa 100644 --- a/src/ia32/macro-assembler-ia32.cc +++ b/src/ia32/macro-assembler-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "bootstrapper.h" #include "codegen.h" diff --git a/src/ia32/regexp-macro-assembler-ia32.cc b/src/ia32/regexp-macro-assembler-ia32.cc index 9a166d7..54fe8bf 100644 --- a/src/ia32/regexp-macro-assembler-ia32.cc +++ b/src/ia32/regexp-macro-assembler-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "unicode.h" #include "log.h" diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc index 1a51016..28e043d 100644 --- a/src/ia32/stub-cache-ia32.cc +++ b/src/ia32/stub-cache-ia32.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 #include "ic-inl.h" #include "codegen.h" diff --git a/src/isolate.cc b/src/isolate.cc index 2383399..e67eb0c 100644 --- a/src/isolate.cc +++ b/src/isolate.cc @@ -116,7 +116,7 @@ void ThreadLocalTop::InitializeInternal() { void ThreadLocalTop::Initialize() { InitializeInternal(); #ifdef USE_SIMULATOR -#ifdef V8_TARGET_ARCH_ARM +#if V8_TARGET_ARCH_ARM simulator_ = Simulator::current(isolate_); #elif V8_TARGET_ARCH_MIPS simulator_ = Simulator::current(isolate_); @@ -1625,7 +1625,7 @@ char* Isolate::RestoreThread(char* from) { // This might be just paranoia, but it seems to be needed in case a // thread_local_top_ is restored on a separate OS thread. #ifdef USE_SIMULATOR -#ifdef V8_TARGET_ARCH_ARM +#if V8_TARGET_ARCH_ARM thread_local_top()->simulator_ = Simulator::current(this); #elif V8_TARGET_ARCH_MIPS thread_local_top()->simulator_ = Simulator::current(this); @@ -1776,8 +1776,8 @@ Isolate::Isolate() thread_manager_ = new ThreadManager(); thread_manager_->isolate_ = this; -#if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \ - defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__) +#if V8_TARGET_ARCH_ARM && !defined(__arm__) || \ + V8_TARGET_ARCH_MIPS && !defined(__mips__) simulator_initialized_ = false; simulator_i_cache_ = NULL; simulator_redirection_ = NULL; @@ -2134,7 +2134,7 @@ bool Isolate::Init(Deserializer* des) { // Initialize other runtime facilities #if defined(USE_SIMULATOR) -#if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS Simulator::Initialize(this); #endif #endif diff --git a/src/isolate.h b/src/isolate.h index 981f81c..7bf53ea 100644 --- a/src/isolate.h +++ b/src/isolate.h @@ -101,8 +101,8 @@ class Debugger; class DebuggerAgent; #endif -#if !defined(__arm__) && defined(V8_TARGET_ARCH_ARM) || \ - !defined(__mips__) && defined(V8_TARGET_ARCH_MIPS) +#if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ + !defined(__mips__) && V8_TARGET_ARCH_MIPS class Redirection; class Simulator; #endif @@ -263,7 +263,7 @@ class ThreadLocalTop BASE_EMBEDDED { Address handler_; // try-blocks are chained through the stack #ifdef USE_SIMULATOR -#if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS Simulator* simulator_; #endif #endif // USE_SIMULATOR @@ -391,8 +391,8 @@ class Isolate { thread_id_(thread_id), stack_limit_(0), thread_state_(NULL), -#if !defined(__arm__) && defined(V8_TARGET_ARCH_ARM) || \ - !defined(__mips__) && defined(V8_TARGET_ARCH_MIPS) +#if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ + !defined(__mips__) && V8_TARGET_ARCH_MIPS simulator_(NULL), #endif next_(NULL), @@ -404,8 +404,8 @@ class Isolate { ThreadState* thread_state() const { return thread_state_; } void set_thread_state(ThreadState* value) { thread_state_ = value; } -#if !defined(__arm__) && defined(V8_TARGET_ARCH_ARM) || \ - !defined(__mips__) && defined(V8_TARGET_ARCH_MIPS) +#if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ + !defined(__mips__) && V8_TARGET_ARCH_MIPS Simulator* simulator() const { return simulator_; } void set_simulator(Simulator* simulator) { simulator_ = simulator; @@ -422,8 +422,8 @@ class Isolate { uintptr_t stack_limit_; ThreadState* thread_state_; -#if !defined(__arm__) && defined(V8_TARGET_ARCH_ARM) || \ - !defined(__mips__) && defined(V8_TARGET_ARCH_MIPS) +#if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ + !defined(__mips__) && V8_TARGET_ARCH_MIPS Simulator* simulator_; #endif @@ -994,8 +994,8 @@ class Isolate { int* code_kind_statistics() { return code_kind_statistics_; } #endif -#if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \ - defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__) +#if V8_TARGET_ARCH_ARM && !defined(__arm__) || \ + V8_TARGET_ARCH_MIPS && !defined(__mips__) bool simulator_initialized() { return simulator_initialized_; } void set_simulator_initialized(bool initialized) { simulator_initialized_ = initialized; @@ -1301,8 +1301,8 @@ class Isolate { // Time stamp at initialization. double time_millis_at_init_; -#if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \ - defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__) +#if V8_TARGET_ARCH_ARM && !defined(__arm__) || \ + V8_TARGET_ARCH_MIPS && !defined(__mips__) bool simulator_initialized_; HashMap* simulator_i_cache_; Redirection* simulator_redirection_; diff --git a/src/mips/assembler-mips.cc b/src/mips/assembler-mips.cc index eee79a2..c4fefcc 100644 --- a/src/mips/assembler-mips.cc +++ b/src/mips/assembler-mips.cc @@ -35,7 +35,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "mips/assembler-mips-inl.h" #include "serialize.h" @@ -1475,7 +1475,7 @@ void Assembler::break_(uint32_t code, bool break_as_stop) { void Assembler::stop(const char* msg, uint32_t code) { ASSERT(code > kMaxWatchpointCode); ASSERT(code <= kMaxStopCode); -#if defined(V8_HOST_ARCH_MIPS) +#if V8_HOST_ARCH_MIPS break_(0x54321); #else // V8_HOST_ARCH_MIPS BlockTrampolinePoolFor(2); diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc index e9188ef..dcadb5a 100644 --- a/src/mips/builtins-mips.cc +++ b/src/mips/builtins-mips.cc @@ -29,7 +29,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "codegen.h" #include "debug.h" diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index 2da8fc0..01c824d 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "bootstrapper.h" #include "code-stubs.h" @@ -7540,7 +7540,7 @@ void ProfileEntryHookStub::Generate(MacroAssembler* masm) { __ And(sp, sp, Operand(-frame_alignment)); } -#if defined(V8_HOST_ARCH_MIPS) +#if V8_HOST_ARCH_MIPS __ li(at, Operand(reinterpret_cast(&entry_hook_))); __ lw(at, MemOperand(at)); #else diff --git a/src/mips/codegen-mips.cc b/src/mips/codegen-mips.cc index 72eb00b..7a95bc4 100644 --- a/src/mips/codegen-mips.cc +++ b/src/mips/codegen-mips.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "codegen.h" #include "macro-assembler.h" diff --git a/src/mips/constants-mips.cc b/src/mips/constants-mips.cc index ddfa891..a20ec54 100644 --- a/src/mips/constants-mips.cc +++ b/src/mips/constants-mips.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "constants-mips.h" diff --git a/src/mips/cpu-mips.cc b/src/mips/cpu-mips.cc index 93ebeda..d13b233 100644 --- a/src/mips/cpu-mips.cc +++ b/src/mips/cpu-mips.cc @@ -36,7 +36,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "cpu.h" #include "macro-assembler.h" diff --git a/src/mips/debug-mips.cc b/src/mips/debug-mips.cc index 0ae0187..30cc4db 100644 --- a/src/mips/debug-mips.cc +++ b/src/mips/debug-mips.cc @@ -29,7 +29,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "codegen.h" #include "debug.h" diff --git a/src/mips/disasm-mips.cc b/src/mips/disasm-mips.cc index b787f13..708df39 100644 --- a/src/mips/disasm-mips.cc +++ b/src/mips/disasm-mips.cc @@ -56,7 +56,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "mips/constants-mips.h" #include "disasm.h" diff --git a/src/mips/frames-mips.cc b/src/mips/frames-mips.cc index d070b56..1bd5116 100644 --- a/src/mips/frames-mips.cc +++ b/src/mips/frames-mips.cc @@ -28,7 +28,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "assembler.h" #include "assembler-mips.h" diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index d416a3b..032c1f5 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS // Note on Mips implementation: // diff --git a/src/mips/ic-mips.cc b/src/mips/ic-mips.cc index 8a00f60..896e030 100644 --- a/src/mips/ic-mips.cc +++ b/src/mips/ic-mips.cc @@ -29,7 +29,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "codegen.h" #include "code-stubs.h" diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index 3e3314a..5890347 100644 --- a/src/mips/macro-assembler-mips.cc +++ b/src/mips/macro-assembler-mips.cc @@ -29,7 +29,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "bootstrapper.h" #include "codegen.h" @@ -4723,19 +4723,19 @@ void MacroAssembler::InitializeNewString(Register string, int MacroAssembler::ActivationFrameAlignment() { -#if defined(V8_HOST_ARCH_MIPS) +#if V8_HOST_ARCH_MIPS // Running on the real platform. Use the alignment as mandated by the local // environment. // Note: This will break if we ever start generating snapshots on one Mips // platform for another Mips platform with a different alignment. return OS::ActivationFrameAlignment(); -#else // defined(V8_HOST_ARCH_MIPS) +#else // V8_HOST_ARCH_MIPS // If we are using the simulator then we should always align to the expected // alignment. As the simulator is used to generate snapshots we do not know // if the target platform will need alignment, so this is controlled from a // flag. return FLAG_sim_stack_alignment; -#endif // defined(V8_HOST_ARCH_MIPS) +#endif // V8_HOST_ARCH_MIPS } @@ -5066,7 +5066,7 @@ void MacroAssembler::CallCFunctionHelper(Register function, // The argument stots are presumed to have been set up by // PrepareCallCFunction. The C function must be called via t9, for mips ABI. -#if defined(V8_HOST_ARCH_MIPS) +#if V8_HOST_ARCH_MIPS if (emit_debug_code()) { int frame_alignment = OS::ActivationFrameAlignment(); int frame_alignment_mask = frame_alignment - 1; diff --git a/src/mips/regexp-macro-assembler-mips.cc b/src/mips/regexp-macro-assembler-mips.cc index 2961519..7b67a7b 100644 --- a/src/mips/regexp-macro-assembler-mips.cc +++ b/src/mips/regexp-macro-assembler-mips.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "unicode.h" #include "log.h" diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc index 8771bd2..914a758 100644 --- a/src/mips/simulator-mips.cc +++ b/src/mips/simulator-mips.cc @@ -31,7 +31,7 @@ #include #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "cpu.h" #include "disasm.h" diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc index caddb76..5221190 100644 --- a/src/mips/stub-cache-mips.cc +++ b/src/mips/stub-cache-mips.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_MIPS #include "ic-inl.h" #include "codegen.h" diff --git a/src/platform-linux.cc b/src/platform-linux.cc index 4a9bb7e..2c6a36c 100644 --- a/src/platform-linux.cc +++ b/src/platform-linux.cc @@ -295,7 +295,7 @@ bool OS::MipsCpuHasFeature(CpuFeature feature) { int OS::ActivationFrameAlignment() { -#ifdef V8_TARGET_ARCH_ARM +#if V8_TARGET_ARCH_ARM // On EABI ARM targets this is required for fp correctness in the // runtime system. return 8; diff --git a/src/platform-macos.cc b/src/platform-macos.cc index b21166d..21e9c7f 100644 --- a/src/platform-macos.cc +++ b/src/platform-macos.cc @@ -583,7 +583,7 @@ static void InitializeTlsBaseOffset() { if (kernel_version_major < 11) { // 8.x.x (Tiger), 9.x.x (Leopard), 10.x.x (Snow Leopard) have the // same offsets. -#if defined(V8_HOST_ARCH_IA32) +#if V8_HOST_ARCH_IA32 kMacTlsBaseOffset = 0x48; #else kMacTlsBaseOffset = 0x60; diff --git a/src/platform-openbsd.cc b/src/platform-openbsd.cc index f2d9dd4..b722e31 100644 --- a/src/platform-openbsd.cc +++ b/src/platform-openbsd.cc @@ -79,7 +79,7 @@ static void* GetRandomMmapAddr() { // CpuFeatures::Probe. We don't care about randomization in this case because // the code page is immediately freed. if (isolate != NULL) { -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 uint64_t rnd1 = V8::RandomPrivate(isolate); uint64_t rnd2 = V8::RandomPrivate(isolate); uint64_t raw_addr = (rnd1 << 32) ^ rnd2; diff --git a/src/platform-posix.cc b/src/platform-posix.cc index f76ec44..e72a5d9 100644 --- a/src/platform-posix.cc +++ b/src/platform-posix.cc @@ -105,7 +105,7 @@ void* OS::GetRandomMmapAddr() { // CpuFeatures::Probe. We don't care about randomization in this case because // the code page is immediately freed. if (isolate != NULL) { -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 uint64_t rnd1 = V8::RandomPrivate(isolate); uint64_t rnd2 = V8::RandomPrivate(isolate); uint64_t raw_addr = (rnd1 << 32) ^ rnd2; @@ -321,7 +321,7 @@ int OS::VSNPrintF(Vector str, } -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 static void MemMoveWrapper(void* dest, const void* src, size_t size) { memmove(dest, src, size); } @@ -344,7 +344,7 @@ void OS::MemMove(void* dest, const void* src, size_t size) { void POSIXPostSetUp() { -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 OS::MemMoveFunction generated_memmove = CreateMemMoveFunction(); if (generated_memmove != NULL) { memmove_function = generated_memmove; diff --git a/src/platform-tls-mac.h b/src/platform-tls-mac.h index 728524e..d1c5907 100644 --- a/src/platform-tls-mac.h +++ b/src/platform-tls-mac.h @@ -33,7 +33,7 @@ namespace v8 { namespace internal { -#if defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64) +#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64 #define V8_FAST_TLS_SUPPORTED 1 @@ -43,7 +43,7 @@ INLINE(intptr_t InternalGetExistingThreadLocal(intptr_t index)); inline intptr_t InternalGetExistingThreadLocal(intptr_t index) { intptr_t result; -#if defined(V8_HOST_ARCH_IA32) +#if V8_HOST_ARCH_IA32 asm("movl %%gs:(%1,%2,4), %0;" :"=r"(result) // Output must be a writable register. :"r"(kMacTlsBaseOffset), "r"(index)); diff --git a/src/platform-win32.cc b/src/platform-win32.cc index 600962e..1913760 100644 --- a/src/platform-win32.cc +++ b/src/platform-win32.cc @@ -147,7 +147,7 @@ double ceiling(double x) { static Mutex* limit_mutex = NULL; -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 static void MemMoveWrapper(void* dest, const void* src, size_t size) { memmove(dest, src, size); } @@ -580,7 +580,7 @@ void OS::PostSetUp() { // Math functions depend on CPU features therefore they are initialized after // CPU. MathSetup(); -#if defined(V8_TARGET_ARCH_IA32) +#if V8_TARGET_ARCH_IA32 OS::MemMoveFunction generated_memmove = CreateMemMoveFunction(); if (generated_memmove != NULL) { memmove_function = generated_memmove; diff --git a/src/strtod.cc b/src/strtod.cc index dfe2fb7..a1774b6 100644 --- a/src/strtod.cc +++ b/src/strtod.cc @@ -175,7 +175,7 @@ static void ReadDiyFp(Vector buffer, static bool DoubleStrtod(Vector trimmed, int exponent, double* result) { -#if (defined(V8_TARGET_ARCH_IA32) || defined(USE_SIMULATOR)) \ +#if (V8_TARGET_ARCH_IA32 || defined(USE_SIMULATOR)) \ && !defined(_MSC_VER) // On x86 the floating-point stack can be 64 or 80 bits wide. If it is // 80 bits wide (as is the case on Linux) then double-rounding occurs and the diff --git a/src/v8utils.h b/src/v8utils.h index 8661f9b..ff9f8f2 100644 --- a/src/v8utils.h +++ b/src/v8utils.h @@ -257,9 +257,9 @@ inline void MemsetPointer(T** dest, U* value, int counter) { a = b; // Fake assignment to check assignability. USE(a); #endif // DEBUG -#if defined(V8_HOST_ARCH_IA32) +#if V8_HOST_ARCH_IA32 #define STOS "stosl" -#elif defined(V8_HOST_ARCH_X64) +#elif V8_HOST_ARCH_X64 #define STOS "stosq" #endif #if defined(__native_client__) diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc index f547e79..3a3ee9c 100644 --- a/src/x64/assembler-x64.cc +++ b/src/x64/assembler-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "macro-assembler.h" #include "serialize.h" diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc index 9376cc7..378217b 100644 --- a/src/x64/builtins-x64.cc +++ b/src/x64/builtins-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "codegen.h" #include "deoptimizer.h" diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc index b912b23..9774638 100644 --- a/src/x64/code-stubs-x64.cc +++ b/src/x64/code-stubs-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "bootstrapper.h" #include "code-stubs.h" diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc index c334742..9643872 100644 --- a/src/x64/codegen-x64.cc +++ b/src/x64/codegen-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "codegen.h" #include "macro-assembler.h" diff --git a/src/x64/cpu-x64.cc b/src/x64/cpu-x64.cc index 80e22c6..96c5330 100644 --- a/src/x64/cpu-x64.cc +++ b/src/x64/cpu-x64.cc @@ -33,7 +33,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "cpu.h" #include "macro-assembler.h" diff --git a/src/x64/debug-x64.cc b/src/x64/debug-x64.cc index 750d929..a337b0d 100644 --- a/src/x64/debug-x64.cc +++ b/src/x64/debug-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "assembler.h" #include "codegen.h" diff --git a/src/x64/deoptimizer-x64.cc b/src/x64/deoptimizer-x64.cc index 60e676a..f2f7ed0 100644 --- a/src/x64/deoptimizer-x64.cc +++ b/src/x64/deoptimizer-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "codegen.h" #include "deoptimizer.h" diff --git a/src/x64/disasm-x64.cc b/src/x64/disasm-x64.cc index fb0914d..d787775 100644 --- a/src/x64/disasm-x64.cc +++ b/src/x64/disasm-x64.cc @@ -31,7 +31,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "disasm.h" #include "lazy-instance.h" diff --git a/src/x64/frames-x64.cc b/src/x64/frames-x64.cc index 21cb79c..5cc27a6 100644 --- a/src/x64/frames-x64.cc +++ b/src/x64/frames-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "assembler.h" #include "assembler-x64.h" diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index 7732a1d..9ad7f58 100644 --- a/src/x64/full-codegen-x64.cc +++ b/src/x64/full-codegen-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "code-stubs.h" #include "codegen.h" diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc index 82112a0..a0f3ead 100644 --- a/src/x64/ic-x64.cc +++ b/src/x64/ic-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "codegen.h" #include "ic-inl.h" diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index f3045d5..c97475a 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "x64/lithium-codegen-x64.h" #include "code-stubs.h" diff --git a/src/x64/lithium-gap-resolver-x64.cc b/src/x64/lithium-gap-resolver-x64.cc index fd74e0a..aed4f36 100644 --- a/src/x64/lithium-gap-resolver-x64.cc +++ b/src/x64/lithium-gap-resolver-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "x64/lithium-gap-resolver-x64.h" #include "x64/lithium-codegen-x64.h" diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index 7a475a7..9c2373a 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "lithium-allocator-inl.h" #include "x64/lithium-x64.h" diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc index 1ff022f..fdeee31 100644 --- a/src/x64/macro-assembler-x64.cc +++ b/src/x64/macro-assembler-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "bootstrapper.h" #include "codegen.h" diff --git a/src/x64/regexp-macro-assembler-x64.cc b/src/x64/regexp-macro-assembler-x64.cc index efb2a65..e1d4a2d 100644 --- a/src/x64/regexp-macro-assembler-x64.cc +++ b/src/x64/regexp-macro-assembler-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "serialize.h" #include "unicode.h" diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc index 9dddd79..1a992b4 100644 --- a/src/x64/stub-cache-x64.cc +++ b/src/x64/stub-cache-x64.cc @@ -27,7 +27,7 @@ #include "v8.h" -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 #include "ic-inl.h" #include "codegen.h" diff --git a/test/cctest/test-hashing.cc b/test/cctest/test-hashing.cc index 4906296..6536269 100644 --- a/test/cctest/test-hashing.cc +++ b/test/cctest/test-hashing.cc @@ -51,7 +51,7 @@ void generate(MacroAssembler* masm, i::Vector string) { // GenerateHashInit takes the first character as an argument so it can't // handle the zero length string. ASSERT(string.length() > 0); -#ifdef V8_TARGET_ARCH_IA32 +#if V8_TARGET_ARCH_IA32 __ push(ebx); __ push(ecx); __ mov(eax, Immediate(0)); @@ -116,7 +116,7 @@ void generate(MacroAssembler* masm, i::Vector string) { void generate(MacroAssembler* masm, uint32_t key) { -#ifdef V8_TARGET_ARCH_IA32 +#if V8_TARGET_ARCH_IA32 __ push(ebx); __ mov(eax, Immediate(key)); __ GetNumberHash(eax, ebx); diff --git a/test/cctest/test-lockers.cc b/test/cctest/test-lockers.cc index 9d24535..072bbff 100644 --- a/test/cctest/test-lockers.cc +++ b/test/cctest/test-lockers.cc @@ -207,7 +207,7 @@ static void StartJoinAndDeleteThreads(const i::List& threads) { // Run many threads all locking on the same isolate TEST(IsolateLockingStress) { -#ifdef V8_TARGET_ARCH_MIPS +#if V8_TARGET_ARCH_MIPS const int kNThreads = 50; #else const int kNThreads = 100; @@ -244,7 +244,7 @@ class IsolateNonlockingThread : public JoinableThread { // Run many threads each accessing its own isolate without locking TEST(MultithreadedParallelIsolates) { -#if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS const int kNThreads = 10; #else const int kNThreads = 50; @@ -282,7 +282,7 @@ class IsolateNestedLockingThread : public JoinableThread { // Run many threads with nested locks TEST(IsolateNestedLocking) { -#ifdef V8_TARGET_ARCH_MIPS +#if V8_TARGET_ARCH_MIPS const int kNThreads = 50; #else const int kNThreads = 100; @@ -323,7 +323,7 @@ class SeparateIsolatesLocksNonexclusiveThread : public JoinableThread { // Run parallel threads that lock and access different isolates in parallel TEST(SeparateIsolatesLocksNonexclusive) { -#if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS const int kNThreads = 50; #else const int kNThreads = 100; @@ -399,7 +399,7 @@ class LockerUnlockerThread : public JoinableThread { // Use unlocker inside of a Locker, multiple threads. TEST(LockerUnlocker) { -#if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS const int kNThreads = 50; #else const int kNThreads = 100; @@ -452,7 +452,7 @@ class LockTwiceAndUnlockThread : public JoinableThread { // Use Unlocker inside two Lockers. TEST(LockTwiceAndUnlock) { -#if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS const int kNThreads = 50; #else const int kNThreads = 100; @@ -573,7 +573,7 @@ class LockUnlockLockThread : public JoinableThread { // Locker inside an Unlocker inside a Locker. TEST(LockUnlockLockMultithreaded) { -#ifdef V8_TARGET_ARCH_MIPS +#if V8_TARGET_ARCH_MIPS const int kNThreads = 50; #else const int kNThreads = 100; @@ -628,7 +628,7 @@ class LockUnlockLockDefaultIsolateThread : public JoinableThread { // Locker inside an Unlocker inside a Locker for default isolate. TEST(LockUnlockLockDefaultIsolateMultithreaded) { -#ifdef V8_TARGET_ARCH_MIPS +#if V8_TARGET_ARCH_MIPS const int kNThreads = 50; #else const int kNThreads = 100; @@ -699,7 +699,7 @@ class IsolateGenesisThread : public JoinableThread { // Test installing extensions in separate isolates concurrently. // http://code.google.com/p/v8/issues/detail?id=1821 TEST(ExtensionsRegistration) { -#if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) +#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS const int kNThreads = 10; #else const int kNThreads = 40; diff --git a/test/cctest/test-macro-assembler-x64.cc b/test/cctest/test-macro-assembler-x64.cc index d4d0edb..3945f1b 100755 --- a/test/cctest/test-macro-assembler-x64.cc +++ b/test/cctest/test-macro-assembler-x64.cc @@ -1131,7 +1131,7 @@ TEST(SmiMul) { void TestSmiDiv(MacroAssembler* masm, Label* exit, int id, int x, int y) { bool division_by_zero = (y == 0); bool negative_zero = (x == 0 && y < 0); -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 bool overflow = (x == Smi::kMinValue && y < 0); // Safe approx. used. #else bool overflow = (x == Smi::kMinValue && y == -1); diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc index f810fcd..f9eed1f 100644 --- a/test/cctest/test-regexp.cc +++ b/test/cctest/test-regexp.cc @@ -44,22 +44,22 @@ #else // V8_INTERPRETED_REGEXP #include "macro-assembler.h" #include "code.h" -#ifdef V8_TARGET_ARCH_ARM +#if V8_TARGET_ARCH_ARM #include "arm/assembler-arm.h" #include "arm/macro-assembler-arm.h" #include "arm/regexp-macro-assembler-arm.h" #endif -#ifdef V8_TARGET_ARCH_MIPS +#if V8_TARGET_ARCH_MIPS #include "mips/assembler-mips.h" #include "mips/macro-assembler-mips.h" #include "mips/regexp-macro-assembler-mips.h" #endif -#ifdef V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 #include "x64/assembler-x64.h" #include "x64/macro-assembler-x64.h" #include "x64/regexp-macro-assembler-x64.h" #endif -#ifdef V8_TARGET_ARCH_IA32 +#if V8_TARGET_ARCH_IA32 #include "ia32/assembler-ia32.h" #include "ia32/macro-assembler-ia32.h" #include "ia32/regexp-macro-assembler-ia32.h"