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/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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 Constant constant = ToConstant(operand); | 42 Constant constant = ToConstant(operand); |
43 if (constant.type() == Constant::kFloat64) { | 43 if (constant.type() == Constant::kFloat64) { |
44 DCHECK_EQ(0, bit_cast<int64_t>(constant.ToFloat64())); | 44 DCHECK_EQ(0, bit_cast<int64_t>(constant.ToFloat64())); |
45 return Immediate(0); | 45 return Immediate(0); |
46 } | 46 } |
47 return Immediate(constant.ToInt32()); | 47 return Immediate(constant.ToInt32()); |
48 } | 48 } |
49 | 49 |
50 Operand ToOperand(InstructionOperand* op, int extra = 0) { | 50 Operand ToOperand(InstructionOperand* op, int extra = 0) { |
51 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); | 51 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
52 return SlotToOperand(AllocatedOperand::cast(op)->index()); | 52 return SlotToOperand(AllocatedOperand::cast(op)->index(), extra); |
53 } | 53 } |
54 | 54 |
55 Operand SlotToOperand(int slot_index, int extra = 0) { | 55 Operand SlotToOperand(int slot_index, int extra = 0) { |
56 FrameOffset offset = frame_access_state()->GetFrameOffset(slot_index); | 56 FrameOffset offset = frame_access_state()->GetFrameOffset(slot_index); |
57 return Operand(offset.from_stack_pointer() ? rsp : rbp, | 57 return Operand(offset.from_stack_pointer() ? rsp : rbp, |
58 offset.offset() + extra); | 58 offset.offset() + extra); |
59 } | 59 } |
60 | 60 |
61 static size_t NextOffset(size_t* offset) { | 61 static size_t NextOffset(size_t* offset) { |
62 size_t i = *offset; | 62 size_t i = *offset; |
(...skipping 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2233 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2233 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2234 __ Nop(padding_size); | 2234 __ Nop(padding_size); |
2235 } | 2235 } |
2236 } | 2236 } |
2237 | 2237 |
2238 #undef __ | 2238 #undef __ |
2239 | 2239 |
2240 } // namespace compiler | 2240 } // namespace compiler |
2241 } // namespace internal | 2241 } // namespace internal |
2242 } // namespace v8 | 2242 } // namespace v8 |
OLD | NEW |