| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/instruction.h" | 5 #include "src/compiler/instruction.h" |
| 6 | 6 |
| 7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 } | 387 } |
| 388 | 388 |
| 389 | 389 |
| 390 void InstructionSequence::AddGapMove(int index, InstructionOperand* from, | 390 void InstructionSequence::AddGapMove(int index, InstructionOperand* from, |
| 391 InstructionOperand* to) { | 391 InstructionOperand* to) { |
| 392 GapAt(index)->GetOrCreateParallelMove(GapInstruction::START, zone())->AddMove( | 392 GapAt(index)->GetOrCreateParallelMove(GapInstruction::START, zone())->AddMove( |
| 393 from, to, zone()); | 393 from, to, zone()); |
| 394 } | 394 } |
| 395 | 395 |
| 396 | 396 |
| 397 int InstructionSequence::AddDeoptimizationEntry( | 397 InstructionSequence::StateId InstructionSequence::AddFrameStateDescriptor( |
| 398 FrameStateDescriptor* descriptor) { | 398 FrameStateDescriptor* descriptor) { |
| 399 int deoptimization_id = static_cast<int>(deoptimization_entries_.size()); | 399 int deoptimization_id = static_cast<int>(deoptimization_entries_.size()); |
| 400 deoptimization_entries_.push_back(descriptor); | 400 deoptimization_entries_.push_back(descriptor); |
| 401 return deoptimization_id; | 401 return StateId::FromInt(deoptimization_id); |
| 402 } | 402 } |
| 403 | 403 |
| 404 FrameStateDescriptor* InstructionSequence::GetDeoptimizationEntry( | 404 FrameStateDescriptor* InstructionSequence::GetFrameStateDescriptor( |
| 405 int deoptimization_id) { | 405 InstructionSequence::StateId state_id) { |
| 406 return deoptimization_entries_[deoptimization_id]; | 406 return deoptimization_entries_[state_id.ToInt()]; |
| 407 } | 407 } |
| 408 | 408 |
| 409 | 409 |
| 410 int InstructionSequence::GetDeoptimizationEntryCount() { | 410 int InstructionSequence::GetFrameStateDescriptorCount() { |
| 411 return static_cast<int>(deoptimization_entries_.size()); | 411 return static_cast<int>(deoptimization_entries_.size()); |
| 412 } | 412 } |
| 413 | 413 |
| 414 | 414 |
| 415 OStream& operator<<(OStream& os, const InstructionSequence& code) { | 415 OStream& operator<<(OStream& os, const InstructionSequence& code) { |
| 416 for (size_t i = 0; i < code.immediates_.size(); ++i) { | 416 for (size_t i = 0; i < code.immediates_.size(); ++i) { |
| 417 Constant constant = code.immediates_[i]; | 417 Constant constant = code.immediates_[i]; |
| 418 os << "IMM#" << i << ": " << constant << "\n"; | 418 os << "IMM#" << i << ": " << constant << "\n"; |
| 419 } | 419 } |
| 420 int i = 0; | 420 int i = 0; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 os << " B" << (*iter)->id(); | 475 os << " B" << (*iter)->id(); |
| 476 } | 476 } |
| 477 os << "\n"; | 477 os << "\n"; |
| 478 } | 478 } |
| 479 return os; | 479 return os; |
| 480 } | 480 } |
| 481 | 481 |
| 482 } // namespace compiler | 482 } // namespace compiler |
| 483 } // namespace internal | 483 } // namespace internal |
| 484 } // namespace v8 | 484 } // namespace v8 |
| OLD | NEW |