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/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/arm64/macro-assembler-arm64.h" | 8 #include "src/arm64/macro-assembler-arm64.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 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 } | 1929 } |
1930 } else if (source->IsConstant()) { | 1930 } else if (source->IsConstant()) { |
1931 Constant src = g.ToConstant(ConstantOperand::cast(source)); | 1931 Constant src = g.ToConstant(ConstantOperand::cast(source)); |
1932 if (destination->IsRegister() || destination->IsStackSlot()) { | 1932 if (destination->IsRegister() || destination->IsStackSlot()) { |
1933 UseScratchRegisterScope scope(masm()); | 1933 UseScratchRegisterScope scope(masm()); |
1934 Register dst = destination->IsRegister() ? g.ToRegister(destination) | 1934 Register dst = destination->IsRegister() ? g.ToRegister(destination) |
1935 : scope.AcquireX(); | 1935 : scope.AcquireX(); |
1936 if (src.type() == Constant::kHeapObject) { | 1936 if (src.type() == Constant::kHeapObject) { |
1937 Handle<HeapObject> src_object = src.ToHeapObject(); | 1937 Handle<HeapObject> src_object = src.ToHeapObject(); |
1938 Heap::RootListIndex index; | 1938 Heap::RootListIndex index; |
1939 int slot; | 1939 if (IsMaterializableFromRoot(src_object, &index)) { |
1940 if (IsMaterializableFromFrame(src_object, &slot)) { | |
1941 __ Ldr(dst, g.SlotToMemOperand(slot, masm())); | |
1942 } else if (IsMaterializableFromRoot(src_object, &index)) { | |
1943 __ LoadRoot(dst, index); | 1940 __ LoadRoot(dst, index); |
1944 } else { | 1941 } else { |
1945 __ LoadObject(dst, src_object); | 1942 __ LoadObject(dst, src_object); |
1946 } | 1943 } |
1947 } else { | 1944 } else { |
1948 __ Mov(dst, g.ToImmediate(source)); | 1945 __ Mov(dst, g.ToImmediate(source)); |
1949 } | 1946 } |
1950 if (destination->IsStackSlot()) { | 1947 if (destination->IsStackSlot()) { |
1951 __ Str(dst, g.ToMemOperand(destination, masm())); | 1948 __ Str(dst, g.ToMemOperand(destination, masm())); |
1952 } | 1949 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2090 padding_size -= kInstructionSize; | 2087 padding_size -= kInstructionSize; |
2091 } | 2088 } |
2092 } | 2089 } |
2093 } | 2090 } |
2094 | 2091 |
2095 #undef __ | 2092 #undef __ |
2096 | 2093 |
2097 } // namespace compiler | 2094 } // namespace compiler |
2098 } // namespace internal | 2095 } // namespace internal |
2099 } // namespace v8 | 2096 } // namespace v8 |
OLD | NEW |