#include "src/objects/call-site-info.h"
#include <optional>
#include "src/base/strings.h"
#include "src/objects/call-site-info-inl.h"
#include "src/objects/shared-function-info.h"
#include "src/strings/string-builder-inl.h"
#if V8_ENABLE_WEBASSEMBLY
#include "src/debug/debug-wasm-objects.h"
#endif
namespace v8::internal {
bool CallSiteInfo::IsPromiseAll() const { … }
bool CallSiteInfo::IsPromiseAllSettled() const { … }
bool CallSiteInfo::IsPromiseAny() const { … }
bool CallSiteInfo::IsNative() const { … }
bool CallSiteInfo::IsEval() const { … }
bool CallSiteInfo::IsUserJavaScript() const { … }
bool CallSiteInfo::IsMethodCall() const { … }
bool CallSiteInfo::IsToplevel() const { … }
int CallSiteInfo::GetLineNumber(DirectHandle<CallSiteInfo> info) { … }
int CallSiteInfo::GetColumnNumber(DirectHandle<CallSiteInfo> info) { … }
int CallSiteInfo::GetEnclosingLineNumber(DirectHandle<CallSiteInfo> info) { … }
int CallSiteInfo::GetEnclosingColumnNumber(DirectHandle<CallSiteInfo> info) { … }
int CallSiteInfo::GetScriptId() const { … }
Tagged<Object> CallSiteInfo::GetScriptName() const { … }
Tagged<Object> CallSiteInfo::GetScriptNameOrSourceURL() const { … }
Tagged<Object> CallSiteInfo::GetScriptSource() const { … }
Tagged<Object> CallSiteInfo::GetScriptSourceMappingURL() const { … }
Handle<String> CallSiteInfo::GetScriptHash(DirectHandle<CallSiteInfo> info) { … }
namespace {
MaybeHandle<String> FormatEvalOrigin(Isolate* isolate,
DirectHandle<Script> script) { … }
}
Handle<PrimitiveHeapObject> CallSiteInfo::GetEvalOrigin(
DirectHandle<CallSiteInfo> info) { … }
Handle<PrimitiveHeapObject> CallSiteInfo::GetFunctionName(
DirectHandle<CallSiteInfo> info) { … }
Handle<String> CallSiteInfo::GetFunctionDebugName(
DirectHandle<CallSiteInfo> info) { … }
namespace {
Tagged<PrimitiveHeapObject> InferMethodNameFromFastObject(
Isolate* isolate, Tagged<JSObject> receiver, Tagged<JSFunction> fun,
Tagged<PrimitiveHeapObject> name) { … }
template <typename Dictionary>
Tagged<PrimitiveHeapObject> InferMethodNameFromDictionary(
Isolate* isolate, Tagged<Dictionary> dictionary, Tagged<JSFunction> fun,
Tagged<PrimitiveHeapObject> name) { … }
Tagged<PrimitiveHeapObject> InferMethodName(Isolate* isolate,
Tagged<JSReceiver> receiver,
Tagged<JSFunction> fun) { … }
}
Handle<Object> CallSiteInfo::GetMethodName(DirectHandle<CallSiteInfo> info) { … }
Handle<Object> CallSiteInfo::GetTypeName(DirectHandle<CallSiteInfo> info) { … }
#if V8_ENABLE_WEBASSEMBLY
uint32_t CallSiteInfo::GetWasmFunctionIndex() const { … }
Tagged<WasmInstanceObject> CallSiteInfo::GetWasmInstance() const { … }
Handle<Object> CallSiteInfo::GetWasmModuleName(
DirectHandle<CallSiteInfo> info) { … }
#endif
int CallSiteInfo::GetSourcePosition(DirectHandle<CallSiteInfo> info) { … }
bool CallSiteInfo::ComputeLocation(DirectHandle<CallSiteInfo> info,
MessageLocation* location) { … }
int CallSiteInfo::ComputeSourcePosition(DirectHandle<CallSiteInfo> info,
int offset) { … }
std::optional<Tagged<Script>> CallSiteInfo::GetScript() const { … }
Tagged<SharedFunctionInfo> CallSiteInfo::GetSharedFunctionInfo() const { … }
MaybeHandle<Script> CallSiteInfo::GetScript(Isolate* isolate,
DirectHandle<CallSiteInfo> info) { … }
namespace {
bool IsNonEmptyString(DirectHandle<Object> object) { … }
void AppendFileLocation(Isolate* isolate, DirectHandle<CallSiteInfo> frame,
IncrementalStringBuilder* builder) { … }
bool StringEndsWithMethodName(Isolate* isolate, Handle<String> subject,
Handle<String> pattern) { … }
void AppendMethodCall(Isolate* isolate, DirectHandle<CallSiteInfo> frame,
IncrementalStringBuilder* builder) { … }
void SerializeJSStackFrame(Isolate* isolate, DirectHandle<CallSiteInfo> frame,
IncrementalStringBuilder* builder) { … }
#if V8_ENABLE_WEBASSEMBLY
void SerializeWasmStackFrame(Isolate* isolate, DirectHandle<CallSiteInfo> frame,
IncrementalStringBuilder* builder) { … }
void SerializeBuiltinStackFrame(Isolate* isolate,
DirectHandle<CallSiteInfo> frame,
IncrementalStringBuilder* builder) { … }
#endif
}
void SerializeCallSiteInfo(Isolate* isolate, DirectHandle<CallSiteInfo> frame,
IncrementalStringBuilder* builder) { … }
MaybeHandle<String> SerializeCallSiteInfo(Isolate* isolate,
DirectHandle<CallSiteInfo> frame) { … }
}