Commit 859ff489 authored by Lu Yahan's avatar Lu Yahan Committed by V8 LUCI CQ

[riscv][Cleanup] Use CmpInstanceTypeRange in MacroAssembler

Bug: v8:11325

Change-Id: I2eae55b49ea01567460bd0adfbb819c893ce7cd7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3793210
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: 's avatarji qiu <qiuji@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#82054}
parent 491de34b
......@@ -5624,22 +5624,11 @@ void MacroAssembler::AssertGeneratorObject(Register object) {
Check(ne, AbortReason::kOperandIsASmiAndNotAGeneratorObject, kScratchReg,
Operand(zero_reg));
GetObjectType(object, kScratchReg, kScratchReg);
Label done;
// Check if JSGeneratorObject
BranchShort(&done, eq, kScratchReg, Operand(JS_GENERATOR_OBJECT_TYPE));
// Check if JSAsyncFunctionObject (See MacroAssembler::CompareInstanceType)
BranchShort(&done, eq, kScratchReg, Operand(JS_ASYNC_FUNCTION_OBJECT_TYPE));
// Check if JSAsyncGeneratorObject
BranchShort(&done, eq, kScratchReg, Operand(JS_ASYNC_GENERATOR_OBJECT_TYPE));
Abort(AbortReason::kOperandIsNotAGeneratorObject);
bind(&done);
GetInstanceTypeRange(object, object, FIRST_JS_GENERATOR_OBJECT_TYPE,
kScratchReg);
Check(
Uless_equal, AbortReason::kOperandIsNotAGeneratorObject, kScratchReg,
Operand(LAST_JS_GENERATOR_OBJECT_TYPE - FIRST_JS_GENERATOR_OBJECT_TYPE));
}
void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment