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 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2062 __ ld(temp, src); | 2062 __ ld(temp, src); |
2063 __ sd(temp, g.ToMemOperand(destination)); | 2063 __ sd(temp, g.ToMemOperand(destination)); |
2064 } | 2064 } |
2065 } else if (source->IsConstant()) { | 2065 } else if (source->IsConstant()) { |
2066 Constant src = g.ToConstant(source); | 2066 Constant src = g.ToConstant(source); |
2067 if (destination->IsRegister() || destination->IsStackSlot()) { | 2067 if (destination->IsRegister() || destination->IsStackSlot()) { |
2068 Register dst = | 2068 Register dst = |
2069 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; | 2069 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; |
2070 switch (src.type()) { | 2070 switch (src.type()) { |
2071 case Constant::kInt32: | 2071 case Constant::kInt32: |
2072 __ li(dst, Operand(src.ToInt32())); | 2072 if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { |
| 2073 __ li(dst, Operand(src.ToInt32(), src.rmode())); |
| 2074 } else { |
| 2075 __ li(dst, Operand(src.ToInt32())); |
| 2076 } |
2073 break; | 2077 break; |
2074 case Constant::kFloat32: | 2078 case Constant::kFloat32: |
2075 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | 2079 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); |
2076 break; | 2080 break; |
2077 case Constant::kInt64: | 2081 case Constant::kInt64: |
2078 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { | 2082 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { |
2079 __ li(dst, Operand(src.ToInt64(), src.rmode())); | 2083 __ li(dst, Operand(src.ToInt64(), src.rmode())); |
2080 } else { | 2084 } else { |
| 2085 DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); |
2081 __ li(dst, Operand(src.ToInt64())); | 2086 __ li(dst, Operand(src.ToInt64())); |
2082 } | 2087 } |
2083 break; | 2088 break; |
2084 case Constant::kFloat64: | 2089 case Constant::kFloat64: |
2085 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); | 2090 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); |
2086 break; | 2091 break; |
2087 case Constant::kExternalReference: | 2092 case Constant::kExternalReference: |
2088 __ li(dst, Operand(src.ToExternalReference())); | 2093 __ li(dst, Operand(src.ToExternalReference())); |
2089 break; | 2094 break; |
2090 case Constant::kHeapObject: { | 2095 case Constant::kHeapObject: { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2242 padding_size -= v8::internal::Assembler::kInstrSize; | 2247 padding_size -= v8::internal::Assembler::kInstrSize; |
2243 } | 2248 } |
2244 } | 2249 } |
2245 } | 2250 } |
2246 | 2251 |
2247 #undef __ | 2252 #undef __ |
2248 | 2253 |
2249 } // namespace compiler | 2254 } // namespace compiler |
2250 } // namespace internal | 2255 } // namespace internal |
2251 } // namespace v8 | 2256 } // namespace v8 |
OLD | NEW |