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 #include "src/compilation-info.h" | 6 #include "src/compilation-info.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 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2077 __ lw(temp, src); | 2077 __ lw(temp, src); |
2078 __ sw(temp, g.ToMemOperand(destination)); | 2078 __ sw(temp, g.ToMemOperand(destination)); |
2079 } | 2079 } |
2080 } else if (source->IsConstant()) { | 2080 } else if (source->IsConstant()) { |
2081 Constant src = g.ToConstant(source); | 2081 Constant src = g.ToConstant(source); |
2082 if (destination->IsRegister() || destination->IsStackSlot()) { | 2082 if (destination->IsRegister() || destination->IsStackSlot()) { |
2083 Register dst = | 2083 Register dst = |
2084 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; | 2084 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; |
2085 switch (src.type()) { | 2085 switch (src.type()) { |
2086 case Constant::kInt32: | 2086 case Constant::kInt32: |
2087 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || | 2087 if (RelocInfo::IsWasmReference(src.rmode())) { |
2088 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE || | |
2089 src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { | |
2090 __ li(dst, Operand(src.ToInt32(), src.rmode())); | 2088 __ li(dst, Operand(src.ToInt32(), src.rmode())); |
2091 } else { | 2089 } else { |
2092 __ li(dst, Operand(src.ToInt32())); | 2090 __ li(dst, Operand(src.ToInt32())); |
2093 } | 2091 } |
2094 break; | 2092 break; |
2095 case Constant::kFloat32: | 2093 case Constant::kFloat32: |
2096 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | 2094 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); |
2097 break; | 2095 break; |
2098 case Constant::kInt64: | 2096 case Constant::kInt64: |
2099 UNREACHABLE(); | 2097 UNREACHABLE(); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 padding_size -= v8::internal::Assembler::kInstrSize; | 2306 padding_size -= v8::internal::Assembler::kInstrSize; |
2309 } | 2307 } |
2310 } | 2308 } |
2311 } | 2309 } |
2312 | 2310 |
2313 #undef __ | 2311 #undef __ |
2314 | 2312 |
2315 } // namespace compiler | 2313 } // namespace compiler |
2316 } // namespace internal | 2314 } // namespace internal |
2317 } // namespace v8 | 2315 } // namespace v8 |
OLD | NEW |