| Index: src/x64/code-stubs-x64.h
|
| diff --git a/src/x64/code-stubs-x64.h b/src/x64/code-stubs-x64.h
|
| index 09289cf3122417ef598af8d3ef2d22761b5984be..4ba5892b541e8fb00966ded40fdb87ce5c4fcfdd 100644
|
| --- a/src/x64/code-stubs-x64.h
|
| +++ b/src/x64/code-stubs-x64.h
|
| @@ -294,13 +294,15 @@ class RecordWriteStub: public PlatformCodeStub {
|
| Register GetRegThatIsNotRcxOr(Register r1,
|
| Register r2,
|
| Register r3) {
|
| - for (int i = 0; i < Register::NumAllocatableRegisters(); i++) {
|
| - Register candidate = Register::FromAllocationIndex(i);
|
| - if (candidate.is(rcx)) continue;
|
| - if (candidate.is(r1)) continue;
|
| - if (candidate.is(r2)) continue;
|
| - if (candidate.is(r3)) continue;
|
| - return candidate;
|
| + for (int i = 0; i < Register::kNumRegisters; i++) {
|
| + Register candidate = Register::from_code(i);
|
| + if (candidate.IsAllocatable()) {
|
| + if (candidate.is(rcx)) continue;
|
| + if (candidate.is(r1)) continue;
|
| + if (candidate.is(r2)) continue;
|
| + if (candidate.is(r3)) continue;
|
| + return candidate;
|
| + }
|
| }
|
| UNREACHABLE();
|
| return no_reg;
|
|
|