Lines Matching refs:allocator
8 #include "src/interpreter/bytecode-register-allocator.h"
19 TemporaryRegisterAllocator* allocator() { return &allocator_; }
26 CHECK_EQ(allocator()->allocation_count(), 0);
27 int reg0_index = allocator()->BorrowTemporaryRegister();
29 CHECK_EQ(allocator()->allocation_count(), 1);
30 CHECK(allocator()->RegisterIsLive(Register(reg0_index)));
31 allocator()->ReturnTemporaryRegister(reg0_index);
32 CHECK(!allocator()->RegisterIsLive(Register(reg0_index)));
33 CHECK_EQ(allocator()->allocation_count(), 1);
34 CHECK(allocator()->first_temporary_register() == Register(0));
35 CHECK(allocator()->last_temporary_register() == Register(0));
40 int reg_index = allocator()->BorrowTemporaryRegister();
42 CHECK_EQ(allocator()->allocation_count(), i + 1);
45 CHECK(allocator()->RegisterIsLive(Register(i)));
46 allocator()->ReturnTemporaryRegister(i);
47 CHECK(!allocator()->RegisterIsLive(Register(i)));
48 int reg_index = allocator()->BorrowTemporaryRegister();
50 CHECK_EQ(allocator()->allocation_count(), 13);
53 CHECK(allocator()->RegisterIsLive(Register(i)));
54 allocator()->ReturnTemporaryRegister(i);
55 CHECK(!allocator()->RegisterIsLive(Register(i)));
61 int start = allocator()->PrepareForConsecutiveTemporaryRegisters(kRunLength);
62 CHECK(!allocator()->RegisterIsLive(Register(start)));
64 CHECK(!allocator()->RegisterIsLive(Register(start + i)));
65 allocator()->BorrowConsecutiveTemporaryRegister(start + i);
66 CHECK(allocator()->RegisterIsLive(Register(start + i)));
75 int to_free = allocator()->BorrowTemporaryRegister();
79 allocator()->ReturnTemporaryRegister(i);
82 int start = allocator()->PrepareForConsecutiveTemporaryRegisters(kRunLength);
83 CHECK(!allocator()->RegisterIsLive(Register(start)));
85 CHECK(!allocator()->RegisterIsLive(Register(start + i)));
86 allocator()->BorrowConsecutiveTemporaryRegister(start + i);
87 CHECK(allocator()->RegisterIsLive(Register(start + i)));
97 int to_free = allocator()->BorrowTemporaryRegister();
101 allocator()->ReturnTemporaryRegister(i);
103 int start = allocator()->PrepareForConsecutiveTemporaryRegisters(kRunLength);
104 CHECK(!allocator()->RegisterIsLive(Register(start)));
107 CHECK(!allocator()->RegisterIsLive(Register(start + i)));
108 allocator()->BorrowConsecutiveTemporaryRegister(start + i);
109 CHECK(allocator()->RegisterIsLive(Register(start + i)));
119 int allocated = allocator()->BorrowTemporaryRegister();
125 allocator()->ReturnTemporaryRegister(i);
126 allocator()->ReturnTemporaryRegister(kNotRunLength + kRunLength + i);
131 allocator()->ReturnTemporaryRegister(i);
134 int start = allocator()->PrepareForConsecutiveTemporaryRegisters(kRunLength);
137 CHECK(!allocator()->RegisterIsLive(Register(start + i)));
138 allocator()->BorrowConsecutiveTemporaryRegister(start + i);
139 CHECK(allocator()->RegisterIsLive(Register(start + i)));
145 int reg = allocator()->BorrowTemporaryRegisterNotInRange(2, 5);
150 allocator()->ReturnTemporaryRegister(i);
152 allocator()->ReturnTemporaryRegister(i + 4);
155 int reg0 = allocator()->BorrowTemporaryRegisterNotInRange(0, 3);
157 int reg1 = allocator()->BorrowTemporaryRegisterNotInRange(3, 10);
159 int reg2 = allocator()->BorrowTemporaryRegisterNotInRange(2, 6);
161 allocator()->ReturnTemporaryRegister(reg0);
162 allocator()->ReturnTemporaryRegister(reg1);
163 allocator()->ReturnTemporaryRegister(reg2);
177 BytecodeRegisterAllocator allocator(zone(),
179 first = allocator.NewRegister().index();
180 allocator.NewRegister();
181 allocator.NewRegister();
182 allocator.NewRegister();
187 BytecodeRegisterAllocator allocator(zone(),
189 second = allocator.NewRegister().index();
197 BytecodeRegisterAllocator allocator(zone(),
199 allocator.PrepareForConsecutiveAllocations(4);
200 Register reg0 = allocator.NextConsecutiveRegister();
201 Register other = allocator.NewRegister();
202 Register reg1 = allocator.NextConsecutiveRegister();
203 Register reg2 = allocator.NextConsecutiveRegister();
204 Register reg3 = allocator.NextConsecutiveRegister();