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 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 __ ldr(temp, src); | 1290 __ ldr(temp, src); |
1291 __ str(temp, g.ToMemOperand(destination)); | 1291 __ str(temp, g.ToMemOperand(destination)); |
1292 } | 1292 } |
1293 } else if (source->IsConstant()) { | 1293 } else if (source->IsConstant()) { |
1294 Constant src = g.ToConstant(source); | 1294 Constant src = g.ToConstant(source); |
1295 if (destination->IsRegister() || destination->IsStackSlot()) { | 1295 if (destination->IsRegister() || destination->IsStackSlot()) { |
1296 Register dst = | 1296 Register dst = |
1297 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; | 1297 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; |
1298 switch (src.type()) { | 1298 switch (src.type()) { |
1299 case Constant::kInt32: | 1299 case Constant::kInt32: |
1300 __ mov(dst, Operand(src.ToInt32())); | 1300 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { |
| 1301 __ mov(dst, Operand(src.ToInt32(), src.rmode())); |
| 1302 } else { |
| 1303 __ mov(dst, Operand(src.ToInt32())); |
| 1304 } |
1301 break; | 1305 break; |
1302 case Constant::kInt64: | 1306 case Constant::kInt64: |
1303 UNREACHABLE(); | 1307 UNREACHABLE(); |
1304 break; | 1308 break; |
1305 case Constant::kFloat32: | 1309 case Constant::kFloat32: |
1306 __ Move(dst, | 1310 __ Move(dst, |
1307 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | 1311 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); |
1308 break; | 1312 break; |
1309 case Constant::kFloat64: | 1313 case Constant::kFloat64: |
1310 __ Move(dst, | 1314 __ Move(dst, |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 padding_size -= v8::internal::Assembler::kInstrSize; | 1476 padding_size -= v8::internal::Assembler::kInstrSize; |
1473 } | 1477 } |
1474 } | 1478 } |
1475 } | 1479 } |
1476 | 1480 |
1477 #undef __ | 1481 #undef __ |
1478 | 1482 |
1479 } // namespace compiler | 1483 } // namespace compiler |
1480 } // namespace internal | 1484 } // namespace internal |
1481 } // namespace v8 | 1485 } // namespace v8 |
OLD | NEW |