| 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/instruction-selector-impl.h" |     5 #include "src/compiler/instruction-selector-impl.h" | 
|     6 #include "src/compiler/node-matchers.h" |     6 #include "src/compiler/node-matchers.h" | 
|     7 #include "src/compiler/node-properties.h" |     7 #include "src/compiler/node-properties.h" | 
|     8  |     8  | 
|     9 namespace v8 { |     9 namespace v8 { | 
|    10 namespace internal { |    10 namespace internal { | 
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   384   } |   384   } | 
|   385 } |   385 } | 
|   386  |   386  | 
|   387  |   387  | 
|   388 void InstructionSelector::VisitStore(Node* node) { |   388 void InstructionSelector::VisitStore(Node* node) { | 
|   389   Arm64OperandGenerator g(this); |   389   Arm64OperandGenerator g(this); | 
|   390   Node* base = node->InputAt(0); |   390   Node* base = node->InputAt(0); | 
|   391   Node* index = node->InputAt(1); |   391   Node* index = node->InputAt(1); | 
|   392   Node* value = node->InputAt(2); |   392   Node* value = node->InputAt(2); | 
|   393  |   393  | 
|   394   StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); |   394   StoreRepresentation store_rep = StoreRepresentationOf(node->op()); | 
|   395   WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind(); |   395   WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind(); | 
|   396   MachineRepresentation rep = store_rep.machine_type().representation(); |   396   MachineRepresentation rep = store_rep.representation(); | 
|   397  |   397  | 
|   398   // TODO(arm64): I guess this could be done in a better way. |   398   // TODO(arm64): I guess this could be done in a better way. | 
|   399   if (write_barrier_kind != kNoWriteBarrier) { |   399   if (write_barrier_kind != kNoWriteBarrier) { | 
|   400     DCHECK_EQ(MachineRepresentation::kTagged, rep); |   400     DCHECK_EQ(MachineRepresentation::kTagged, rep); | 
|   401     InstructionOperand inputs[3]; |   401     InstructionOperand inputs[3]; | 
|   402     size_t input_count = 0; |   402     size_t input_count = 0; | 
|   403     inputs[input_count++] = g.UseUniqueRegister(base); |   403     inputs[input_count++] = g.UseUniqueRegister(base); | 
|   404     inputs[input_count++] = g.UseUniqueRegister(index); |   404     inputs[input_count++] = g.UseUniqueRegister(index); | 
|   405     inputs[input_count++] = (write_barrier_kind == kMapWriteBarrier) |   405     inputs[input_count++] = (write_barrier_kind == kMapWriteBarrier) | 
|   406                                 ? g.UseRegister(value) |   406                                 ? g.UseRegister(value) | 
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   499     default: |   499     default: | 
|   500       UNREACHABLE(); |   500       UNREACHABLE(); | 
|   501       return; |   501       return; | 
|   502   } |   502   } | 
|   503   Emit(opcode, g.DefineAsRegister(node), g.UseRegister(buffer), |   503   Emit(opcode, g.DefineAsRegister(node), g.UseRegister(buffer), | 
|   504        g.UseRegister(offset), g.UseOperand(length, kArithmeticImm)); |   504        g.UseRegister(offset), g.UseOperand(length, kArithmeticImm)); | 
|   505 } |   505 } | 
|   506  |   506  | 
|   507  |   507  | 
|   508 void InstructionSelector::VisitCheckedStore(Node* node) { |   508 void InstructionSelector::VisitCheckedStore(Node* node) { | 
|   509   MachineRepresentation rep = |   509   MachineRepresentation rep = CheckedStoreRepresentationOf(node->op()); | 
|   510       CheckedStoreRepresentationOf(node->op()).representation(); |  | 
|   511   Arm64OperandGenerator g(this); |   510   Arm64OperandGenerator g(this); | 
|   512   Node* const buffer = node->InputAt(0); |   511   Node* const buffer = node->InputAt(0); | 
|   513   Node* const offset = node->InputAt(1); |   512   Node* const offset = node->InputAt(1); | 
|   514   Node* const length = node->InputAt(2); |   513   Node* const length = node->InputAt(2); | 
|   515   Node* const value = node->InputAt(3); |   514   Node* const value = node->InputAt(3); | 
|   516   ArchOpcode opcode; |   515   ArchOpcode opcode; | 
|   517   switch (rep) { |   516   switch (rep) { | 
|   518     case MachineRepresentation::kWord8: |   517     case MachineRepresentation::kWord8: | 
|   519       opcode = kCheckedStoreWord8; |   518       opcode = kCheckedStoreWord8; | 
|   520       break; |   519       break; | 
| (...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2157          MachineOperatorBuilder::kFloat32RoundTiesEven | |  2156          MachineOperatorBuilder::kFloat32RoundTiesEven | | 
|  2158          MachineOperatorBuilder::kFloat64RoundTiesEven | |  2157          MachineOperatorBuilder::kFloat64RoundTiesEven | | 
|  2159          MachineOperatorBuilder::kWord32ShiftIsSafe | |  2158          MachineOperatorBuilder::kWord32ShiftIsSafe | | 
|  2160          MachineOperatorBuilder::kInt32DivIsSafe | |  2159          MachineOperatorBuilder::kInt32DivIsSafe | | 
|  2161          MachineOperatorBuilder::kUint32DivIsSafe; |  2160          MachineOperatorBuilder::kUint32DivIsSafe; | 
|  2162 } |  2161 } | 
|  2163  |  2162  | 
|  2164 }  // namespace compiler |  2163 }  // namespace compiler | 
|  2165 }  // namespace internal |  2164 }  // namespace internal | 
|  2166 }  // namespace v8 |  2165 }  // namespace v8 | 
| OLD | NEW |