| 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 <algorithm> |     5 #include <algorithm> | 
|     6  |     6  | 
|     7 #include "src/base/adapters.h" |     7 #include "src/base/adapters.h" | 
|     8 #include "src/compiler/instruction-selector-impl.h" |     8 #include "src/compiler/instruction-selector-impl.h" | 
|     9 #include "src/compiler/node-matchers.h" |     9 #include "src/compiler/node-matchers.h" | 
|    10 #include "src/compiler/node-properties.h" |    10 #include "src/compiler/node-properties.h" | 
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   126     case MachineRepresentation::kWord16: |   126     case MachineRepresentation::kWord16: | 
|   127       opcode = load_rep.IsSigned() ? kX64Movsxwl : kX64Movzxwl; |   127       opcode = load_rep.IsSigned() ? kX64Movsxwl : kX64Movzxwl; | 
|   128       break; |   128       break; | 
|   129     case MachineRepresentation::kWord32: |   129     case MachineRepresentation::kWord32: | 
|   130       opcode = kX64Movl; |   130       opcode = kX64Movl; | 
|   131       break; |   131       break; | 
|   132     case MachineRepresentation::kTagged:  // Fall through. |   132     case MachineRepresentation::kTagged:  // Fall through. | 
|   133     case MachineRepresentation::kWord64: |   133     case MachineRepresentation::kWord64: | 
|   134       opcode = kX64Movq; |   134       opcode = kX64Movq; | 
|   135       break; |   135       break; | 
 |   136     case MachineRepresentation::kSimd128:  // Fall through. | 
|   136     case MachineRepresentation::kNone: |   137     case MachineRepresentation::kNone: | 
|   137       UNREACHABLE(); |   138       UNREACHABLE(); | 
|   138       return; |   139       return; | 
|   139   } |   140   } | 
|   140  |   141  | 
|   141   InstructionOperand outputs[1]; |   142   InstructionOperand outputs[1]; | 
|   142   outputs[0] = g.DefineAsRegister(node); |   143   outputs[0] = g.DefineAsRegister(node); | 
|   143   InstructionOperand inputs[3]; |   144   InstructionOperand inputs[3]; | 
|   144   size_t input_count = 0; |   145   size_t input_count = 0; | 
|   145   AddressingMode mode = |   146   AddressingMode mode = | 
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   212       case MachineRepresentation::kWord16: |   213       case MachineRepresentation::kWord16: | 
|   213         opcode = kX64Movw; |   214         opcode = kX64Movw; | 
|   214         break; |   215         break; | 
|   215       case MachineRepresentation::kWord32: |   216       case MachineRepresentation::kWord32: | 
|   216         opcode = kX64Movl; |   217         opcode = kX64Movl; | 
|   217         break; |   218         break; | 
|   218       case MachineRepresentation::kTagged:  // Fall through. |   219       case MachineRepresentation::kTagged:  // Fall through. | 
|   219       case MachineRepresentation::kWord64: |   220       case MachineRepresentation::kWord64: | 
|   220         opcode = kX64Movq; |   221         opcode = kX64Movq; | 
|   221         break; |   222         break; | 
 |   223       case MachineRepresentation::kSimd128:  // Fall through. | 
|   222       case MachineRepresentation::kNone: |   224       case MachineRepresentation::kNone: | 
|   223         UNREACHABLE(); |   225         UNREACHABLE(); | 
|   224         return; |   226         return; | 
|   225     } |   227     } | 
|   226     InstructionOperand inputs[4]; |   228     InstructionOperand inputs[4]; | 
|   227     size_t input_count = 0; |   229     size_t input_count = 0; | 
|   228     AddressingMode addressing_mode = |   230     AddressingMode addressing_mode = | 
|   229         g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count); |   231         g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count); | 
|   230     InstructionCode code = |   232     InstructionCode code = | 
|   231         opcode | AddressingModeField::encode(addressing_mode); |   233         opcode | AddressingModeField::encode(addressing_mode); | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
|   257       break; |   259       break; | 
|   258     case MachineRepresentation::kWord64: |   260     case MachineRepresentation::kWord64: | 
|   259       opcode = kCheckedLoadWord64; |   261       opcode = kCheckedLoadWord64; | 
|   260       break; |   262       break; | 
|   261     case MachineRepresentation::kFloat32: |   263     case MachineRepresentation::kFloat32: | 
|   262       opcode = kCheckedLoadFloat32; |   264       opcode = kCheckedLoadFloat32; | 
|   263       break; |   265       break; | 
|   264     case MachineRepresentation::kFloat64: |   266     case MachineRepresentation::kFloat64: | 
|   265       opcode = kCheckedLoadFloat64; |   267       opcode = kCheckedLoadFloat64; | 
|   266       break; |   268       break; | 
|   267     case MachineRepresentation::kBit: |   269     case MachineRepresentation::kBit:      // Fall through. | 
|   268     case MachineRepresentation::kTagged: |   270     case MachineRepresentation::kSimd128:  // Fall through. | 
 |   271     case MachineRepresentation::kTagged:   // Fall through. | 
