diff --git a/src/compiler/arm64/instruction-selector-arm64.cc b/src/compiler/arm64/instruction-selector-arm64.cc index 3050244189..bd23dfd17e 100644 --- a/src/compiler/arm64/instruction-selector-arm64.cc +++ b/src/compiler/arm64/instruction-selector-arm64.cc @@ -9,8 +9,6 @@ namespace v8 { namespace internal { namespace compiler { -#if V8_TURBOFAN_TARGET - enum ImmediateMode { kArithimeticImm, // 12 bit unsigned immediate shifted left 0 or 12 bits kShift32Imm, // 0 - 31 @@ -664,8 +662,6 @@ void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, } } -#endif // V8_TURBOFAN_TARGET - } // namespace compiler } // namespace internal } // namespace v8 diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc index dfd18cc4ee..8db8b0b873 100644 --- a/src/compiler/code-generator.cc +++ b/src/compiler/code-generator.cc @@ -287,7 +287,8 @@ void CodeGenerator::BuildTranslation(Instruction* instr, } -#if !V8_TURBOFAN_TARGET +#if !V8_TURBOFAN_BACKEND + void CodeGenerator::AssembleArchInstruction(Instruction* instr) { UNIMPLEMENTED(); } @@ -334,7 +335,7 @@ bool CodeGenerator::IsNopForSmiCodeInlining(Handle code, int start_pc, } #endif -#endif +#endif // !V8_TURBOFAN_BACKEND } // namespace compiler diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc index 651f9ac44d..15ff73966b 100644 --- a/src/compiler/instruction-selector.cc +++ b/src/compiler/instruction-selector.cc @@ -604,7 +604,7 @@ void InstructionSelector::VisitNode(Node* node) { } -#if V8_TURBOFAN_TARGET +#if V8_TURBOFAN_BACKEND void InstructionSelector::VisitWord32Equal(Node* node) { FlagsContinuation cont(kEqual, node); @@ -699,10 +699,10 @@ void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { VisitFloat64Compare(node, &cont); } -#endif // V8_TURBOFAN_TARGET +#endif // V8_TURBOFAN_BACKEND // 32 bit targets do not implement the following instructions. -#if V8_TARGET_ARCH_32_BIT && V8_TURBOFAN_TARGET +#if V8_TARGET_ARCH_32_BIT && V8_TURBOFAN_BACKEND void InstructionSelector::VisitWord64And(Node* node) { UNIMPLEMENTED(); } @@ -752,12 +752,12 @@ void InstructionSelector::VisitConvertInt32ToInt64(Node* node) { UNIMPLEMENTED(); } -#endif // V8_TARGET_ARCH_32_BIT && V8_TURBOFAN_TARGET +#endif // V8_TARGET_ARCH_32_BIT && V8_TURBOFAN_BACKEND // 32-bit targets and unsupported architectures need dummy implementations of // selected 64-bit ops. -#if V8_TARGET_ARCH_32_BIT || !V8_TURBOFAN_TARGET +#if V8_TARGET_ARCH_32_BIT || !V8_TURBOFAN_BACKEND void InstructionSelector::VisitWord64Test(Node* node, FlagsContinuation* cont) { UNIMPLEMENTED(); @@ -769,7 +769,7 @@ void InstructionSelector::VisitWord64Compare(Node* node, UNIMPLEMENTED(); } -#endif // V8_TARGET_ARCH_32_BIT || !V8_TURBOFAN_TARGET +#endif // V8_TARGET_ARCH_32_BIT || !V8_TURBOFAN_BACKEND void InstructionSelector::VisitParameter(Node* node) { @@ -963,7 +963,7 @@ void InstructionSelector::VisitDeoptimization(Node* deopt) { } -#if !V8_TURBOFAN_TARGET +#if !V8_TURBOFAN_BACKEND #define DECLARE_UNIMPLEMENTED_SELECTOR(x) \ void InstructionSelector::Visit##x(Node* node) { UNIMPLEMENTED(); } @@ -1003,7 +1003,7 @@ void InstructionSelector::VisitFloat64Compare(Node* node, void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, BasicBlock* deoptimization) {} -#endif // !V8_TURBOFAN_TARGET +#endif // !V8_TURBOFAN_BACKEND } // namespace compiler } // namespace internal diff --git a/src/compiler/pipeline.h b/src/compiler/pipeline.h index 82af766c3c..f6dd39a34b 100644 --- a/src/compiler/pipeline.h +++ b/src/compiler/pipeline.h @@ -12,16 +12,6 @@ // Note: TODO(turbofan) implies a performance improvement opportunity, // and TODO(name) implies an incomplete implementation -#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM -#ifndef _WIN64 -#define V8_TURBOFAN_TARGET 1 -#else -#define V8_TURBOFAN_TARGET 0 -#endif -#else -#define V8_TURBOFAN_TARGET 0 -#endif - namespace v8 { namespace internal { namespace compiler { @@ -49,6 +39,7 @@ class Pipeline { Zone* zone() { return info_->zone(); } Isolate* isolate() { return info_->isolate(); } + static inline bool SupportedBackend() { return V8_TURBOFAN_BACKEND != 0; } static inline bool SupportedTarget() { return V8_TURBOFAN_TARGET != 0; } static inline bool VerifyGraphs() { diff --git a/src/globals.h b/src/globals.h index 6b6a816497..000fa47bd8 100644 --- a/src/globals.h +++ b/src/globals.h @@ -25,6 +25,19 @@ # define V8_INFINITY INFINITY #endif +#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM || \ + V8_TARGET_ARCH_ARM64 +#define V8_TURBOFAN_BACKEND 1 +#else +#define V8_TURBOFAN_BACKEND 0 +#endif +#if V8_TURBOFAN_BACKEND && !V8_TARGET_ARCH_ARM64 && \ + !(V8_OS_WIN && V8_TARGET_ARCH_X64) +#define V8_TURBOFAN_TARGET 1 +#else +#define V8_TURBOFAN_TARGET 0 +#endif + namespace v8 { namespace base { diff --git a/test/cctest/compiler/test-scheduler.cc b/test/cctest/compiler/test-scheduler.cc index e002d456d1..e33f000b26 100644 --- a/test/cctest/compiler/test-scheduler.cc +++ b/test/cctest/compiler/test-scheduler.cc @@ -1763,7 +1763,7 @@ TEST(BuildScheduleTrivialLazyDeoptCall) { Node* undef_node = graph.NewNode(common_builder.HeapConstant(undef_constant)); - Node* start_node = graph.NewNode(common_builder.Start()); + Node* start_node = graph.NewNode(common_builder.Start(0)); CallDescriptor* descriptor = linkage.GetJSCallDescriptor(0); Node* call_node = graph.NewNode(common_builder.Call(descriptor),