diff --git a/src/builtins/ppc/builtins-ppc.cc b/src/builtins/ppc/builtins-ppc.cc index 9ada8ad44d..f089f086af 100644 --- a/src/builtins/ppc/builtins-ppc.cc +++ b/src/builtins/ppc/builtins-ppc.cc @@ -1101,11 +1101,17 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { FrameScope frame_scope(masm, StackFrame::MANUAL); __ PushStandardFrame(closure); - // Reset code age. - __ mov(r8, Operand(BytecodeArray::kNoAgeBytecodeAge)); - __ StoreByte(r8, FieldMemOperand(kInterpreterBytecodeArrayRegister, - BytecodeArray::kBytecodeAgeOffset), - r0); + // Reset code age and the OSR arming. The OSR field and BytecodeAgeOffset are + // 8-bit fields next to each other, so we could just optimize by writing a + // 16-bit. These static asserts guard our assumption is valid. + STATIC_ASSERT(BytecodeArray::kBytecodeAgeOffset == + BytecodeArray::kOSRNestingLevelOffset + kCharSize); + STATIC_ASSERT(BytecodeArray::kNoAgeBytecodeAge == 0); + __ li(r8, Operand(0)); + __ StoreHalfWord(r8, + FieldMemOperand(kInterpreterBytecodeArrayRegister, + BytecodeArray::kOSRNestingLevelOffset), + r0); // Load initial bytecode offset. __ mov(kInterpreterBytecodeOffsetRegister, diff --git a/src/builtins/s390/builtins-s390.cc b/src/builtins/s390/builtins-s390.cc index 3134a3f43e..b242e8921a 100644 --- a/src/builtins/s390/builtins-s390.cc +++ b/src/builtins/s390/builtins-s390.cc @@ -1152,11 +1152,17 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { FrameScope frame_scope(masm, StackFrame::MANUAL); __ PushStandardFrame(closure); - // Reset code age. - __ mov(r1, Operand(BytecodeArray::kNoAgeBytecodeAge)); - __ StoreByte(r1, FieldMemOperand(kInterpreterBytecodeArrayRegister, - BytecodeArray::kBytecodeAgeOffset), - r0); + // Reset code age and the OSR arming. The OSR field and BytecodeAgeOffset are + // 8-bit fields next to each other, so we could just optimize by writing a + // 16-bit. These static asserts guard our assumption is valid. + STATIC_ASSERT(BytecodeArray::kBytecodeAgeOffset == + BytecodeArray::kOSRNestingLevelOffset + kCharSize); + STATIC_ASSERT(BytecodeArray::kNoAgeBytecodeAge == 0); + __ lghi(r1, Operand(0)); + __ StoreHalfWord(r1, + FieldMemOperand(kInterpreterBytecodeArrayRegister, + BytecodeArray::kOSRNestingLevelOffset), + r0); // Load the initial bytecode offset. __ mov(kInterpreterBytecodeOffsetRegister,