OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 | 6 |
7 #include "src/compilation-info.h" | 7 #include "src/compilation-info.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 UNREACHABLE(); | 50 UNREACHABLE(); |
51 } | 51 } |
52 | 52 |
53 Operand InputImmediate(size_t index) { | 53 Operand InputImmediate(size_t index) { |
54 Constant constant = ToConstant(instr_->InputAt(index)); | 54 Constant constant = ToConstant(instr_->InputAt(index)); |
55 switch (constant.type()) { | 55 switch (constant.type()) { |
56 case Constant::kInt32: | 56 case Constant::kInt32: |
57 return Operand(constant.ToInt32()); | 57 return Operand(constant.ToInt32()); |
58 case Constant::kFloat32: | 58 case Constant::kFloat32: |
59 return Operand( | 59 return Operand::EmbeddedNumber(constant.ToFloat32()); |
60 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED)); | |
61 case Constant::kFloat64: | 60 case Constant::kFloat64: |
62 return Operand( | 61 return Operand::EmbeddedNumber(constant.ToFloat64()); |
63 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED)); | |
64 case Constant::kInt64: | 62 case Constant::kInt64: |
65 #if V8_TARGET_ARCH_S390X | 63 #if V8_TARGET_ARCH_S390X |
66 return Operand(constant.ToInt64()); | 64 return Operand(constant.ToInt64()); |
67 #endif | 65 #endif |
68 case Constant::kExternalReference: | 66 case Constant::kExternalReference: |
69 case Constant::kHeapObject: | 67 case Constant::kHeapObject: |
70 case Constant::kRpoNumber: | 68 case Constant::kRpoNumber: |
71 break; | 69 break; |
72 } | 70 } |
73 UNREACHABLE(); | 71 UNREACHABLE(); |
(...skipping 2709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2783 __ mov(dst, Operand(src.ToInt64(), src.rmode())); | 2781 __ mov(dst, Operand(src.ToInt64(), src.rmode())); |
2784 } else { | 2782 } else { |
2785 DCHECK(!RelocInfo::IsWasmSizeReference(src.rmode())); | 2783 DCHECK(!RelocInfo::IsWasmSizeReference(src.rmode())); |
2786 __ Load(dst, Operand(src.ToInt64())); | 2784 __ Load(dst, Operand(src.ToInt64())); |
2787 } | 2785 } |
2788 #else | 2786 #else |
2789 __ mov(dst, Operand(src.ToInt64())); | 2787 __ mov(dst, Operand(src.ToInt64())); |
2790 #endif // V8_TARGET_ARCH_S390X | 2788 #endif // V8_TARGET_ARCH_S390X |
2791 break; | 2789 break; |
2792 case Constant::kFloat32: | 2790 case Constant::kFloat32: |
2793 __ Move(dst, | 2791 __ mov(dst, Operand::EmbeddedNumber(src.ToFloat32())); |
2794 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | |
2795 break; | 2792 break; |
2796 case Constant::kFloat64: | 2793 case Constant::kFloat64: |
2797 __ Move(dst, | 2794 __ mov(dst, Operand::EmbeddedNumber(src.ToFloat64())); |
2798 isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); | |
2799 break; | 2795 break; |
2800 case Constant::kExternalReference: | 2796 case Constant::kExternalReference: |
2801 __ mov(dst, Operand(src.ToExternalReference())); | 2797 __ mov(dst, Operand(src.ToExternalReference())); |
2802 break; | 2798 break; |
2803 case Constant::kHeapObject: { | 2799 case Constant::kHeapObject: { |
2804 Handle<HeapObject> src_object = src.ToHeapObject(); | 2800 Handle<HeapObject> src_object = src.ToHeapObject(); |
2805 Heap::RootListIndex index; | 2801 Heap::RootListIndex index; |
2806 if (IsMaterializableFromRoot(src_object, &index)) { | 2802 if (IsMaterializableFromRoot(src_object, &index)) { |
2807 __ LoadRoot(dst, index); | 2803 __ LoadRoot(dst, index); |
2808 } else { | 2804 } else { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2965 padding_size -= 2; | 2961 padding_size -= 2; |
2966 } | 2962 } |
2967 } | 2963 } |
2968 } | 2964 } |
2969 | 2965 |
2970 #undef __ | 2966 #undef __ |
2971 | 2967 |
2972 } // namespace compiler | 2968 } // namespace compiler |
2973 } // namespace internal | 2969 } // namespace internal |
2974 } // namespace v8 | 2970 } // namespace v8 |
OLD | NEW |