From 218395ebaa0cb616099b7431cfe833c5d851ce91 Mon Sep 17 00:00:00 2001 From: "danno@chromium.org" Date: Thu, 31 Jul 2014 11:59:49 +0000 Subject: [PATCH] Fix MIPS build: use stubbed-out TF implementation R=titzer@chromium.org Review URL: https://codereview.chromium.org/426833005 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22753 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler/code-generator.cc | 52 +++++++++++++++++++ src/compiler/instruction-codes.h | 3 +- src/compiler/instruction-selector.cc | 44 +++++++++++++++- src/compiler/linkage.cc | 2 +- src/lithium-inl.h | 2 + src/mips/simulator-mips.cc | 1 + src/mips64/simulator-mips64.cc | 2 +- test/cctest/compiler/test-codegen-deopt.cc | 5 ++ .../compiler/test-instruction-selector.cc | 4 ++ test/cctest/compiler/test-pipeline.cc | 4 +- test/cctest/compiler/test-scheduler.cc | 4 ++ 11 files changed, 116 insertions(+), 7 deletions(-) diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc index 69eace40b1..94f0d901d1 100644 --- a/src/compiler/code-generator.cc +++ b/src/compiler/code-generator.cc @@ -6,6 +6,7 @@ #include "src/compiler/code-generator-impl.h" #include "src/compiler/linkage.h" +#include "src/compiler/pipeline.h" namespace v8 { namespace internal { @@ -285,6 +286,57 @@ void CodeGenerator::BuildTranslation(Instruction* instr, new (zone()) DeoptimizationState(translation.index()); } + +#if !V8_TURBOFAN_TARGET +void CodeGenerator::AssembleArchInstruction(Instruction* instr) { + UNIMPLEMENTED(); +} + + +void CodeGenerator::AssembleArchBranch(Instruction* instr, + FlagsCondition condition) { + UNIMPLEMENTED(); +} + + +void CodeGenerator::AssembleArchBoolean(Instruction* instr, + FlagsCondition condition) { + UNIMPLEMENTED(); +} + + +void CodeGenerator::AssemblePrologue() { UNIMPLEMENTED(); } + + +void CodeGenerator::AssembleReturn() { UNIMPLEMENTED(); } + + +void CodeGenerator::AssembleMove(InstructionOperand* source, + InstructionOperand* destination) { + UNIMPLEMENTED(); +} + + +void CodeGenerator::AssembleSwap(InstructionOperand* source, + InstructionOperand* destination) { + UNIMPLEMENTED(); +} + + +void CodeGenerator::AddNopForSmiCodeInlining() { UNIMPLEMENTED(); } + + +#ifdef DEBUG +bool CodeGenerator::IsNopForSmiCodeInlining(Handle code, int start_pc, + int end_pc) { + UNIMPLEMENTED(); + return false; +} +#endif + +#endif + + } // namespace compiler } // namespace internal } // namespace v8 diff --git a/src/compiler/instruction-codes.h b/src/compiler/instruction-codes.h index 6e59f9cde8..a627748cb2 100644 --- a/src/compiler/instruction-codes.h +++ b/src/compiler/instruction-codes.h @@ -14,7 +14,8 @@ #elif V8_TARGET_ARCH_X64 #include "src/compiler/x64/instruction-codes-x64.h" #else -#error "Unsupported target architecture." +#define TARGET_ARCH_OPCODE_LIST(V) +#define TARGET_ADDRESSING_MODE_LIST(V) #endif #include "src/utils.h" diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc index d488ac4001..05a86c8500 100644 --- a/src/compiler/instruction-selector.cc +++ b/src/compiler/instruction-selector.cc @@ -7,6 +7,7 @@ #include "src/compiler/instruction-selector-impl.h" #include "src/compiler/node-matchers.h" #include "src/compiler/node-properties-inl.h" +#include "src/compiler/pipeline.h" namespace v8 { namespace internal { @@ -587,6 +588,8 @@ void InstructionSelector::VisitNode(Node* node) { } +#if V8_TURBOFAN_TARGET + void InstructionSelector::VisitWord32Equal(Node* node) { FlagsContinuation cont(kEqual, node); Int32BinopMatcher m(node); @@ -660,9 +663,10 @@ void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { VisitFloat64Compare(node, &cont); } +#endif // V8_TURBOFAN_TARGET // 32 bit targets do not implement the following instructions. -#if V8_TARGET_ARCH_32_BIT +#if V8_TARGET_ARCH_32_BIT && V8_TURBOFAN_TARGET void InstructionSelector::VisitWord64And(Node* node) { UNIMPLEMENTED(); } @@ -712,6 +716,12 @@ void InstructionSelector::VisitConvertInt32ToInt64(Node* node) { UNIMPLEMENTED(); } +#endif // V8_TARGET_ARCH_32_BIT && V8_TURBOFAN_TARGET + + +// 32-bit targets and unsupported architectures need dummy implementations of +// selected 64-bit ops. +#if V8_TARGET_ARCH_32_BIT || !V8_TURBOFAN_TARGET void InstructionSelector::VisitWord64Test(Node* node, FlagsContinuation* cont) { UNIMPLEMENTED(); @@ -723,7 +733,7 @@ void InstructionSelector::VisitWord64Compare(Node* node, UNIMPLEMENTED(); } -#endif // V8_TARGET_ARCH_32_BIT +#endif // V8_TARGET_ARCH_32_BIT || !V8_TURBOFAN_TARGET void InstructionSelector::VisitPhi(Node* node) { @@ -872,6 +882,36 @@ void InstructionSelector::VisitDeoptimization(Node* deopt) { Emit(kArchDeoptimize | MiscField::encode(deoptimization_id), NULL); } +#if !V8_TURBOFAN_TARGET + +#define DECLARE_UNIMPLEMENTED_SELECTOR(x) \ + void InstructionSelector::Visit##x(Node* node) { UNIMPLEMENTED(); } +MACHINE_OP_LIST(DECLARE_UNIMPLEMENTED_SELECTOR) +#undef DECLARE_UNIMPLEMENTED_SELECTOR + + +void InstructionSelector::VisitWord32Test(Node* node, FlagsContinuation* cont) { + UNIMPLEMENTED(); +} + + +void InstructionSelector::VisitWord32Compare(Node* node, + FlagsContinuation* cont) { + UNIMPLEMENTED(); +} + + +void InstructionSelector::VisitFloat64Compare(Node* node, + FlagsContinuation* cont) { + UNIMPLEMENTED(); +} + + +void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, + BasicBlock* deoptimization) {} + +#endif + } // namespace compiler } // namespace internal } // namespace v8 diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc index b08f6942e4..28b5f0f7bf 100644 --- a/src/compiler/linkage.cc +++ b/src/compiler/linkage.cc @@ -130,7 +130,7 @@ CallDescriptor* Linkage::GetStubCallDescriptor( CallDescriptor* Linkage::GetSimplifiedCDescriptor( Zone* zone, int num_params, MachineRepresentation return_type, - MachineRepresentation* param_types) { + const MachineRepresentation* param_types) { UNIMPLEMENTED(); return NULL; } diff --git a/src/lithium-inl.h b/src/lithium-inl.h index 27b9292b1d..5e5084f176 100644 --- a/src/lithium-inl.h +++ b/src/lithium-inl.h @@ -17,6 +17,8 @@ #include "src/arm/lithium-arm.h" // NOLINT #elif V8_TARGET_ARCH_MIPS #include "src/mips/lithium-mips.h" // NOLINT +#elif V8_TARGET_ARCH_MIPS64 +#include "src/mips64/lithium-mips64.h" // NOLINT #elif V8_TARGET_ARCH_X87 #include "src/x87/lithium-x87.h" // NOLINT #else diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc index 052eaed827..731fa942cc 100644 --- a/src/mips/simulator-mips.cc +++ b/src/mips/simulator-mips.cc @@ -16,6 +16,7 @@ #include "src/globals.h" // Need the BitCast. #include "src/mips/constants-mips.h" #include "src/mips/simulator-mips.h" +#include "src/ostreams.h" // Only build the simulator if not compiling for real MIPS hardware. diff --git a/src/mips64/simulator-mips64.cc b/src/mips64/simulator-mips64.cc index f4cad547bb..6c930d51be 100644 --- a/src/mips64/simulator-mips64.cc +++ b/src/mips64/simulator-mips64.cc @@ -16,7 +16,7 @@ #include "src/globals.h" // Need the BitCast. #include "src/mips64/constants-mips64.h" #include "src/mips64/simulator-mips64.h" - +#include "src/ostreams.h" // Only build the simulator if not compiling for real MIPS hardware. #if defined(USE_SIMULATOR) diff --git a/test/cctest/compiler/test-codegen-deopt.cc b/test/cctest/compiler/test-codegen-deopt.cc index 243ece9010..d7422f185b 100644 --- a/test/cctest/compiler/test-codegen-deopt.cc +++ b/test/cctest/compiler/test-codegen-deopt.cc @@ -25,6 +25,9 @@ using namespace v8::internal; using namespace v8::internal::compiler; + +#if V8_TURBOFAN_TARGET + typedef RawMachineAssembler::Label MLabel; static Handle NewFunction(const char* source) { @@ -329,3 +332,5 @@ TEST(TurboTrivialRuntimeDeoptCodegenAndRun) { CHECK(!has_pending_exception); CHECK(result->SameValue(Smi::FromInt(42))); } + +#endif diff --git a/test/cctest/compiler/test-instruction-selector.cc b/test/cctest/compiler/test-instruction-selector.cc index 20ca5a5ea3..862643f0c8 100644 --- a/test/cctest/compiler/test-instruction-selector.cc +++ b/test/cctest/compiler/test-instruction-selector.cc @@ -7,6 +7,8 @@ using namespace v8::internal; using namespace v8::internal::compiler; +#if V8_TURBOFAN_TARGET + TEST(InstructionSelectionReturnZero) { InstructionSelectorTester m(InstructionSelectorTester::kInternalMode); m.Return(m.Int32Constant(0)); @@ -16,3 +18,5 @@ TEST(InstructionSelectionReturnZero) { CHECK_EQ(kArchRet, m.code[1]->opcode()); CHECK_EQ(1, static_cast(m.code[1]->InputCount())); } + +#endif diff --git a/test/cctest/compiler/test-pipeline.cc b/test/cctest/compiler/test-pipeline.cc index 84ccc28bde..7efedeeea2 100644 --- a/test/cctest/compiler/test-pipeline.cc +++ b/test/cctest/compiler/test-pipeline.cc @@ -30,11 +30,11 @@ TEST(PipelineAdd) { CHECK_NE(NULL, info.scope()); Pipeline pipeline(&info); - Handle code = pipeline.GenerateCode(); #if V8_TURBOFAN_TARGET + Handle code = pipeline.GenerateCode(); CHECK(Pipeline::SupportedTarget()); CHECK(!code.is_null()); #else - USE(code); + USE(pipeline); #endif } diff --git a/test/cctest/compiler/test-scheduler.cc b/test/cctest/compiler/test-scheduler.cc index ef1b94a256..96fc24411a 100644 --- a/test/cctest/compiler/test-scheduler.cc +++ b/test/cctest/compiler/test-scheduler.cc @@ -1695,6 +1695,8 @@ TEST(BuildScheduleSimpleLoopWithCodeMotion) { } +#if V8_TURBOFAN_TARGET + // So we can get a real JS function. static Handle Compile(const char* source) { Isolate* isolate = CcTest::i_isolate(); @@ -1826,3 +1828,5 @@ TEST(BuildScheduleTrivialLazyDeoptCall) { CHECK_EQ(lazy_deopt_node, deopt_block->nodes_[0]); CHECK_EQ(state_node, deopt_block->nodes_[1]); } + +#endif