OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 #include "src/compiler/code-generator-impl.h" | 6 #include "src/compiler/code-generator-impl.h" |
7 #include "src/compiler/gap-resolver.h" | 7 #include "src/compiler/gap-resolver.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
10 #include "src/mips/macro-assembler-mips.h" | 10 #include "src/mips/macro-assembler-mips.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 return Operand( | 64 return Operand( |
65 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED)); | 65 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED)); |
66 case Constant::kFloat64: | 66 case Constant::kFloat64: |
67 return Operand( | 67 return Operand( |
68 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED)); | 68 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED)); |
69 case Constant::kExternalReference: | 69 case Constant::kExternalReference: |
70 case Constant::kHeapObject: | 70 case Constant::kHeapObject: |
71 // TODO(plind): Maybe we should handle ExtRef & HeapObj here? | 71 // TODO(plind): Maybe we should handle ExtRef & HeapObj here? |
72 // maybe not done on arm due to const pool ?? | 72 // maybe not done on arm due to const pool ?? |
73 break; | 73 break; |
| 74 case Constant::kRpoNumber: |
| 75 UNREACHABLE(); // TODO(titzer): RPO immediates on mips? |
| 76 break; |
74 } | 77 } |
75 UNREACHABLE(); | 78 UNREACHABLE(); |
76 return Operand(zero_reg); | 79 return Operand(zero_reg); |
77 } | 80 } |
78 | 81 |
79 Operand InputOperand(int index) { | 82 Operand InputOperand(int index) { |
80 InstructionOperand* op = instr_->InputAt(index); | 83 InstructionOperand* op = instr_->InputAt(index); |
81 if (op->IsRegister()) { | 84 if (op->IsRegister()) { |
82 return Operand(ToRegister(op)); | 85 return Operand(ToRegister(op)); |
83 } | 86 } |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 break; | 1067 break; |
1065 case Constant::kFloat64: | 1068 case Constant::kFloat64: |
1066 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); | 1069 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); |
1067 break; | 1070 break; |
1068 case Constant::kExternalReference: | 1071 case Constant::kExternalReference: |
1069 __ li(dst, Operand(src.ToExternalReference())); | 1072 __ li(dst, Operand(src.ToExternalReference())); |
1070 break; | 1073 break; |
1071 case Constant::kHeapObject: | 1074 case Constant::kHeapObject: |
1072 __ li(dst, src.ToHeapObject()); | 1075 __ li(dst, src.ToHeapObject()); |
1073 break; | 1076 break; |
| 1077 case Constant::kRpoNumber: |
| 1078 UNREACHABLE(); // TODO(titzer): loading RPO numbers on mips64. |
| 1079 break; |
1074 } | 1080 } |
1075 if (destination->IsStackSlot()) __ sd(dst, g.ToMemOperand(destination)); | 1081 if (destination->IsStackSlot()) __ sd(dst, g.ToMemOperand(destination)); |
1076 } else if (src.type() == Constant::kFloat32) { | 1082 } else if (src.type() == Constant::kFloat32) { |
1077 FPURegister dst = destination->IsDoubleRegister() | 1083 FPURegister dst = destination->IsDoubleRegister() |
1078 ? g.ToDoubleRegister(destination) | 1084 ? g.ToDoubleRegister(destination) |
1079 : kScratchDoubleReg.low(); | 1085 : kScratchDoubleReg.low(); |
1080 // TODO(turbofan): Can we do better here? | 1086 // TODO(turbofan): Can we do better here? |
1081 __ li(at, Operand(bit_cast<int32_t>(src.ToFloat32()))); | 1087 __ li(at, Operand(bit_cast<int32_t>(src.ToFloat32()))); |
1082 __ mtc1(at, dst); | 1088 __ mtc1(at, dst); |
1083 if (destination->IsDoubleStackSlot()) { | 1089 if (destination->IsDoubleStackSlot()) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 } | 1217 } |
1212 } | 1218 } |
1213 MarkLazyDeoptSite(); | 1219 MarkLazyDeoptSite(); |
1214 } | 1220 } |
1215 | 1221 |
1216 #undef __ | 1222 #undef __ |
1217 | 1223 |
1218 } // namespace compiler | 1224 } // namespace compiler |
1219 } // namespace internal | 1225 } // namespace internal |
1220 } // namespace v8 | 1226 } // namespace v8 |
OLD | NEW |