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/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 return code()->InstructionBlockAt(current_block_)->ao_number().IsNext( | 209 return code()->InstructionBlockAt(current_block_)->ao_number().IsNext( |
210 code()->InstructionBlockAt(block)->ao_number()); | 210 code()->InstructionBlockAt(block)->ao_number()); |
211 } | 211 } |
212 | 212 |
213 | 213 |
214 void CodeGenerator::RecordSafepoint(ReferenceMap* references, | 214 void CodeGenerator::RecordSafepoint(ReferenceMap* references, |
215 Safepoint::Kind kind, int arguments, | 215 Safepoint::Kind kind, int arguments, |
216 Safepoint::DeoptMode deopt_mode) { | 216 Safepoint::DeoptMode deopt_mode) { |
217 Safepoint safepoint = | 217 Safepoint safepoint = |
218 safepoints()->DefineSafepoint(masm(), kind, arguments, deopt_mode); | 218 safepoints()->DefineSafepoint(masm(), kind, arguments, deopt_mode); |
| 219 int stackSlotToSpillSlotDelta = |
| 220 frame()->GetTotalFrameSlotCount() - frame()->GetSpillSlotCount(); |
219 for (auto& operand : references->reference_operands()) { | 221 for (auto& operand : references->reference_operands()) { |
220 if (operand.IsStackSlot()) { | 222 if (operand.IsStackSlot()) { |
221 safepoint.DefinePointerSlot(StackSlotOperand::cast(operand).index(), | 223 int index = StackSlotOperand::cast(operand).index(); |
222 zone()); | 224 DCHECK(index >= 0); |
| 225 // Safepoint table indices are 0-based from the beginning of the spill |
| 226 // slot area, adjust appropriately. |
| 227 index -= stackSlotToSpillSlotDelta; |
| 228 safepoint.DefinePointerSlot(index, zone()); |
223 } else if (operand.IsRegister() && (kind & Safepoint::kWithRegisters)) { | 229 } else if (operand.IsRegister() && (kind & Safepoint::kWithRegisters)) { |
224 Register reg = | 230 Register reg = |
225 Register::FromAllocationIndex(RegisterOperand::cast(operand).index()); | 231 Register::FromAllocationIndex(RegisterOperand::cast(operand).index()); |
226 safepoint.DefinePointerRegister(reg, zone()); | 232 safepoint.DefinePointerRegister(reg, zone()); |
227 } | 233 } |
228 } | 234 } |
229 } | 235 } |
230 | 236 |
231 | 237 |
232 bool CodeGenerator::IsMaterializableFromFrame(Handle<HeapObject> object, | 238 bool CodeGenerator::IsMaterializableFromFrame(Handle<HeapObject> object, |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 : masm_(gen->masm()), next_(gen->ools_) { | 668 : masm_(gen->masm()), next_(gen->ools_) { |
663 gen->ools_ = this; | 669 gen->ools_ = this; |
664 } | 670 } |
665 | 671 |
666 | 672 |
667 OutOfLineCode::~OutOfLineCode() {} | 673 OutOfLineCode::~OutOfLineCode() {} |
668 | 674 |
669 } // namespace compiler | 675 } // namespace compiler |
670 } // namespace internal | 676 } // namespace internal |
671 } // namespace v8 | 677 } // namespace v8 |
OLD | NEW |