mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
15257669fd
Issue:#I7SJH1 Signed-off-by: yang-19970325 <yangyang585@huawei.com> Change-Id: I106dddf738b084d9133f008cb117f12a06c11d05
78 lines
2.3 KiB
C++
78 lines
2.3 KiB
C++
/*
|
|
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#ifndef ECMASCRIPT_IC_IC_COMPARE_OP_H
|
|
#define ECMASCRIPT_IC_IC_COMPARE_OP_H
|
|
|
|
#include "ecmascript/js_function.h"
|
|
#include "ecmascript/js_thread.h"
|
|
#include "ecmascript/object_factory.h"
|
|
|
|
namespace panda::ecmascript {
|
|
enum class CompareOpType {
|
|
NUMBER_NUMBER,
|
|
NUMBER_STRING,
|
|
NUMBER_BOOLEAN,
|
|
NUMBER_OBJ,
|
|
STRING_STRING,
|
|
STRING_NUMBER,
|
|
STRING_BOOLEAN,
|
|
STRING_OBJ,
|
|
BOOLEAN_BOOLEAN,
|
|
BOOLEAN_NUMBER,
|
|
BOOLEAN_STRING,
|
|
BOOLEAN_OBJ,
|
|
OBJ_OBJ,
|
|
OBJ_NUMBER,
|
|
OBJ_STRING,
|
|
OBJ_BOOLEAN,
|
|
SYMBOL_SYMBOL,
|
|
NULL_NULL,
|
|
NULL_UNDEFINED,
|
|
UNDEFINED_UNDEFINED,
|
|
UNDEFINED_NULL,
|
|
UNDEFINED_BLLEAN,
|
|
OTHER,
|
|
};
|
|
|
|
class CompareOp {
|
|
public:
|
|
|
|
CompareOp() = default;
|
|
~CompareOp() = default;
|
|
|
|
static JSTaggedValue EqualWithIC(JSThread* thread, JSTaggedValue left,
|
|
JSTaggedValue right, CompareOpType operationType);
|
|
|
|
static JSTaggedValue NotEqualWithIC(JSThread *thread, JSTaggedValue left,
|
|
JSTaggedValue right, CompareOpType operationType);
|
|
|
|
static ComparisonResult Compare(JSThread *thread, JSTaggedValue left,
|
|
JSTaggedValue right, CompareOpType operationType);
|
|
|
|
static JSTaggedValue LessWithIC(JSThread *thread, JSTaggedValue left,
|
|
JSTaggedValue right, CompareOpType operationType);
|
|
|
|
static JSTaggedValue LessEqWithIC(JSThread *thread, JSTaggedValue left,
|
|
JSTaggedValue right, CompareOpType operationType);
|
|
|
|
static JSTaggedValue GreaterWithIC(JSThread *thread, JSTaggedValue left,
|
|
JSTaggedValue right, CompareOpType operationType);
|
|
|
|
static JSTaggedValue GreaterEqWithIC(JSThread *thread, JSTaggedValue left,
|
|
JSTaggedValue right, CompareOpType operationType);
|
|
};
|
|
} // namespace panda::ecmascript
|
|
#endif // ECMASCRIPT_IC_IC_COMPARE_OP_H
|