OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/compilation-info.h" | 7 #include "src/compilation-info.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 2019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2030 __ mov(dst, src); | 2030 __ mov(dst, src); |
2031 } else { | 2031 } else { |
2032 Operand dst = g.ToOperand(destination); | 2032 Operand dst = g.ToOperand(destination); |
2033 __ push(src); | 2033 __ push(src); |
2034 __ pop(dst); | 2034 __ pop(dst); |
2035 } | 2035 } |
2036 } else if (source->IsConstant()) { | 2036 } else if (source->IsConstant()) { |
2037 Constant src_constant = g.ToConstant(source); | 2037 Constant src_constant = g.ToConstant(source); |
2038 if (src_constant.type() == Constant::kHeapObject) { | 2038 if (src_constant.type() == Constant::kHeapObject) { |
2039 Handle<HeapObject> src = src_constant.ToHeapObject(); | 2039 Handle<HeapObject> src = src_constant.ToHeapObject(); |
2040 int slot; | 2040 if (destination->IsRegister()) { |
2041 if (IsMaterializableFromFrame(src, &slot)) { | |
2042 if (destination->IsRegister()) { | |
2043 Register dst = g.ToRegister(destination); | |
2044 __ mov(dst, g.SlotToOperand(slot)); | |
2045 } else { | |
2046 DCHECK(destination->IsStackSlot()); | |
2047 Operand dst = g.ToOperand(destination); | |
2048 __ push(g.SlotToOperand(slot)); | |
2049 __ pop(dst); | |
2050 } | |
2051 } else if (destination->IsRegister()) { | |
2052 Register dst = g.ToRegister(destination); | 2041 Register dst = g.ToRegister(destination); |
2053 __ LoadHeapObject(dst, src); | 2042 __ LoadHeapObject(dst, src); |
2054 } else { | 2043 } else { |
2055 DCHECK(destination->IsStackSlot()); | 2044 DCHECK(destination->IsStackSlot()); |
2056 Operand dst = g.ToOperand(destination); | 2045 Operand dst = g.ToOperand(destination); |
2057 AllowDeferredHandleDereference embedding_raw_address; | 2046 AllowDeferredHandleDereference embedding_raw_address; |
2058 if (isolate()->heap()->InNewSpace(*src)) { | 2047 if (isolate()->heap()->InNewSpace(*src)) { |
2059 __ PushHeapObject(src); | 2048 __ PushHeapObject(src); |
2060 __ pop(dst); | 2049 __ pop(dst); |
2061 } else { | 2050 } else { |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2265 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2254 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2266 __ Nop(padding_size); | 2255 __ Nop(padding_size); |
2267 } | 2256 } |
2268 } | 2257 } |
2269 | 2258 |
2270 #undef __ | 2259 #undef __ |
2271 | 2260 |
2272 } // namespace compiler | 2261 } // namespace compiler |
2273 } // namespace internal | 2262 } // namespace internal |
2274 } // namespace v8 | 2263 } // namespace v8 |
OLD | NEW |