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/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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 __ Move(dst, | 1008 __ Move(dst, |
1009 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | 1009 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); |
1010 break; | 1010 break; |
1011 case Constant::kFloat64: | 1011 case Constant::kFloat64: |
1012 __ Move(dst, | 1012 __ Move(dst, |
1013 isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); | 1013 isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); |
1014 break; | 1014 break; |
1015 case Constant::kExternalReference: | 1015 case Constant::kExternalReference: |
1016 __ mov(dst, Operand(src.ToExternalReference())); | 1016 __ mov(dst, Operand(src.ToExternalReference())); |
1017 break; | 1017 break; |
1018 case Constant::kHeapObject: | 1018 case Constant::kHeapObject: { |
1019 __ Move(dst, src.ToHeapObject()); | 1019 Handle<HeapObject> src_object = src.ToHeapObject(); |
| 1020 if (info()->IsOptimizing() && |
| 1021 src_object.is_identical_to(info()->context())) { |
| 1022 // Loading the context from the frame is way cheaper than |
| 1023 // materializing the actual context heap object address. |
| 1024 __ ldr(dst, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 1025 } else if (info()->IsOptimizing() && |
| 1026 src_object.is_identical_to(info()->closure())) { |
| 1027 // Loading the JSFunction from the frame is way cheaper than |
| 1028 // materializing the actual JSFunction heap object address. |
| 1029 __ ldr(dst, |
| 1030 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1031 } else { |
| 1032 __ Move(dst, src_object); |
| 1033 } |
1020 break; | 1034 break; |
| 1035 } |
1021 case Constant::kRpoNumber: | 1036 case Constant::kRpoNumber: |
1022 UNREACHABLE(); // TODO(dcarney): loading RPO constants on arm. | 1037 UNREACHABLE(); // TODO(dcarney): loading RPO constants on arm. |
1023 break; | 1038 break; |
1024 } | 1039 } |
1025 if (destination->IsStackSlot()) __ str(dst, g.ToMemOperand(destination)); | 1040 if (destination->IsStackSlot()) __ str(dst, g.ToMemOperand(destination)); |
1026 } else if (src.type() == Constant::kFloat32) { | 1041 } else if (src.type() == Constant::kFloat32) { |
1027 if (destination->IsDoubleStackSlot()) { | 1042 if (destination->IsDoubleStackSlot()) { |
1028 MemOperand dst = g.ToMemOperand(destination); | 1043 MemOperand dst = g.ToMemOperand(destination); |
1029 __ mov(ip, Operand(bit_cast<int32_t>(src.ToFloat32()))); | 1044 __ mov(ip, Operand(bit_cast<int32_t>(src.ToFloat32()))); |
1030 __ str(ip, dst); | 1045 __ str(ip, dst); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 } | 1178 } |
1164 } | 1179 } |
1165 MarkLazyDeoptSite(); | 1180 MarkLazyDeoptSite(); |
1166 } | 1181 } |
1167 | 1182 |
1168 #undef __ | 1183 #undef __ |
1169 | 1184 |
1170 } // namespace compiler | 1185 } // namespace compiler |
1171 } // namespace internal | 1186 } // namespace internal |
1172 } // namespace v8 | 1187 } // namespace v8 |
OLD | NEW |