| 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
| 9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 1974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1985 Constant src = g.ToConstant(source); | 1985 Constant src = g.ToConstant(source); |
| 1986 if (destination->IsRegister() || destination->IsStackSlot()) { | 1986 if (destination->IsRegister() || destination->IsStackSlot()) { |
| 1987 Register dst = | 1987 Register dst = |
| 1988 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; | 1988 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; |
| 1989 switch (src.type()) { | 1989 switch (src.type()) { |
| 1990 case Constant::kInt32: | 1990 case Constant::kInt32: |
| 1991 #if V8_TARGET_ARCH_PPC64 | 1991 #if V8_TARGET_ARCH_PPC64 |
| 1992 if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { | 1992 if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { |
| 1993 #else | 1993 #else |
| 1994 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || | 1994 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || |
| 1995 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE || |
| 1995 src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { | 1996 src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { |
| 1996 #endif | 1997 #endif |
| 1997 __ mov(dst, Operand(src.ToInt32(), src.rmode())); | 1998 __ mov(dst, Operand(src.ToInt32(), src.rmode())); |
| 1998 } else { | 1999 } else { |
| 1999 __ mov(dst, Operand(src.ToInt32())); | 2000 __ mov(dst, Operand(src.ToInt32())); |
| 2000 } | 2001 } |
| 2001 break; | 2002 break; |
| 2002 case Constant::kInt64: | 2003 case Constant::kInt64: |
| 2003 #if V8_TARGET_ARCH_PPC64 | 2004 #if V8_TARGET_ARCH_PPC64 |
| 2004 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { | 2005 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || |
| 2006 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { |
| 2005 __ mov(dst, Operand(src.ToInt64(), src.rmode())); | 2007 __ mov(dst, Operand(src.ToInt64(), src.rmode())); |
| 2006 } else { | 2008 } else { |
| 2007 DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); | 2009 DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); |
| 2008 #endif | 2010 #endif |
| 2009 __ mov(dst, Operand(src.ToInt64())); | 2011 __ mov(dst, Operand(src.ToInt64())); |
| 2010 #if V8_TARGET_ARCH_PPC64 | 2012 #if V8_TARGET_ARCH_PPC64 |
| 2011 } | 2013 } |
| 2012 #endif | 2014 #endif |
| 2013 break; | 2015 break; |
| 2014 case Constant::kFloat32: | 2016 case Constant::kFloat32: |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2190 padding_size -= v8::internal::Assembler::kInstrSize; | 2192 padding_size -= v8::internal::Assembler::kInstrSize; |
| 2191 } | 2193 } |
| 2192 } | 2194 } |
| 2193 } | 2195 } |
| 2194 | 2196 |
| 2195 #undef __ | 2197 #undef __ |
| 2196 | 2198 |
| 2197 } // namespace compiler | 2199 } // namespace compiler |
| 2198 } // namespace internal | 2200 } // namespace internal |
| 2199 } // namespace v8 | 2201 } // namespace v8 |
| OLD | NEW |