2021-10-24 13:30:49 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-01-08 19:23:00 -05:00
|
|
|
#include <AK/DeprecatedFlyString.h>
|
2021-10-24 13:30:49 +02:00
|
|
|
#include <AK/NonnullOwnPtrVector.h>
|
|
|
|
#include <LibJS/Bytecode/BasicBlock.h>
|
2021-10-24 15:34:30 +02:00
|
|
|
#include <LibJS/Bytecode/IdentifierTable.h>
|
2021-10-24 13:30:49 +02:00
|
|
|
#include <LibJS/Bytecode/StringTable.h>
|
|
|
|
|
|
|
|
namespace JS::Bytecode {
|
|
|
|
|
|
|
|
struct Executable {
|
2023-01-08 19:23:00 -05:00
|
|
|
DeprecatedFlyString name;
|
2021-10-24 13:30:49 +02:00
|
|
|
NonnullOwnPtrVector<BasicBlock> basic_blocks;
|
|
|
|
NonnullOwnPtr<StringTable> string_table;
|
2021-10-24 15:34:30 +02:00
|
|
|
NonnullOwnPtr<IdentifierTable> identifier_table;
|
2021-10-24 13:30:49 +02:00
|
|
|
size_t number_of_registers { 0 };
|
2022-07-17 18:56:36 +01:00
|
|
|
bool is_strict_mode { false };
|
2021-10-24 13:30:49 +02:00
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
DeprecatedString const& get_string(StringTableIndex index) const { return string_table->get(index); }
|
2023-01-08 19:23:00 -05:00
|
|
|
DeprecatedFlyString const& get_identifier(IdentifierTableIndex index) const { return identifier_table->get(index); }
|
2021-10-24 13:30:49 +02:00
|
|
|
|
|
|
|
void dump() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|