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

Side by Side Diff: test/unittests/interpreter/bytecode-register-allocator-unittest.cc

Issue 2557173004: [Interpreter] Allocate registers used as call arguments on-demand. (Closed)
Patch Set: Created 4 years 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/interpreter/bytecode-array-builder.h" 7 #include "src/interpreter/bytecode-array-builder.h"
8 #include "src/interpreter/bytecode-register-allocator.h" 8 #include "src/interpreter/bytecode-register-allocator.h"
9 #include "test/unittests/test-utils.h" 9 #include "test/unittests/test-utils.h"
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 CHECK_EQ(allocator()->maximum_register_count(), 6); 84 CHECK_EQ(allocator()->maximum_register_count(), 6);
85 CHECK_EQ(allocator()->next_register_index(), 3); 85 CHECK_EQ(allocator()->next_register_index(), 3);
86 86
87 RegisterList empty_reg_list = allocator()->NewRegisterList(0); 87 RegisterList empty_reg_list = allocator()->NewRegisterList(0);
88 CHECK_EQ(empty_reg_list.first_register().index(), 0); 88 CHECK_EQ(empty_reg_list.first_register().index(), 0);
89 CHECK_EQ(empty_reg_list.register_count(), 0); 89 CHECK_EQ(empty_reg_list.register_count(), 0);
90 CHECK_EQ(allocator()->maximum_register_count(), 6); 90 CHECK_EQ(allocator()->maximum_register_count(), 6);
91 CHECK_EQ(allocator()->next_register_index(), 3); 91 CHECK_EQ(allocator()->next_register_index(), 3);
92 } 92 }
93 93
94 TEST_F(BytecodeRegisterAllocatorTest, GrowableRegisterListAllocations) {
95 CHECK_EQ(allocator()->maximum_register_count(), 0);
96 Register reg = allocator()->NewRegister();
97 CHECK_EQ(reg.index(), 0);
98 RegisterList reg_list = allocator()->NewGrowableRegisterList();
99 CHECK_EQ(reg_list.register_count(), 0);
100 allocator()->GrowRegisterList(&reg_list);
101 allocator()->GrowRegisterList(&reg_list);
102 allocator()->GrowRegisterList(&reg_list);
103 CHECK_EQ(reg_list.register_count(), 3);
104 CHECK_EQ(reg_list[0].index(), 1);
105 CHECK_EQ(reg_list[1].index(), 2);
106 CHECK_EQ(reg_list[2].index(), 3);
107 CHECK_EQ(allocator()->maximum_register_count(), 4);
108 CHECK_EQ(allocator()->next_register_index(), 4);
109 }
110
94 } // namespace interpreter 111 } // namespace interpreter
95 } // namespace internal 112 } // namespace internal
96 } // namespace v8 113 } // namespace v8
OLDNEW
« src/interpreter/bytecode-generator.cc ('K') | « test/mjsunit/ignition/regress-672027.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698