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 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 } | 997 } |
1003 } | 998 } |
1004 MarkLazyDeoptSite(); | 999 MarkLazyDeoptSite(); |
1005 } | 1000 } |
1006 | 1001 |
1007 #undef __ | 1002 #undef __ |
1008 | 1003 |
1009 } // namespace internal | 1004 } // namespace internal |
1010 } // namespace compiler | 1005 } // namespace compiler |
1011 } // namespace v8 | 1006 } // namespace v8 |
OLD | NEW |