[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: ji qiu <qiuji@iscas.ac.cn> Commit-Queue: ji qiu <qiuji@iscas.ac.cn> Cr-Commit-Position: refs/heads/main@{#82054}
This commit is contained in:
parent
491de34bcc
commit
859ff48961
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user