Skip to content

Commit fcb9787

Browse files
committed
Release registers in WasmByteCodeGenerator
Release arguments to bit select instruction, rearrange code in EmitExtractLaneExpr to match the rest of the file.
1 parent a952946 commit fcb9787

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/WasmReader/WasmByteCodeGenerator.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,11 @@ EmitInfo WasmBytecodeGenerator::EmitM128BitSelect()
15801580
EmitInfo mask = PopEvalStack(WasmTypes::M128);
15811581
EmitInfo arg2Info = PopEvalStack(WasmTypes::M128);
15821582
EmitInfo arg1Info = PopEvalStack(WasmTypes::M128);
1583+
1584+
ReleaseLocation(&mask);
1585+
ReleaseLocation(&arg2Info);
1586+
ReleaseLocation(&arg1Info);
1587+
15831588
Js::RegSlot resultReg = GetRegisterSpace(WasmTypes::M128)->AcquireTmpRegister();
15841589
EmitInfo resultInfo(resultReg, WasmTypes::M128);
15851590
m_writer->AsmReg4(Js::OpCodeAsmJs::Simd128_BitSelect_I4, resultReg, arg1Info.location, arg2Info.location, mask.location);
@@ -1591,6 +1596,8 @@ EmitInfo WasmBytecodeGenerator::EmitV8X16Shuffle()
15911596
EmitInfo arg2Info = PopEvalStack(WasmTypes::M128);
15921597
EmitInfo arg1Info = PopEvalStack(WasmTypes::M128);
15931598

1599+
// FIXME Release arg2Info and arg1Info
1600+
15941601
Js::RegSlot resultReg = GetRegisterSpace(WasmTypes::M128)->AcquireTmpRegister();
15951602
EmitInfo resultInfo(resultReg, WasmTypes::M128);
15961603

@@ -1613,16 +1620,16 @@ EmitInfo WasmBytecodeGenerator::EmitExtractLaneExpr(Js::OpCodeAsmJs op, const Wa
16131620
WasmTypes::WasmType simdArgType = signature[1];
16141621

16151622
EmitInfo simdArgInfo = PopEvalStack(simdArgType, _u("Argument should be of type M128"));
1623+
ReleaseLocation(&simdArgInfo);
16161624

16171625
Js::RegSlot resultReg = GetRegisterSpace(resultType)->AcquireTmpRegister();
16181626
EmitInfo resultInfo(resultReg, resultType);
16191627

16201628
//put index into a register to reuse the existing infra in Interpreter and Compiler
16211629
EmitInfo indexInfo = EmitLaneIndex(op);
1630+
ReleaseLocation(&indexInfo);
16221631

16231632
m_writer->AsmReg3(op, resultReg, simdArgInfo.location, indexInfo.location);
1624-
ReleaseLocation(&indexInfo);
1625-
ReleaseLocation(&simdArgInfo);
16261633
return resultInfo;
16271634
}
16281635

0 commit comments

Comments
 (0)