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/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/compiler/code-generator-impl.h" | 9 #include "src/compiler/code-generator-impl.h" |
10 #include "src/compiler/gap-resolver.h" | 10 #include "src/compiler/gap-resolver.h" |
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 __ ldr(temp, src); | 1385 __ ldr(temp, src); |
1386 __ str(temp, g.ToMemOperand(destination)); | 1386 __ str(temp, g.ToMemOperand(destination)); |
1387 } | 1387 } |
1388 } else if (source->IsConstant()) { | 1388 } else if (source->IsConstant()) { |
1389 Constant src = g.ToConstant(source); | 1389 Constant src = g.ToConstant(source); |
1390 if (destination->IsRegister() || destination->IsStackSlot()) { | 1390 if (destination->IsRegister() || destination->IsStackSlot()) { |
1391 Register dst = | 1391 Register dst = |
1392 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; | 1392 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; |
1393 switch (src.type()) { | 1393 switch (src.type()) { |
1394 case Constant::kInt32: | 1394 case Constant::kInt32: |
1395 __ mov(dst, Operand(src.ToInt32())); | 1395 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { |
| 1396 __ mov(dst, Operand(src.ToInt32(), src.rmode())); |
| 1397 } else { |
| 1398 __ mov(dst, Operand(src.ToInt32())); |
| 1399 } |
1396 break; | 1400 break; |
1397 case Constant::kInt64: | 1401 case Constant::kInt64: |
1398 UNREACHABLE(); | 1402 UNREACHABLE(); |
1399 break; | 1403 break; |
1400 case Constant::kFloat32: | 1404 case Constant::kFloat32: |
1401 __ Move(dst, | 1405 __ Move(dst, |
1402 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | 1406 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); |
1403 break; | 1407 break; |
1404 case Constant::kFloat64: | 1408 case Constant::kFloat64: |
1405 __ Move(dst, | 1409 __ Move(dst, |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 padding_size -= v8::internal::Assembler::kInstrSize; | 1571 padding_size -= v8::internal::Assembler::kInstrSize; |
1568 } | 1572 } |
1569 } | 1573 } |
1570 } | 1574 } |
1571 | 1575 |
1572 #undef __ | 1576 #undef __ |
1573 | 1577 |
1574 } // namespace compiler | 1578 } // namespace compiler |
1575 } // namespace internal | 1579 } // namespace internal |
1576 } // namespace v8 | 1580 } // namespace v8 |
OLD | NEW |