5#ifndef V8_OBJECTS_SCRIPT_INL_H_
6#define V8_OBJECTS_SCRIPT_INL_H_
23#include "torque-generated/src/objects/script-tq-inl.inc"
29#if V8_ENABLE_WEBASSEMBLY
31 kEvalFromSharedOrWrappedArgumentsOffset,
32 this->
type() == Type::kWasm)
36 kInfosOffset, this->
type() == Type::kWasm)
37#define CHECK_SCRIPT_NOT_WASM this->type() != Type::kWasm
39#define CHECK_SCRIPT_NOT_WASM true
44 return static_cast<Type>(value.value());
46void Script::set_type(Type value) {
52 kEvalFromSharedOrWrappedArgumentsOffset,
56#undef CHECK_SCRIPT_NOT_WASM
59 kCompiledLazyFunctionPositionsOffset)
62 return IsFixedArray(eval_from_shared_or_wrapped_arguments());
66 return IsSharedFunctionInfo(eval_from_shared_or_wrapped_arguments());
72 set_eval_from_shared_or_wrapped_arguments(shared, mode);
83 set_eval_from_shared_or_wrapped_arguments(value, mode);
92#if V8_ENABLE_WEBASSEMBLY
93 if (
type() == Type::kWasm) {
101#if V8_ENABLE_WEBASSEMBLY
108#if V8_ENABLE_WEBASSEMBLY
109bool Script::has_wasm_breakpoint_infos()
const {
110 return type() == Type::kWasm && wasm_breakpoint_infos()->length() > 0;
113wasm::NativeModule* Script::wasm_native_module()
const {
117bool Script::break_on_entry()
const {
return BreakOnEntryBit::decode(
flags()); }
119void Script::set_break_on_entry(
bool value) {
132 DCHECK(is_int31(new_flags));
137 return CompilationTypeBit::decode(
flags());
143 return CompilationStateBit::decode(
flags());
150 return ProduceCompileHintsBit::decode(
flags());
179 if (!IsString(src))
return true;
181 if (!
StringShape(src_str).IsExternal())
return true;
182 if (src_str->IsOneByteRepresentation()) {
184 }
else if (src_str->IsTwoByteRepresentation()) {
193#if V8_ENABLE_WEBASSEMBLY
194 return type() != Script::Type::kWasm;
202 if (script->has_line_ends())
return;
207 if (script->has_line_ends())
return;
212 return IsString(source_url()) &&
Cast<String>(source_url())->length() != 0;
216 return IsString(source_mapping_url()) &&
223 return IsUndefined(
source(), isolate) ||
230 while (origin_script->has_eval_from_shared()) {
232 origin_script->eval_from_shared()->script();
233 CHECK(IsScript(maybe_script));
236 return origin_script;
void set_origin_options(ScriptOriginOptions origin_options)
bool CanHaveLineEnds() const
CompilationState compilation_state()
void set_is_repl_mode(bool value)
void set_deserialized(bool value)
static void InitLineEnds(Isolate *isolate, DirectHandle< Script > script)
bool produce_compile_hints() const
CompilationType compilation_type() const
void set_produce_compile_hints(bool produce_compile_hints)
bool IsMaybeUnfinalized(Isolate *isolate) const
bool has_line_ends() const
bool HasSourceURLComment() const
static void V8_PRESERVE_MOST InitLineEndsInternal(IsolateT *isolate, DirectHandle< Script > script)
bool deserialized() const
void set_flags(uint32_t new_flags)
v8::ScriptOriginOptions origin_options()
void set_compilation_type(CompilationType type)
bool HasSourceMappingURLComment() const
void set_compilation_state(CompilationState state)
bool has_eval_from_shared() const
bool is_repl_mode() const
Tagged< Script > GetEvalOrigin()
static constexpr Tagged< Smi > FromInt(int value)
static constexpr Tagged< Smi > zero()
static PtrType load(Tagged< HeapObject > host, int offset=0)
static void Relaxed_Store(Tagged< HeapObject > host, PtrType value)
static PtrType Relaxed_Load(Tagged< HeapObject > host, int offset=0)
static void store(Tagged< HeapObject > host, PtrType value)
InstructionOperand source
ReadOnlyRoots GetReadOnlyRoots()
Tagged(T object) -> Tagged< T >
kStaticElementsTemplateOffset kInstancePropertiesTemplateOffset Tagged< FixedArray >
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define SMI_ACCESSORS_CHECKED(holder, name, offset, condition)
#define ACCESSORS(holder, name, type, offset)
#define TQ_OBJECT_CONSTRUCTORS_IMPL(Type)
#define CONDITIONAL_WRITE_BARRIER(object, offset, value, mode)
#define ACCESSORS_CHECKED(holder, name, type, offset, condition)
#define NEVER_READ_ONLY_SPACE_IMPL(Type)
#define DEF_GETTER(Camel, Lower, Bit)
#define CHECK_SCRIPT_NOT_WASM
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)