OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter-assembler.h" | 5 #include "src/interpreter/interpreter-assembler.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <ostream> | 8 #include <ostream> |
9 | 9 |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 if (FLAG_debug_code) { | 719 if (FLAG_debug_code) { |
720 Node* array_size = SmiUntag(LoadFixedArrayBaseLength(array)); | 720 Node* array_size = SmiUntag(LoadFixedArrayBaseLength(array)); |
721 AbortIfWordNotEqual( | 721 AbortIfWordNotEqual( |
722 array_size, RegisterCount(), kInvalidRegisterFileInGenerator); | 722 array_size, RegisterCount(), kInvalidRegisterFileInGenerator); |
723 } | 723 } |
724 | 724 |
725 Variable var_index(this, MachineRepresentation::kWord32); | 725 Variable var_index(this, MachineRepresentation::kWord32); |
726 var_index.Bind(Int32Constant(0)); | 726 var_index.Bind(Int32Constant(0)); |
727 | 727 |
728 // Iterate over register file and write values into array. | 728 // Iterate over register file and write values into array. |
| 729 // The mapping of register to array index must match that used in |
| 730 // BytecodeGraphBuilder::VisitResumeGenerator. |
729 Label loop(this, &var_index), done_loop(this); | 731 Label loop(this, &var_index), done_loop(this); |
730 Goto(&loop); | 732 Goto(&loop); |
731 Bind(&loop); | 733 Bind(&loop); |
732 { | 734 { |
733 Node* index = var_index.value(); | 735 Node* index = var_index.value(); |
734 Node* condition = Int32LessThan(index, RegisterCount()); | 736 Node* condition = Int32LessThan(index, RegisterCount()); |
735 GotoUnless(condition, &done_loop); | 737 GotoUnless(condition, &done_loop); |
736 | 738 |
737 Node* reg_index = | 739 Node* reg_index = |
738 Int32Sub(Int32Constant(Register(0).ToOperand()), index); | 740 Int32Sub(Int32Constant(Register(0).ToOperand()), index); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 Goto(&loop); | 782 Goto(&loop); |
781 } | 783 } |
782 Bind(&done_loop); | 784 Bind(&done_loop); |
783 | 785 |
784 return array; | 786 return array; |
785 } | 787 } |
786 | 788 |
787 } // namespace interpreter | 789 } // namespace interpreter |
788 } // namespace internal | 790 } // namespace internal |
789 } // namespace v8 | 791 } // namespace v8 |
OLD | NEW |