// Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_OBJECTS_CALL_SITE_INFO_H_ #define V8_OBJECTS_CALL_SITE_INFO_H_ #include "src/objects/struct.h" #include "torque-generated/bit-fields.h" // Has to be the last include (doesn't have include guards): #include "src/objects/object-macros.h" namespace v8 { namespace internal { class MessageLocation; class WasmInstanceObject; class StructBodyDescriptor; #include "torque-generated/src/objects/call-site-info-tq.inc" class CallSiteInfo : public TorqueGeneratedCallSiteInfo { public: NEVER_READ_ONLY_SPACE DEFINE_TORQUE_GENERATED_CALL_SITE_INFO_FLAGS() #if V8_ENABLE_WEBASSEMBLY inline bool IsWasm() const; inline bool IsAsmJsWasm() const; inline bool IsAsmJsAtNumberConversion() const; #endif // V8_ENABLE_WEBASSEMBLY inline bool IsStrict() const; inline bool IsConstructor() const; inline bool IsAsync() const; bool IsEval() const; bool IsUserJavaScript() const; bool IsSubjectToDebugging() const; bool IsMethodCall() const; bool IsToplevel() const; bool IsPromiseAll() const; bool IsPromiseAllSettled() const; bool IsPromiseAny() const; bool IsNative() const; DECL_ACCESSORS(code_object, HeapObject) // Dispatched behavior. DECL_VERIFIER(CallSiteInfo) // Used to signal that the requested field is unknown. static constexpr int kUnknown = kNoSourcePosition; V8_EXPORT_PRIVATE static int GetLineNumber(Handle info); V8_EXPORT_PRIVATE static int GetColumnNumber(Handle info); static int GetEnclosingLineNumber(Handle info); static int GetEnclosingColumnNumber(Handle info); // Returns the script ID if one is attached, // Message::kNoScriptIdInfo otherwise. static MaybeHandle