v8 12.4.254 (node 22.4.1)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
String::ExternalStringResourceBase Class Reference

#include <v8-primitive.h>

Inheritance diagram for String::ExternalStringResourceBase:

Public Member Functions

virtual ~ExternalStringResourceBase ()=default
 
virtual bool IsCacheable () const
 
 ExternalStringResourceBase (const ExternalStringResourceBase &)=delete
 
void operator= (const ExternalStringResourceBase &)=delete
 

Protected Member Functions

 ExternalStringResourceBase ()=default
 
virtual void Dispose ()
 
virtual void Lock () const
 
virtual void Unlock () const
 

Friends

class internal::ExternalString
 
class v8::String
 
class internal::StringForwardingTable
 
class internal::ScopedExternalStringLock
 

Detailed Description

Definition at line 226 of file v8-primitive.h.

Constructor & Destructor Documentation

◆ ~ExternalStringResourceBase()

virtual ~ExternalStringResourceBase ( )
virtualdefault

◆ ExternalStringResourceBase() [1/2]

◆ ExternalStringResourceBase() [2/2]

ExternalStringResourceBase ( )
protecteddefault

Member Function Documentation

◆ Dispose()

virtual void Dispose ( )
inlineprotectedvirtual

Internally V8 will call this Dispose method when the external string resource is no longer needed. The default implementation will use the delete operator. This method can be overridden in subclasses to control how allocated external string resources are disposed.

Definition at line 250 of file v8-primitive.h.

◆ IsCacheable()

virtual bool IsCacheable ( ) const
inlinevirtual

If a string is cacheable, the value returned by ExternalStringResource::data() may be cached, otherwise it is not expected to be stable beyond the current top-level task.

Definition at line 235 of file v8-primitive.h.

◆ Lock()

virtual void Lock ( ) const
inlineprotectedvirtual

For a non-cacheable string, the value returned by |ExternalStringResource::data()| has to be stable between |Lock()| and |Unlock()|, that is the string must behave as is |IsCacheable()| returned true.

These two functions must be thread-safe, and can be called from anywhere. They also must handle lock depth, in the sense that each can be called several times, from different threads, and unlocking should only happen when the balance of Lock() and Unlock() calls is 0.

Definition at line 263 of file v8-primitive.h.

◆ operator=()

void operator= ( const ExternalStringResourceBase )
delete

◆ Unlock()

virtual void Unlock ( ) const
inlineprotectedvirtual

Unlocks the string.

Definition at line 268 of file v8-primitive.h.

Friends And Related Symbol Documentation

◆ internal::ExternalString

friend class internal::ExternalString
friend

Definition at line 271 of file v8-primitive.h.

◆ internal::ScopedExternalStringLock

friend class internal::ScopedExternalStringLock
friend

Definition at line 274 of file v8-primitive.h.

◆ internal::StringForwardingTable

friend class internal::StringForwardingTable
friend

Definition at line 273 of file v8-primitive.h.

◆ v8::String

friend class v8::String
friend

Definition at line 272 of file v8-primitive.h.


The documentation for this class was generated from the following file: