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/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/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 Immediate InputImmediate(int index) { | 28 Immediate InputImmediate(int index) { |
29 return ToImmediate(instr_->InputAt(index)); | 29 return ToImmediate(instr_->InputAt(index)); |
30 } | 30 } |
31 | 31 |
32 Operand InputOperand(int index) { return ToOperand(instr_->InputAt(index)); } | 32 Operand InputOperand(int index) { return ToOperand(instr_->InputAt(index)); } |
33 | 33 |
34 Operand OutputOperand() { return ToOperand(instr_->Output()); } | 34 Operand OutputOperand() { return ToOperand(instr_->Output()); } |
35 | 35 |
36 Immediate ToImmediate(InstructionOperand* operand) { | 36 Immediate ToImmediate(InstructionOperand* operand) { |
37 Constant constant = ToConstant(operand); | 37 return Immediate(ToConstant(operand).ToInt32()); |
38 if (constant.type() == Constant::kInt32) { | |
39 return Immediate(constant.ToInt32()); | |
40 } | |
41 UNREACHABLE(); | |
42 return Immediate(-1); | |
43 } | 38 } |
44 | 39 |
45 Operand ToOperand(InstructionOperand* op, int extra = 0) { | 40 Operand ToOperand(InstructionOperand* op, int extra = 0) { |
46 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); | 41 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
47 // The linkage computes where all spill slots are located. | 42 // The linkage computes where all spill slots are located. |
48 FrameOffset offset = linkage()->GetFrameOffset(op->index(), frame(), extra); | 43 FrameOffset offset = linkage()->GetFrameOffset(op->index(), frame(), extra); |
49 return Operand(offset.from_stack_pointer() ? rsp : rbp, offset.offset()); | 44 return Operand(offset.from_stack_pointer() ? rsp : rbp, offset.offset()); |
50 } | 45 } |
51 | 46 |
52 static int NextOffset(int* offset) { | 47 static int NextOffset(int* offset) { |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 } | 1015 } |
1021 } | 1016 } |
1022 MarkLazyDeoptSite(); | 1017 MarkLazyDeoptSite(); |
1023 } | 1018 } |
1024 | 1019 |
1025 #undef __ | 1020 #undef __ |
1026 | 1021 |
1027 } // namespace internal | 1022 } // namespace internal |
1028 } // namespace compiler | 1023 } // namespace compiler |
1029 } // namespace v8 | 1024 } // namespace v8 |
OLD | NEW |