| 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-selector.h" | 5 #include "src/compiler/instruction-selector.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/base/adapters.h" | 9 #include "src/base/adapters.h" |
| 10 #include "src/compiler/compiler-source-position-table.h" | 10 #include "src/compiler/compiler-source-position-table.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 Heap::RootListIndex root_index; | 446 Heap::RootListIndex root_index; |
| 447 if (isolate->heap()->IsRootHandle(constant, &root_index) && | 447 if (isolate->heap()->IsRootHandle(constant, &root_index) && |
| 448 root_index == Heap::kOptimizedOutRootIndex) { | 448 root_index == Heap::kOptimizedOutRootIndex) { |
| 449 // For an optimized-out object we return an invalid instruction | 449 // For an optimized-out object we return an invalid instruction |
| 450 // operand, so that we take the fast path for optimized-out values. | 450 // operand, so that we take the fast path for optimized-out values. |
| 451 return InstructionOperand(); | 451 return InstructionOperand(); |
| 452 } | 452 } |
| 453 | 453 |
| 454 return g->UseImmediate(input); | 454 return g->UseImmediate(input); |
| 455 } | 455 } |
| 456 case IrOpcode::kArgumentsObjectState: | 456 case IrOpcode::kArgumentsElementsState: |
| 457 case IrOpcode::kObjectState: | 457 case IrOpcode::kObjectState: |
| 458 case IrOpcode::kTypedObjectState: | 458 case IrOpcode::kTypedObjectState: |
| 459 UNREACHABLE(); | 459 UNREACHABLE(); |
| 460 break; | 460 break; |
| 461 default: | 461 default: |
| 462 switch (kind) { | 462 switch (kind) { |
| 463 case FrameStateInputKind::kStackSlot: | 463 case FrameStateInputKind::kStackSlot: |
| 464 return g->UseUniqueSlot(input); | 464 return g->UseUniqueSlot(input); |
| 465 case FrameStateInputKind::kAny: | 465 case FrameStateInputKind::kAny: |
| 466 // Currently deopts "wrap" other operations, so the deopt's inputs | 466 // Currently deopts "wrap" other operations, so the deopt's inputs |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 size_t InstructionSelector::AddOperandToStateValueDescriptor( | 502 size_t InstructionSelector::AddOperandToStateValueDescriptor( |
| 503 StateValueList* values, InstructionOperandVector* inputs, | 503 StateValueList* values, InstructionOperandVector* inputs, |
| 504 OperandGenerator* g, StateObjectDeduplicator* deduplicator, Node* input, | 504 OperandGenerator* g, StateObjectDeduplicator* deduplicator, Node* input, |
| 505 MachineType type, FrameStateInputKind kind, Zone* zone) { | 505 MachineType type, FrameStateInputKind kind, Zone* zone) { |
| 506 if (input == nullptr) { | 506 if (input == nullptr) { |
| 507 values->PushOptimizedOut(); | 507 values->PushOptimizedOut(); |
| 508 return 0; | 508 return 0; |
| 509 } | 509 } |
| 510 | 510 |
| 511 switch (input->opcode()) { | 511 switch (input->opcode()) { |
| 512 case IrOpcode::kArgumentsObjectState: { | 512 case IrOpcode::kArgumentsElementsState: { |
| 513 values->PushArguments(); | 513 values->PushArgumentsElements(IsRestOf(input->op())); |
| 514 return 0; | 514 return 0; |
| 515 } | 515 } |
| 516 case IrOpcode::kObjectState: { | 516 case IrOpcode::kObjectState: { |
| 517 UNREACHABLE(); | 517 UNREACHABLE(); |
| 518 return 0; | 518 return 0; |
| 519 } | 519 } |
| 520 case IrOpcode::kTypedObjectState: { | 520 case IrOpcode::kTypedObjectState: { |
| 521 size_t id = deduplicator->GetObjectId(input); | 521 size_t id = deduplicator->GetObjectId(input); |
| 522 if (id == StateObjectDeduplicator::kNotDuplicated) { | 522 if (id == StateObjectDeduplicator::kNotDuplicated) { |
| 523 size_t entries = 0; | 523 size_t entries = 0; |
| (...skipping 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2626 return new (instruction_zone()) FrameStateDescriptor( | 2626 return new (instruction_zone()) FrameStateDescriptor( |
| 2627 instruction_zone(), state_info.type(), state_info.bailout_id(), | 2627 instruction_zone(), state_info.type(), state_info.bailout_id(), |
| 2628 state_info.state_combine(), parameters, locals, stack, | 2628 state_info.state_combine(), parameters, locals, stack, |
| 2629 state_info.shared_info(), outer_state); | 2629 state_info.shared_info(), outer_state); |
| 2630 } | 2630 } |
| 2631 | 2631 |
| 2632 | 2632 |
| 2633 } // namespace compiler | 2633 } // namespace compiler |
| 2634 } // namespace internal | 2634 } // namespace internal |
| 2635 } // namespace v8 | 2635 } // namespace v8 |
| OLD | NEW |