arkcompiler_ets_runtime/ecmascript/js_regexp.h
yaochaonan 911a7c1b37 Opt string regexp
Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I9CRLW?from=project-issue

Signed-off-by: yaochaonan <yaochaonan@huawei.com>
Change-Id: I5c61752f3be923a4d9c48086613afcff5d0d3512
2024-04-25 16:51:36 +08:00

51 lines
1.9 KiB
C++

/*
* Copyright (c) 2021 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_JSREGEXP_H
#define ECMASCRIPT_JSREGEXP_H
#include "ecmascript/ecma_macros.h"
#include "ecmascript/js_object.h"
#include "ecmascript/js_hclass.h"
#include "ecmascript/js_tagged_value-inl.h"
namespace panda::ecmascript {
class JSRegExp : public JSObject {
public:
static constexpr int EXEC_INLINE_PROPERTY_INDEX = 1;
static constexpr int SPLIT_INLINE_PROPERTY_INDEX = 13;
static constexpr int SEARCH_INLINE_PROPERTY_INDEX = 14;
static constexpr int MATCH_INLINE_PROPERTY_INDEX = 15;
static constexpr int MATCHALL_INLINE_PROPERTY_INDEX = 16;
static constexpr int REPLACE_INLINE_PROPERTY_INDEX = 17;
CAST_CHECK(JSRegExp, IsJSRegExp);
static constexpr size_t REGEXP_BYTE_CODE_OFFSET = JSObject::SIZE;
ACCESSORS(ByteCodeBuffer, REGEXP_BYTE_CODE_OFFSET, ORIGINAL_SOURCE_OFFSET)
ACCESSORS(OriginalSource, ORIGINAL_SOURCE_OFFSET, ORIGINAL_FLAGS_OFFSET)
ACCESSORS(OriginalFlags, ORIGINAL_FLAGS_OFFSET, GROUP_NAME_OFFSET)
ACCESSORS(GroupName, GROUP_NAME_OFFSET, LENGTH_OFFSET)
ACCESSORS_PRIMITIVE_FIELD(Length, uint32_t, LENGTH_OFFSET, LAST_OFFSET)
DEFINE_ALIGN_SIZE(LAST_OFFSET);
DECL_VISIT_OBJECT_FOR_JS_OBJECT(JSObject, REGEXP_BYTE_CODE_OFFSET, LENGTH_OFFSET)
DECL_DUMP()
};
} // namespace panda::ecmascript
#endif // ECMASCRIPT_JSPRIMITIVEREF_H