|   269     case MachineRepresentation::kNone: |   272     case MachineRepresentation::kNone: | 
|   270       UNREACHABLE(); |   273       UNREACHABLE(); | 
|   271       return; |   274       return; | 
|   272   } |   275   } | 
|   273   if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) { |   276   if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) { | 
|   274     Int32Matcher mlength(length); |   277     Int32Matcher mlength(length); | 
|   275     Int32BinopMatcher moffset(offset); |   278     Int32BinopMatcher moffset(offset); | 
|   276     if (mlength.HasValue() && moffset.right().HasValue() && |   279     if (mlength.HasValue() && moffset.right().HasValue() && | 
|   277         moffset.right().Value() >= 0 && |   280         moffset.right().Value() >= 0 && | 
|   278         mlength.Value() >= moffset.right().Value()) { |   281         mlength.Value() >= moffset.right().Value()) { | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
|   309       break; |   312       break; | 
|   310     case MachineRepresentation::kWord64: |   313     case MachineRepresentation::kWord64: | 
|   311       opcode = kCheckedStoreWord64; |   314       opcode = kCheckedStoreWord64; | 
|   312       break; |   315       break; | 
|   313     case MachineRepresentation::kFloat32: |   316     case MachineRepresentation::kFloat32: | 
|   314       opcode = kCheckedStoreFloat32; |   317       opcode = kCheckedStoreFloat32; | 
|   315       break; |   318       break; | 
|   316     case MachineRepresentation::kFloat64: |   319     case MachineRepresentation::kFloat64: | 
|   317       opcode = kCheckedStoreFloat64; |   320       opcode = kCheckedStoreFloat64; | 
|   318       break; |   321       break; | 
|   319     case MachineRepresentation::kBit: |   322     case MachineRepresentation::kBit:      // Fall through. | 
|   320     case MachineRepresentation::kTagged: |   323     case MachineRepresentation::kSimd128:  // Fall through. | 
 |   324     case MachineRepresentation::kTagged:   // Fall through. | 
|   321     case MachineRepresentation::kNone: |   325     case MachineRepresentation::kNone: | 
|   322       UNREACHABLE(); |   326       UNREACHABLE(); | 
|   323       return; |   327       return; | 
|   324   } |   328   } | 
|   325   InstructionOperand value_operand = |   329   InstructionOperand value_operand = | 
|   326       g.CanBeImmediate(value) ? g.UseImmediate(value) : g.UseRegister(value); |   330       g.CanBeImmediate(value) ? g.UseImmediate(value) : g.UseRegister(value); | 
|   327   if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) { |   331   if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) { | 
|   328     Int32Matcher mlength(length); |   332     Int32Matcher mlength(length); | 
|   329     Int32BinopMatcher moffset(offset); |   333     Int32BinopMatcher moffset(offset); | 
|   330     if (mlength.HasValue() && moffset.right().HasValue() && |   334     if (mlength.HasValue() && moffset.right().HasValue() && | 
| (...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1832              MachineOperatorBuilder::kFloat64RoundTruncate | |  1836              MachineOperatorBuilder::kFloat64RoundTruncate | | 
|  1833              MachineOperatorBuilder::kFloat32RoundTiesEven | |  1837              MachineOperatorBuilder::kFloat32RoundTiesEven | | 
|  1834              MachineOperatorBuilder::kFloat64RoundTiesEven; |  1838              MachineOperatorBuilder::kFloat64RoundTiesEven; | 
|  1835   } |  1839   } | 
|  1836   return flags; |  1840   return flags; | 
|  1837 } |  1841 } | 
|  1838  |  1842  | 
|  1839 }  // namespace compiler |  1843 }  // namespace compiler | 
|  1840 }  // namespace internal |  1844 }  // namespace internal | 
|  1841 }  // namespace v8 |  1845 }  // namespace v8 | 
| OLD | NEW |