Commit 6d9f0714 authored by Liu Yu's avatar Liu Yu Committed by V8 LUCI CQ

[loong64][mips] Compare InstanceType Range In AssertGeneratorObject

Port commit ec6368bf

Bug: v8:11325
Change-Id: I3805ec4886dc2cb109fa450c0141d5e3f0779292
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3803673Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Auto-Submit: Liu Yu <liuyu@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#82142}
parent 260aa397
......@@ -3787,23 +3787,11 @@ void MacroAssembler::AssertGeneratorObject(Register object) {
SmiTst(object, t8);
Check(ne, AbortReason::kOperandIsASmiAndNotAGeneratorObject, t8,
Operand(zero_reg));
GetObjectType(object, t8, t8);
Label done;
// Check if JSGeneratorObject
Branch(&done, eq, t8, Operand(JS_GENERATOR_OBJECT_TYPE));
// Check if JSAsyncFunctionObject (See MacroAssembler::CompareInstanceType)
Branch(&done, eq, t8, Operand(JS_ASYNC_FUNCTION_OBJECT_TYPE));
// Check if JSAsyncGeneratorObject
Branch(&done, eq, t8, Operand(JS_ASYNC_GENERATOR_OBJECT_TYPE));
Abort(AbortReason::kOperandIsNotAGeneratorObject);
bind(&done);
Sub_d(t8, t8, Operand(FIRST_JS_GENERATOR_OBJECT_TYPE));
Check(
ls, AbortReason::kOperandIsNotAGeneratorObject, t8,
Operand(LAST_JS_GENERATOR_OBJECT_TYPE - FIRST_JS_GENERATOR_OBJECT_TYPE));
}
void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
......
......@@ -5665,23 +5665,11 @@ void MacroAssembler::AssertGeneratorObject(Register object) {
SmiTst(object, t8);
Check(ne, AbortReason::kOperandIsASmiAndNotAGeneratorObject, t8,
Operand(zero_reg));
GetObjectType(object, t8, t8);
Label done;
// Check if JSGeneratorObject
Branch(&done, eq, t8, Operand(JS_GENERATOR_OBJECT_TYPE));
// Check if JSAsyncFunctionObject (See MacroAssembler::CompareInstanceType)
Branch(&done, eq, t8, Operand(JS_ASYNC_FUNCTION_OBJECT_TYPE));
// Check if JSAsyncGeneratorObject
Branch(&done, eq, t8, Operand(JS_ASYNC_GENERATOR_OBJECT_TYPE));
Abort(AbortReason::kOperandIsNotAGeneratorObject);
bind(&done);
Dsubu(t8, t8, Operand(FIRST_JS_GENERATOR_OBJECT_TYPE));
Check(
ls, AbortReason::kOperandIsNotAGeneratorObject, t8,
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