Fix MIPS build: use stubbed-out TF implementation
authordanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 31 Jul 2014 11:59:49 +0000 (11:59 +0000)
committerdanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 31 Jul 2014 11:59:49 +0000 (11:59 +0000)
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
src/compiler/instruction-codes.h
src/compiler/instruction-selector.cc
src/compiler/linkage.cc
src/lithium-inl.h
src/mips/simulator-mips.cc
src/mips64/simulator-mips64.cc
test/cctest/compiler/test-codegen-deopt.cc
test/cctest/compiler/test-instruction-selector.cc
test/cctest/compiler/test-pipeline.cc
test/cctest/compiler/test-scheduler.cc

index 69eace40b103ef3103282f4b5042201e7e28b746..94f0d901d15df7d286f9aaba30db24d2578a337d 100644 (file)
@@ -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> code, int start_pc,
+                                            int end_pc) {
+  UNIMPLEMENTED();
+  return false;
+}
+#endif
+
+#endif
+
+
 }  // namespace compiler
 }  // namespace internal
 }  // namespace v8
index 6e59f9cde81630d15ff8f0ec56a329f05f29be10..a627748cb2f26ae2fb116d226079250e0d1f15c5 100644 (file)
@@ -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"
 
index d488ac40012f548abd8fdff1f46d74793d739feb..05a86c85002360779baa2775c1ea8181af192e7d 100644 (file)
@@ -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
index b08f6942e45b5178c0e750d7c326a4e733f39bbd..28b5f0f7bf743a5209596baff5be1ce281761f60 100644 (file)
@@ -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;
 }
index 27b9292b1d7b51c8882b04cf82452517a22dcf0d..5e5084f176ec7fcc7138e4399e33b3e0c066857b 100644 (file)
@@ -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
index 052eaed8272f7224d1fc7830dc92c48770cb108f..731fa942cc850ba2d27978dd9b6a658c3092ad75 100644 (file)
@@ -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.
index f4cad547bbd8ef23474a92508d2a6fa679564fc6..6c930d51beaa86b86e04bb0a1595824ba52de0bc 100644 (file)
@@ -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)
index 243ece901080f4a76b5b701b7dd327cc98f85cb7..d7422f185b02140ab602eeffda0aa70ccc649e9f 100644 (file)
@@ -25,6 +25,9 @@
 using namespace v8::internal;
 using namespace v8::internal::compiler;
 
+
+#if V8_TURBOFAN_TARGET
+
 typedef RawMachineAssembler::Label MLabel;
 
 static Handle<JSFunction> NewFunction(const char* source) {
@@ -329,3 +332,5 @@ TEST(TurboTrivialRuntimeDeoptCodegenAndRun) {
   CHECK(!has_pending_exception);
   CHECK(result->SameValue(Smi::FromInt(42)));
 }
+
+#endif
index 20ca5a5ea3e215dbc4711b6ddc17fd5883737fe8..862643f0c8f4b42dbc42a214b6abbf1134df0308 100644 (file)
@@ -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<int>(m.code[1]->InputCount()));
 }
+
+#endif
index 84ccc28bde605bcc2f39abda566bb4c4424813ba..7efedeeea2ac1dcc2aacc1182f844d84421fbab2 100644 (file)
@@ -30,11 +30,11 @@ TEST(PipelineAdd) {
   CHECK_NE(NULL, info.scope());
 
   Pipeline pipeline(&info);
-  Handle<Code> code = pipeline.GenerateCode();
 #if V8_TURBOFAN_TARGET
+  Handle<Code> code = pipeline.GenerateCode();
   CHECK(Pipeline::SupportedTarget());
   CHECK(!code.is_null());
 #else
-  USE(code);
+  USE(pipeline);
 #endif
 }
index ef1b94a256430ba3c4f01ae2364928a8cd16262c..96fc24411a5d6b993b778721f628014d9dcf21e3 100644 (file)
@@ -1695,6 +1695,8 @@ TEST(BuildScheduleSimpleLoopWithCodeMotion) {
 }
 
 
+#if V8_TURBOFAN_TARGET
+
 // So we can get a real JS function.
 static Handle<JSFunction> 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