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

Side by Side Diff: src/interpreter/bytecode-register-optimizer.cc

Issue 2382273002: [Interpreter]: Add kRegList operand type for register list operands. (Closed)
Patch Set: Address comments Created 4 years, 2 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
« no previous file with comments | « src/interpreter/bytecode-register-allocator.h ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/interpreter/bytecode-register-optimizer.h" 5 #include "src/interpreter/bytecode-register-optimizer.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace interpreter { 9 namespace interpreter {
10 10
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 // 526 //
527 // For each output register about to be clobbered, materialize an 527 // For each output register about to be clobbered, materialize an
528 // equivalent if it exists. Put each register in it's own equivalence set. 528 // equivalent if it exists. Put each register in it's own equivalence set.
529 // 529 //
530 const uint32_t* operands = node->operands(); 530 const uint32_t* operands = node->operands();
531 int operand_count = node->operand_count(); 531 int operand_count = node->operand_count();
532 const OperandType* operand_types = 532 const OperandType* operand_types =
533 Bytecodes::GetOperandTypes(node->bytecode()); 533 Bytecodes::GetOperandTypes(node->bytecode());
534 for (int i = 0; i < operand_count; ++i) { 534 for (int i = 0; i < operand_count; ++i) {
535 int count; 535 int count;
536 // operand_types is terminated by OperandType::kNone so this does not 536 if (operand_types[i] == OperandType::kRegList) {
537 // go out of bounds. 537 DCHECK_LT(i, operand_count - 1);
538 if (operand_types[i + 1] == OperandType::kRegCount) { 538 DCHECK(operand_types[i + 1] == OperandType::kRegCount);
539 count = static_cast<int>(operands[i + 1]); 539 count = static_cast<int>(operands[i + 1]);
540 } else { 540 } else {
541 count = Bytecodes::GetNumberOfRegistersRepresentedBy(operand_types[i]); 541 count = Bytecodes::GetNumberOfRegistersRepresentedBy(operand_types[i]);
542 } 542 }
543 543
544 if (count == 0) { 544 if (count == 0) {
545 continue; 545 continue;
546 } 546 }
547 547
548 Register reg = Register::FromOperand(static_cast<int32_t>(operands[i])); 548 Register reg = Register::FromOperand(static_cast<int32_t>(operands[i]));
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 void BytecodeRegisterOptimizer::RegisterListFreeEvent(RegisterList reg_list) { 652 void BytecodeRegisterOptimizer::RegisterListFreeEvent(RegisterList reg_list) {
653 int first_index = reg_list.first_register().index(); 653 int first_index = reg_list.first_register().index();
654 for (int i = 0; i < reg_list.register_count(); i++) { 654 for (int i = 0; i < reg_list.register_count(); i++) {
655 GetRegisterInfo(Register(first_index + i))->set_allocated(false); 655 GetRegisterInfo(Register(first_index + i))->set_allocated(false);
656 } 656 }
657 } 657 }
658 658
659 } // namespace interpreter 659 } // namespace interpreter
660 } // namespace internal 660 } // namespace internal
661 } // namespace v8 661 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-register-allocator.h ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698