#ifndef V8_OBJECTS_JS_FUNCTION_INL_H_
#define V8_OBJECTS_JS_FUNCTION_INL_H_
#include <optional>
#include "src/objects/js-function.h"
#include "src/diagnostics/code-tracer.h"
#include "src/ic/ic.h"
#include "src/init/bootstrapper.h"
#include "src/objects/abstract-code-inl.h"
#include "src/objects/feedback-cell-inl.h"
#include "src/objects/instance-type-inl.h"
#include "src/objects/map-updater.h"
#include "src/objects/shared-function-info-inl.h"
#include "src/sandbox/js-dispatch-table-inl.h"
#include "src/objects/object-macros.h"
namespace v8::internal {
#include "torque-generated/src/objects/js-function-tq-inl.inc"
TQ_OBJECT_CONSTRUCTORS_IMPL(JSFunctionOrBoundFunctionOrWrappedFunction)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSBoundFunction)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSWrappedFunction)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSFunction)
ACCESSORS
RELEASE_ACQUIRE_ACCESSORS
DEF_GETTER { …
Tagged<ClosureFeedbackCellArray> JSFunction::closure_feedback_cell_array()
const { … }
void JSFunction::reset_tiering_state() { … }
bool JSFunction::ChecksTieringState(IsolateForSandbox isolate) { … }
void JSFunction::CompleteInobjectSlackTrackingIfActive() { … }
template <typename IsolateT>
Tagged<AbstractCode> JSFunction::abstract_code(IsolateT* isolate) { … }
int JSFunction::length() { … }
void JSFunction::UpdateMaybeContextSpecializedCode(Isolate* isolate,
Tagged<Code> value,
WriteBarrierMode mode) { … }
void JSFunction::UpdateContextSpecializedCode(Isolate* isolate,
Tagged<Code> value,
WriteBarrierMode mode) { … }
void JSFunction::UpdateCode(Tagged<Code> value, WriteBarrierMode mode) { … }
Tagged<Code> JSFunction::code(IsolateForSandbox isolate) const { … }
Tagged<Code> JSFunction::code(IsolateForSandbox isolate,
AcquireLoadTag tag) const { … }
Tagged<Object> JSFunction::raw_code(IsolateForSandbox isolate) const { … }
Tagged<Object> JSFunction::raw_code(IsolateForSandbox isolate,
AcquireLoadTag tag) const { … }
#ifdef V8_ENABLE_LEAPTIERING
void JSFunction::initialize_dispatch_handle(IsolateForSandbox isolate,
uint16_t parameter_count) {
InitJSDispatchHandleField(kDispatchHandleOffset, isolate, parameter_count);
}
void JSFunction::initialize_dispatch_handle(IsolateForSandbox isolate,
uint16_t parameter_count,
Tagged<Code> code,
Address entrypoint) {
InitJSDispatchHandleField(kDispatchHandleOffset, isolate, parameter_count,
code, entrypoint);
}
void JSFunction::clear_dispatch_handle() {
WriteField<JSDispatchHandle>(kDispatchHandleOffset, kNullJSDispatchHandle);
}
void JSFunction::set_dispatch_handle(JSDispatchHandle handle) {
Relaxed_WriteField<JSDispatchHandle>(kDispatchHandleOffset, handle);
}
JSDispatchHandle JSFunction::dispatch_handle() const {
return Relaxed_ReadField<JSDispatchHandle>(kDispatchHandleOffset);
}
JSDispatchHandle JSFunction::dispatch_handle(AcquireLoadTag tag) const {
return Acquire_ReadField<JSDispatchHandle>(kDispatchHandleOffset);
}
#endif
RELEASE_ACQUIRE_ACCESSORS
Address JSFunction::instruction_start(IsolateForSandbox isolate) const { … }
DEF_GETTER { …
DEF_RELAXED_GETTER { …
void JSFunction::set_shared(Tagged<SharedFunctionInfo> value,
WriteBarrierMode mode) { … }
TieringState JSFunction::tiering_state() const { … }
void JSFunction::set_tiering_state(IsolateForSandbox isolate,
TieringState state) { … }
bool JSFunction::osr_tiering_in_progress() { … }
void JSFunction::set_osr_tiering_in_progress(bool osr_in_progress) { … }
DEF_GETTER { …
bool JSFunction::has_closure_feedback_cell_array() const { … }
Tagged<Context> JSFunction::context() { … }
DEF_RELAXED_GETTER { …
bool JSFunction::has_context() const { … }
Tagged<JSGlobalProxy> JSFunction::global_proxy() { … }
Tagged<NativeContext> JSFunction::native_context() { … }
RELEASE_ACQUIRE_ACCESSORS_CHECKED
DEF_GETTER { …
DEF_GETTER { …
DEF_GETTER { …
DEF_GETTER { …
DEF_GETTER { …
DEF_GETTER { …
DEF_GETTER { …
DEF_GETTER { …
DEF_GETTER(JSFunction, prototype, Tagged<Object>) { … }
bool JSFunction::is_compiled(IsolateForSandbox isolate) const { … }
bool JSFunction::NeedsResetDueToFlushedBytecode(IsolateForSandbox isolate) { … }
bool JSFunction::NeedsResetDueToFlushedBaselineCode(IsolateForSandbox isolate) { … }
void JSFunction::ResetIfCodeFlushed(
Isolate* isolate,
std::optional<std::function<void(Tagged<HeapObject> object, ObjectSlot slot,
Tagged<HeapObject> target)>>
gc_notify_updated_slot) { … }
}
#include "src/objects/object-macros-undef.h"
#endif