| 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 Heap::RootListIndex root_index; | 445 Heap::RootListIndex root_index; |
| 446 if (isolate->heap()->IsRootHandle(constant, &root_index) && | 446 if (isolate->heap()->IsRootHandle(constant, &root_index) && |
| 447 root_index == Heap::kOptimizedOutRootIndex) { | 447 root_index == Heap::kOptimizedOutRootIndex) { |
| 448 // For an optimized-out object we return an invalid instruction | 448 // For an optimized-out object we return an invalid instruction |
| 449 // operand, so that we take the fast path for optimized-out values. | 449 // operand, so that we take the fast path for optimized-out values. |
| 450 return InstructionOperand(); | 450 return InstructionOperand(); |
| 451 } | 451 } |
| 452 | 452 |
| 453 return g->UseImmediate(input); | 453 return g->UseImmediate(input); |
| 454 } | 454 } |
| 455 case IrOpcode::kArgumentsObjectState: |
| 455 case IrOpcode::kObjectState: | 456 case IrOpcode::kObjectState: |
| 456 case IrOpcode::kTypedObjectState: | 457 case IrOpcode::kTypedObjectState: |
| 457 UNREACHABLE(); | 458 UNREACHABLE(); |
| 458 break; | 459 break; |
| 459 default: | 460 default: |
| 460 switch (kind) { | 461 switch (kind) { |
| 461 case FrameStateInputKind::kStackSlot: | 462 case FrameStateInputKind::kStackSlot: |
| 462 return g->UseUniqueSlot(input); | 463 return g->UseUniqueSlot(input); |
| 463 case FrameStateInputKind::kAny: | 464 case FrameStateInputKind::kAny: |
| 464 // Currently deopts "wrap" other operations, so the deopt's inputs | 465 // Currently deopts "wrap" other operations, so the deopt's inputs |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 size_t InstructionSelector::AddOperandToStateValueDescriptor( | 501 size_t InstructionSelector::AddOperandToStateValueDescriptor( |
| 501 StateValueList* values, InstructionOperandVector* inputs, | 502 StateValueList* values, InstructionOperandVector* inputs, |
| 502 OperandGenerator* g, StateObjectDeduplicator* deduplicator, Node* input, | 503 OperandGenerator* g, StateObjectDeduplicator* deduplicator, Node* input, |
| 503 MachineType type, FrameStateInputKind kind, Zone* zone) { | 504 MachineType type, FrameStateInputKind kind, Zone* zone) { |
| 504 if (input == nullptr) { | 505 if (input == nullptr) { |
| 505 values->PushOptimizedOut(); | 506 values->PushOptimizedOut(); |
| 506 return 0; | 507 return 0; |
| 507 } | 508 } |
| 508 | 509 |
| 509 switch (input->opcode()) { | 510 switch (input->opcode()) { |
| 511 case IrOpcode::kArgumentsObjectState: { |
| 512 values->PushArguments(); |
| 513 return 0; |
| 514 } |
| 510 case IrOpcode::kObjectState: { | 515 case IrOpcode::kObjectState: { |
| 511 UNREACHABLE(); | 516 UNREACHABLE(); |
| 512 return 0; | 517 return 0; |
| 513 } | 518 } |
| 514 case IrOpcode::kTypedObjectState: { | 519 case IrOpcode::kTypedObjectState: { |
| 515 size_t id = deduplicator->GetObjectId(input); | 520 size_t id = deduplicator->GetObjectId(input); |
| 516 if (id == StateObjectDeduplicator::kNotDuplicated) { | 521 if (id == StateObjectDeduplicator::kNotDuplicated) { |
| 517 size_t entries = 0; | 522 size_t entries = 0; |
| 518 id = deduplicator->InsertObject(input); | 523 id = deduplicator->InsertObject(input); |
| 519 StateValueList* nested = values->PushRecursiveField(zone, id); | 524 StateValueList* nested = values->PushRecursiveField(zone, id); |
| (...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2465 return new (instruction_zone()) FrameStateDescriptor( | 2470 return new (instruction_zone()) FrameStateDescriptor( |
| 2466 instruction_zone(), state_info.type(), state_info.bailout_id(), | 2471 instruction_zone(), state_info.type(), state_info.bailout_id(), |
| 2467 state_info.state_combine(), parameters, locals, stack, | 2472 state_info.state_combine(), parameters, locals, stack, |
| 2468 state_info.shared_info(), outer_state); | 2473 state_info.shared_info(), outer_state); |
| 2469 } | 2474 } |
| 2470 | 2475 |
| 2471 | 2476 |
| 2472 } // namespace compiler | 2477 } // namespace compiler |
| 2473 } // namespace internal | 2478 } // namespace internal |
| 2474 } // namespace v8 | 2479 } // namespace v8 |
| OLD | NEW |