#include "src/objects/js-function.h"
#include <optional>
#include "src/baseline/baseline-batch-compiler.h"
#include "src/codegen/compiler.h"
#include "src/common/globals.h"
#include "src/diagnostics/code-tracer.h"
#include "src/execution/frames-inl.h"
#include "src/execution/isolate.h"
#include "src/execution/tiering-manager.h"
#include "src/heap/heap-inl.h"
#include "src/ic/ic.h"
#include "src/init/bootstrapper.h"
#include "src/objects/feedback-cell-inl.h"
#include "src/strings/string-builder-inl.h"
#include "src/objects/object-macros.h"
namespace v8::internal {
CodeKinds JSFunction::GetAttachedCodeKinds(IsolateForSandbox isolate) const { … }
CodeKinds JSFunction::GetAvailableCodeKinds(IsolateForSandbox isolate) const { … }
bool JSFunction::HasAttachedOptimizedCode(IsolateForSandbox isolate) const { … }
bool JSFunction::HasAvailableHigherTierCodeThan(IsolateForSandbox isolate,
CodeKind kind) const { … }
bool JSFunction::HasAvailableHigherTierCodeThanWithFilter(
IsolateForSandbox isolate, CodeKind kind, CodeKinds filter_mask) const { … }
bool JSFunction::HasAvailableOptimizedCode(IsolateForSandbox isolate) const { … }
bool JSFunction::HasAttachedCodeKind(IsolateForSandbox isolate,
CodeKind kind) const { … }
bool JSFunction::HasAvailableCodeKind(IsolateForSandbox isolate,
CodeKind kind) const { … }
namespace {
V8_WARN_UNUSED_RESULT bool HighestTierOf(CodeKinds kinds,
CodeKind* highest_tier) { … }
}
std::optional<CodeKind> JSFunction::GetActiveTier(
IsolateForSandbox isolate) const { … }
bool JSFunction::ActiveTierIsIgnition(IsolateForSandbox isolate) const { … }
bool JSFunction::ActiveTierIsBaseline(IsolateForSandbox isolate) const { … }
bool JSFunction::ActiveTierIsMaglev(IsolateForSandbox isolate) const { … }
bool JSFunction::ActiveTierIsTurbofan(IsolateForSandbox isolate) const { … }
bool JSFunction::CanDiscardCompiled(IsolateForSandbox isolate) const { … }
namespace {
constexpr TieringState TieringStateFor(CodeKind target_kind,
ConcurrencyMode mode) { … }
}
void JSFunction::MarkForOptimization(Isolate* isolate, CodeKind target_kind,
ConcurrencyMode mode) { … }
void JSFunction::SetInterruptBudget(
Isolate* isolate, std::optional<CodeKind> override_active_tier) { … }
Maybe<bool> JSFunctionOrBoundFunctionOrWrappedFunction::CopyNameAndLength(
Isolate* isolate,
Handle<JSFunctionOrBoundFunctionOrWrappedFunction> function,
Handle<JSReceiver> target, Handle<String> prefix, int arg_count) { … }
MaybeHandle<String> JSBoundFunction::GetName(
Isolate* isolate, DirectHandle<JSBoundFunction> function) { … }
Maybe<int> JSBoundFunction::GetLength(Isolate* isolate,
DirectHandle<JSBoundFunction> function) { … }
Handle<String> JSBoundFunction::ToString(
DirectHandle<JSBoundFunction> function) { … }
MaybeHandle<String> JSWrappedFunction::GetName(
Isolate* isolate, DirectHandle<JSWrappedFunction> function) { … }
Maybe<int> JSWrappedFunction::GetLength(
Isolate* isolate, DirectHandle<JSWrappedFunction> function) { … }
Handle<String> JSWrappedFunction::ToString(
DirectHandle<JSWrappedFunction> function) { … }
MaybeHandle<Object> JSWrappedFunction::Create(
Isolate* isolate, DirectHandle<NativeContext> creation_context,
Handle<JSReceiver> value) { … }
Handle<String> JSFunction::GetName(Isolate* isolate,
DirectHandle<JSFunction> function) { … }
void JSFunction::EnsureClosureFeedbackCellArray(
DirectHandle<JSFunction> function,
bool reset_budget_for_feedback_allocation) { … }
void JSFunction::EnsureFeedbackVector(Isolate* isolate,
DirectHandle<JSFunction> function,
IsCompiledScope* compiled_scope) { … }
void JSFunction::CreateAndAttachFeedbackVector(
Isolate* isolate, DirectHandle<JSFunction> function,
IsCompiledScope* compiled_scope) { … }
void JSFunction::InitializeFeedbackCell(
DirectHandle<JSFunction> function, IsCompiledScope* is_compiled_scope,
bool reset_budget_for_feedback_allocation) { … }
namespace {
void SetInstancePrototype(Isolate* isolate, DirectHandle<JSFunction> function,
Handle<JSReceiver> value) { … }
}
void JSFunction::SetPrototype(DirectHandle<JSFunction> function,
Handle<Object> value) { … }
void JSFunction::SetInitialMap(Isolate* isolate,
DirectHandle<JSFunction> function,
Handle<Map> map, Handle<HeapObject> prototype) { … }
void JSFunction::SetInitialMap(Isolate* isolate,
DirectHandle<JSFunction> function,
Handle<Map> map, Handle<HeapObject> prototype,
DirectHandle<JSFunction> constructor) { … }
void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { … }
namespace {
#ifdef DEBUG
bool CanSubclassHaveInobjectProperties(InstanceType instance_type) { … }
#endif
bool FastInitializeDerivedMap(Isolate* isolate, Handle<JSFunction> new_target,
DirectHandle<JSFunction> constructor,
Handle<Map> constructor_initial_map) { … }
}
MaybeHandle<Map> JSFunction::GetDerivedMap(Isolate* isolate,
Handle<JSFunction> constructor,
Handle<JSReceiver> new_target) { … }
namespace …
MaybeHandle<Map> JSFunction::GetDerivedRabGsabTypedArrayMap(
Isolate* isolate, Handle<JSFunction> constructor,
Handle<JSReceiver> new_target) { … }
MaybeHandle<Map> JSFunction::GetDerivedRabGsabDataViewMap(
Isolate* isolate, Handle<JSReceiver> new_target) { … }
int JSFunction::ComputeInstanceSizeWithMinSlack(Isolate* isolate) { … }
std::unique_ptr<char[]> JSFunction::DebugNameCStr() { … }
void JSFunction::PrintName(FILE* out) { … }
namespace {
bool UseFastFunctionNameLookup(Isolate* isolate, Tagged<Map> map) { … }
}
Handle<String> JSFunction::GetDebugName(Handle<JSFunction> function) { … }
bool JSFunction::SetName(Handle<JSFunction> function, Handle<Name> name,
DirectHandle<String> prefix) { … }
namespace {
Handle<String> NativeCodeFunctionSourceString(
Isolate* isolate, DirectHandle<SharedFunctionInfo> shared_info) { … }
}
Handle<String> JSFunction::ToString(DirectHandle<JSFunction> function) { … }
int JSFunction::CalculateExpectedNofProperties(Isolate* isolate,
Handle<JSFunction> function) { … }
void JSFunction::CalculateInstanceSizeHelper(InstanceType instance_type,
bool has_prototype_slot,
int requested_embedder_fields,
int requested_in_object_properties,
int* instance_size,
int* in_object_properties) { … }
void JSFunction::ClearAllTypeFeedbackInfoForTesting() { … }
}
#include "src/objects/object-macros-undef.h"