| 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/base/bits.h" | 5 #include "src/base/bits.h" |
| 6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
| 7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 276 |
| 277 | 277 |
| 278 static void VisitBinop(InstructionSelector* selector, Node* node, | 278 static void VisitBinop(InstructionSelector* selector, Node* node, |
| 279 InstructionCode opcode, InstructionCode reverse_opcode) { | 279 InstructionCode opcode, InstructionCode reverse_opcode) { |
| 280 FlagsContinuation cont; | 280 FlagsContinuation cont; |
| 281 VisitBinop(selector, node, opcode, reverse_opcode, &cont); | 281 VisitBinop(selector, node, opcode, reverse_opcode, &cont); |
| 282 } | 282 } |
| 283 | 283 |
| 284 | 284 |
| 285 void InstructionSelector::VisitLoad(Node* node) { | 285 void InstructionSelector::VisitLoad(Node* node) { |
| 286 MachineType rep = RepresentationOf(OpParameter<MachineType>(node)); | 286 MachineType rep = RepresentationOf(OpParameter<LoadRepresentation>(node)); |
| 287 MachineType typ = TypeOf(OpParameter<MachineType>(node)); | 287 MachineType typ = TypeOf(OpParameter<LoadRepresentation>(node)); |
| 288 ArmOperandGenerator g(this); | 288 ArmOperandGenerator g(this); |
| 289 Node* base = node->InputAt(0); | 289 Node* base = node->InputAt(0); |
| 290 Node* index = node->InputAt(1); | 290 Node* index = node->InputAt(1); |
| 291 | 291 |
| 292 ArchOpcode opcode; | 292 ArchOpcode opcode; |
| 293 switch (rep) { | 293 switch (rep) { |
| 294 case kRepFloat32: | 294 case kRepFloat32: |
| 295 opcode = kArmVldr32; | 295 opcode = kArmVldr32; |
| 296 break; | 296 break; |
| 297 case kRepFloat64: | 297 case kRepFloat64: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 323 } | 323 } |
| 324 | 324 |
| 325 | 325 |
| 326 void InstructionSelector::VisitStore(Node* node) { | 326 void InstructionSelector::VisitStore(Node* node) { |
| 327 ArmOperandGenerator g(this); | 327 ArmOperandGenerator g(this); |
| 328 Node* base = node->InputAt(0); | 328 Node* base = node->InputAt(0); |
| 329 Node* index = node->InputAt(1); | 329 Node* index = node->InputAt(1); |
| 330 Node* value = node->InputAt(2); | 330 Node* value = node->InputAt(2); |
| 331 | 331 |
| 332 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); | 332 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); |
| 333 MachineType rep = RepresentationOf(store_rep.machine_type); | 333 MachineType rep = RepresentationOf(store_rep.machine_type()); |
| 334 if (store_rep.write_barrier_kind == kFullWriteBarrier) { | 334 if (store_rep.write_barrier_kind() == kFullWriteBarrier) { |
| 335 DCHECK(rep == kRepTagged); | 335 DCHECK(rep == kRepTagged); |
| 336 // TODO(dcarney): refactor RecordWrite function to take temp registers | 336 // TODO(dcarney): refactor RecordWrite function to take temp registers |
| 337 // and pass them here instead of using fixed regs | 337 // and pass them here instead of using fixed regs |
| 338 // TODO(dcarney): handle immediate indices. | 338 // TODO(dcarney): handle immediate indices. |
| 339 InstructionOperand* temps[] = {g.TempRegister(r5), g.TempRegister(r6)}; | 339 InstructionOperand* temps[] = {g.TempRegister(r5), g.TempRegister(r6)}; |
| 340 Emit(kArmStoreWriteBarrier, NULL, g.UseFixed(base, r4), | 340 Emit(kArmStoreWriteBarrier, NULL, g.UseFixed(base, r4), |
| 341 g.UseFixed(index, r5), g.UseFixed(value, r6), arraysize(temps), | 341 g.UseFixed(index, r5), g.UseFixed(value, r6), arraysize(temps), |
| 342 temps); | 342 temps); |
| 343 return; | 343 return; |
| 344 } | 344 } |
| 345 DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind); | 345 DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind()); |
| 346 | 346 |
| 347 ArchOpcode opcode; | 347 ArchOpcode opcode; |
| 348 switch (rep) { | 348 switch (rep) { |
| 349 case kRepFloat32: | 349 case kRepFloat32: |
| 350 opcode = kArmVstr32; | 350 opcode = kArmVstr32; |
| 351 break; | 351 break; |
| 352 case kRepFloat64: | 352 case kRepFloat64: |
| 353 opcode = kArmVstr64; | 353 opcode = kArmVstr64; |
| 354 break; | 354 break; |
| 355 case kRepBit: // Fall through. | 355 case kRepBit: // Fall through. |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 } else { | 946 } else { |
| 947 DCHECK(cont->IsSet()); | 947 DCHECK(cont->IsSet()); |
| 948 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), | 948 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), |
| 949 g.UseRegister(m.left().node()), g.UseRegister(m.right().node())); | 949 g.UseRegister(m.left().node()), g.UseRegister(m.right().node())); |
| 950 } | 950 } |
| 951 } | 951 } |
| 952 | 952 |
| 953 } // namespace compiler | 953 } // namespace compiler |
| 954 } // namespace internal | 954 } // namespace internal |
| 955 } // namespace v8 | 955 } // namespace v8 |
| OLD | NEW |