| 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/ast/scopes.h" | 5 #include "src/ast/scopes.h" |
| 6 #include "src/compiler/code-generator.h" | 6 #include "src/compiler/code-generator.h" |
| 7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
| 8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/compiler/osr.h" | 10 #include "src/compiler/osr.h" |
| (...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1736 __ lw(temp, src); | 1736 __ lw(temp, src); |
| 1737 __ sw(temp, g.ToMemOperand(destination)); | 1737 __ sw(temp, g.ToMemOperand(destination)); |
| 1738 } | 1738 } |
| 1739 } else if (source->IsConstant()) { | 1739 } else if (source->IsConstant()) { |
| 1740 Constant src = g.ToConstant(source); | 1740 Constant src = g.ToConstant(source); |
| 1741 if (destination->IsRegister() || destination->IsStackSlot()) { | 1741 if (destination->IsRegister() || destination->IsStackSlot()) { |
| 1742 Register dst = | 1742 Register dst = |
| 1743 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; | 1743 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; |
| 1744 switch (src.type()) { | 1744 switch (src.type()) { |
| 1745 case Constant::kInt32: | 1745 case Constant::kInt32: |
| 1746 __ li(dst, Operand(src.ToInt32())); | 1746 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { |
| 1747 __ li(dst, Operand(src.ToInt32(), src.rmode())); |
| 1748 } else { |
| 1749 __ li(dst, Operand(src.ToInt32())); |
| 1750 } |
| 1747 break; | 1751 break; |
| 1748 case Constant::kFloat32: | 1752 case Constant::kFloat32: |
| 1749 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | 1753 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); |
| 1750 break; | 1754 break; |
| 1751 case Constant::kInt64: | 1755 case Constant::kInt64: |
| 1752 UNREACHABLE(); | 1756 UNREACHABLE(); |
| 1753 break; | 1757 break; |
| 1754 case Constant::kFloat64: | 1758 case Constant::kFloat64: |
| 1755 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); | 1759 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); |
| 1756 break; | 1760 break; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1919 padding_size -= v8::internal::Assembler::kInstrSize; | 1923 padding_size -= v8::internal::Assembler::kInstrSize; |
| 1920 } | 1924 } |
| 1921 } | 1925 } |
| 1922 } | 1926 } |
| 1923 | 1927 |
| 1924 #undef __ | 1928 #undef __ |
| 1925 | 1929 |
| 1926 } // namespace compiler | 1930 } // namespace compiler |
| 1927 } // namespace internal | 1931 } // namespace internal |
| 1928 } // namespace v8 | 1932 } // namespace v8 |
| OLD | NEW |