| Index: src/ia32/code-stubs-ia32.h
|
| diff --git a/src/ia32/code-stubs-ia32.h b/src/ia32/code-stubs-ia32.h
|
| index 3aa18f250af05b1c45c8b2c4f4cf2f12d650bd52..12a556f19bd474dd8b9d60fa8bc44f72c3d36321 100644
|
| --- a/src/ia32/code-stubs-ia32.h
|
| +++ b/src/ia32/code-stubs-ia32.h
|
| @@ -320,13 +320,15 @@ class RecordWriteStub: public PlatformCodeStub {
|
| Register GetRegThatIsNotEcxOr(Register r1,
|
| Register r2,
|
| Register r3) {
|
| - for (int i = 0; i < Register::NumAllocatableRegisters(); i++) {
|
| - Register candidate = Register::FromAllocationIndex(i);
|
| - if (candidate.is(ecx)) 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(ecx)) continue;
|
| + if (candidate.is(r1)) continue;
|
| + if (candidate.is(r2)) continue;
|
| + if (candidate.is(r3)) continue;
|
| + return candidate;
|
| + }
|
| }
|
| UNREACHABLE();
|
| return no_reg;
|
|
|