| Index: src/a64/lithium-codegen-a64.cc
|
| diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc
|
| index 3a58f021e4b7c1115906e7957105b01a27e4f62d..e4e47c6a1f8d7771e00ddfe34d2466e9f864f123 100644
|
| --- a/src/a64/lithium-codegen-a64.cc
|
| +++ b/src/a64/lithium-codegen-a64.cc
|
| @@ -5118,7 +5118,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr,
|
| if (instr->truncating()) {
|
| Register output = ToRegister(instr->result());
|
| Register scratch2 = ToRegister(temp2);
|
| - Label check_bools, undefined;
|
| + Label check_bools;
|
|
|
| // If it's not a heap number, jump to undefined check.
|
| __ JumpIfNotRoot(scratch1, Heap::kHeapNumberMapRootIndex, &check_bools);
|
| @@ -5130,15 +5130,18 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr,
|
|
|
| __ Bind(&check_bools);
|
|
|
| - TODO_UNIMPLEMENTED("LTaggedToI: Truncate booleans to 0 or 1.");
|
| + Register true_root = output;
|
| + Register false_root = scratch2;
|
| + __ LoadTrueFalseRoots(true_root, false_root);
|
| + __ Cmp(scratch1, true_root);
|
| + __ Cset(output, eq);
|
| + __ Ccmp(scratch1, false_root, ZFlag, ne);
|
| + __ B(eq, &done);
|
|
|
| - // Check for undefined. Undefined is converted to zero for truncating
|
| + // Output contains zero, undefined is converted to zero for truncating
|
| // conversions.
|
| - __ Bind(&undefined);
|
| -
|
| DeoptimizeIfNotRoot(input, Heap::kUndefinedValueRootIndex,
|
| instr->environment());
|
| - __ Mov(output, 0);
|
| } else {
|
| Register output = ToRegister32(instr->result());
|
|
|
|
|