#ifndef V8_OBJECTS_ABSTRACT_CODE_H_
#define V8_OBJECTS_ABSTRACT_CODE_H_
#include "src/objects/code-kind.h"
#include "src/objects/heap-object.h"
#include "src/objects/object-macros.h"
namespace v8 {
namespace internal {
enum class Builtin;
class BytecodeArray;
class Code;
class AbstractCode : public HeapObject {
public:
int SourcePosition(Isolate* isolate, int offset);
int SourceStatementPosition(Isolate* isolate, int offset);
inline Address InstructionStart(PtrComprCageBase cage_base);
inline Address InstructionEnd(PtrComprCageBase cage_base);
inline int InstructionSize(PtrComprCageBase cage_base);
inline Tagged<TrustedByteArray> SourcePositionTable(
Isolate* isolate, Tagged<SharedFunctionInfo> sfi);
void DropStackFrameCache(PtrComprCageBase cage_base);
inline int SizeIncludingMetadata(PtrComprCageBase cage_base);
inline bool contains(Isolate* isolate, Address pc);
inline CodeKind kind(PtrComprCageBase cage_base);
inline Builtin builtin_id(PtrComprCageBase cage_base);
inline bool has_instruction_stream(PtrComprCageBase cage_base);
bool is_context_specialized(PtrComprCageBase cage_base);
BytecodeOffset osr_offset(PtrComprCageBase cage_base);
inline Tagged<Code> GetCode();
inline Tagged<BytecodeArray> GetBytecodeArray();
private:
OBJECT_CONSTRUCTORS(AbstractCode, HeapObject);
};
static_assert(!kAllCodeObjectsLiveInTrustedSpace);
constexpr bool operator==(const Tagged<AbstractCode> lhs,
const Tagged<AbstractCode> rhs) {
return lhs->ptr() == rhs->ptr();
}
}
}
#include "src/objects/object-macros-undef.h"
#endif