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 | 6 |
7 #include "src/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
8 #include "src/assembler-inl.h" | 8 #include "src/assembler-inl.h" |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 UNREACHABLE(); | 42 UNREACHABLE(); |
43 } | 43 } |
44 | 44 |
45 Operand InputImmediate(size_t index) { | 45 Operand InputImmediate(size_t index) { |
46 Constant constant = ToConstant(instr_->InputAt(index)); | 46 Constant constant = ToConstant(instr_->InputAt(index)); |
47 switch (constant.type()) { | 47 switch (constant.type()) { |
48 case Constant::kInt32: | 48 case Constant::kInt32: |
49 return Operand(constant.ToInt32()); | 49 return Operand(constant.ToInt32()); |
50 case Constant::kFloat32: | 50 case Constant::kFloat32: |
51 return Operand( | 51 return Operand::EmbeddedNumber(constant.ToFloat32()); |
52 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED)); | |
53 case Constant::kFloat64: | 52 case Constant::kFloat64: |
54 return Operand( | 53 return Operand::EmbeddedNumber(constant.ToFloat64()); |
55 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED)); | |
56 case Constant::kInt64: | 54 case Constant::kInt64: |
57 case Constant::kExternalReference: | 55 case Constant::kExternalReference: |
58 case Constant::kHeapObject: | 56 case Constant::kHeapObject: |
59 case Constant::kRpoNumber: | 57 case Constant::kRpoNumber: |
60 break; | 58 break; |
61 } | 59 } |
62 UNREACHABLE(); | 60 UNREACHABLE(); |
63 } | 61 } |
64 | 62 |
65 Operand InputOperand2(size_t first_index) { | 63 Operand InputOperand2(size_t first_index) { |
(...skipping 2901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2967 if (RelocInfo::IsWasmReference(src.rmode())) { | 2965 if (RelocInfo::IsWasmReference(src.rmode())) { |
2968 __ mov(dst, Operand(src.ToInt32(), src.rmode())); | 2966 __ mov(dst, Operand(src.ToInt32(), src.rmode())); |
2969 } else { | 2967 } else { |
2970 __ mov(dst, Operand(src.ToInt32())); | 2968 __ mov(dst, Operand(src.ToInt32())); |
2971 } | 2969 } |
2972 break; | 2970 break; |
2973 case Constant::kInt64: | 2971 case Constant::kInt64: |
2974 UNREACHABLE(); | 2972 UNREACHABLE(); |
2975 break; | 2973 break; |
2976 case Constant::kFloat32: | 2974 case Constant::kFloat32: |
2977 __ Move(dst, | 2975 __ mov(dst, Operand::EmbeddedNumber(src.ToFloat32())); |
2978 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | |
2979 break; | 2976 break; |
2980 case Constant::kFloat64: | 2977 case Constant::kFloat64: |
2981 __ Move(dst, | 2978 __ mov(dst, Operand::EmbeddedNumber(src.ToFloat64())); |
2982 isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); | |
2983 break; | 2979 break; |
2984 case Constant::kExternalReference: | 2980 case Constant::kExternalReference: |
2985 __ mov(dst, Operand(src.ToExternalReference())); | 2981 __ mov(dst, Operand(src.ToExternalReference())); |
2986 break; | 2982 break; |
2987 case Constant::kHeapObject: { | 2983 case Constant::kHeapObject: { |
2988 Handle<HeapObject> src_object = src.ToHeapObject(); | 2984 Handle<HeapObject> src_object = src.ToHeapObject(); |
2989 Heap::RootListIndex index; | 2985 Heap::RootListIndex index; |
2990 if (IsMaterializableFromRoot(src_object, &index)) { | 2986 if (IsMaterializableFromRoot(src_object, &index)) { |
2991 __ LoadRoot(dst, index); | 2987 __ LoadRoot(dst, index); |
2992 } else { | 2988 } else { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3241 padding_size -= v8::internal::Assembler::kInstrSize; | 3237 padding_size -= v8::internal::Assembler::kInstrSize; |
3242 } | 3238 } |
3243 } | 3239 } |
3244 } | 3240 } |
3245 | 3241 |
3246 #undef __ | 3242 #undef __ |
3247 | 3243 |
3248 } // namespace compiler | 3244 } // namespace compiler |
3249 } // namespace internal | 3245 } // namespace internal |
3250 } // namespace v8 | 3246 } // namespace v8 |
OLD | NEW |