Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: src/compiler/instruction-selector.cc

Issue 2692753004: [turbofan] escape analysis supports arguments object and rest elements (Closed)
Patch Set: replaced obscure for-loop Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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::kArgumentsElementsState:
456 case IrOpcode::kObjectState: 456 case IrOpcode::kObjectState:
457 case IrOpcode::kTypedObjectState: 457 case IrOpcode::kTypedObjectState:
458 UNREACHABLE(); 458 UNREACHABLE();
459 break; 459 break;
460 default: 460 default:
461 switch (kind) { 461 switch (kind) {
462 case FrameStateInputKind::kStackSlot: 462 case FrameStateInputKind::kStackSlot:
463 return g->UseUniqueSlot(input); 463 return g->UseUniqueSlot(input);
464 case FrameStateInputKind::kAny: 464 case FrameStateInputKind::kAny:
465 // 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
501 size_t InstructionSelector::AddOperandToStateValueDescriptor( 501 size_t InstructionSelector::AddOperandToStateValueDescriptor(
502 StateValueList* values, InstructionOperandVector* inputs, 502 StateValueList* values, InstructionOperandVector* inputs,
503 OperandGenerator* g, StateObjectDeduplicator* deduplicator, Node* input, 503 OperandGenerator* g, StateObjectDeduplicator* deduplicator, Node* input,
504 MachineType type, FrameStateInputKind kind, Zone* zone) { 504 MachineType type, FrameStateInputKind kind, Zone* zone) {
505 if (input == nullptr) { 505 if (input == nullptr) {
506 values->PushOptimizedOut(); 506 values->PushOptimizedOut();
507 return 0; 507 return 0;
508 } 508 }
509 509
510 switch (input->opcode()) { 510 switch (input->opcode()) {
511 case IrOpcode::kArgumentsObjectState: { 511 case IrOpcode::kArgumentsElementsState: {
512 values->PushArguments(); 512 values->PushArgumentsElements(SkippedArgumentsOf(input->op()));
513 return 0; 513 return 0;
514 } 514 }
515 case IrOpcode::kObjectState: { 515 case IrOpcode::kObjectState: {
516 UNREACHABLE(); 516 UNREACHABLE();
517 return 0; 517 return 0;
518 } 518 }
519 case IrOpcode::kTypedObjectState: { 519 case IrOpcode::kTypedObjectState: {
520 size_t id = deduplicator->GetObjectId(input); 520 size_t id = deduplicator->GetObjectId(input);
521 if (id == StateObjectDeduplicator::kNotDuplicated) { 521 if (id == StateObjectDeduplicator::kNotDuplicated) {
522 size_t entries = 0; 522 size_t entries = 0;
(...skipping 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after
2587 return new (instruction_zone()) FrameStateDescriptor( 2587 return new (instruction_zone()) FrameStateDescriptor(
2588 instruction_zone(), state_info.type(), state_info.bailout_id(), 2588 instruction_zone(), state_info.type(), state_info.bailout_id(),
2589 state_info.state_combine(), parameters, locals, stack, 2589 state_info.state_combine(), parameters, locals, stack,
2590 state_info.shared_info(), outer_state); 2590 state_info.shared_info(), outer_state);
2591 } 2591 }
2592 2592
2593 2593
2594 } // namespace compiler 2594 } // namespace compiler
2595 } // namespace internal 2595 } // namespace internal
2596 } // namespace v8 2596 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698