V8 Project
v8::internal::ScriptData Class Reference

#include <compiler.h>

+ Collaboration diagram for v8::internal::ScriptData:

Public Member Functions

 ScriptData (const byte *data, int length)
 
 ~ScriptData ()
 
const bytedata () const
 
int length () const
 
void AcquireDataOwnership ()
 
void ReleaseDataOwnership ()
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (ScriptData)
 

Private Attributes

bool owns_data_
 
const bytedata_
 
int length_
 

Detailed Description

Definition at line 33 of file compiler.h.

Constructor & Destructor Documentation

◆ ScriptData()

v8::internal::ScriptData::ScriptData ( const byte data,
int  length 
)

Definition at line 35 of file compiler.cc.

36  : owns_data_(false), data_(data), length_(length) {
37  if (!IsAligned(reinterpret_cast<intptr_t>(data), kPointerAlignment)) {
38  byte* copy = NewArray<byte>(length);
39  DCHECK(IsAligned(reinterpret_cast<intptr_t>(copy), kPointerAlignment));
40  CopyBytes(copy, data, length);
41  data_ = copy;
43  }
44 }
const byte * data_
Definition: compiler.h:55
const byte * data() const
Definition: compiler.h:40
int length() const
Definition: compiler.h:41
#define DCHECK(condition)
Definition: logging.h:205
bool IsAligned(T value, U alignment)
Definition: utils.h:123
const intptr_t kPointerAlignment
Definition: globals.h:230
void CopyBytes(uint8_t *target, uint8_t *source)

References AcquireDataOwnership(), v8::internal::CopyBytes(), data(), data_, DCHECK, v8::internal::IsAligned(), v8::internal::kPointerAlignment, and length().

+ Here is the call graph for this function:

◆ ~ScriptData()

v8::internal::ScriptData::~ScriptData ( )
inline

Definition at line 36 of file compiler.h.

36  {
38  }
void DeleteArray(T *array)
Definition: allocation.h:68

References data_, v8::internal::DeleteArray(), and owns_data_.

+ Here is the call graph for this function:

Member Function Documentation

◆ AcquireDataOwnership()

void v8::internal::ScriptData::AcquireDataOwnership ( )
inline

Definition at line 43 of file compiler.h.

43  {
45  owns_data_ = true;
46  }

References DCHECK, and owns_data_.

Referenced by v8::internal::CompleteParserRecorder::GetScriptData(), ScriptData(), and v8::internal::SerializedCodeData::SerializedCodeData().

+ Here is the caller graph for this function:

◆ data()

const byte* v8::internal::ScriptData::data ( ) const
inline

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::ScriptData::DISALLOW_COPY_AND_ASSIGN ( ScriptData  )
private

◆ length()

int v8::internal::ScriptData::length ( ) const
inline

Definition at line 41 of file compiler.h.

41 { return length_; }

References length_.

Referenced by v8::ScriptCompiler::CompileUnbound(), v8::internal::CodeSerializer::Deserialize(), v8::internal::ParseData::Length(), v8::internal::ParseData::ParseData(), v8::internal::SerializedCodeData::PayloadLength(), v8::internal::BackgroundParsingTask::Run(), ScriptData(), and v8::internal::CodeSerializer::Serialize().

+ Here is the caller graph for this function:

◆ ReleaseDataOwnership()

void v8::internal::ScriptData::ReleaseDataOwnership ( )
inline

Definition at line 48 of file compiler.h.

48  {
50  owns_data_ = false;
51  }

References DCHECK, and owns_data_.

Referenced by v8::ScriptCompiler::CompileUnbound(), and v8::internal::BackgroundParsingTask::Run().

+ Here is the caller graph for this function:

Member Data Documentation

◆ data_

const byte* v8::internal::ScriptData::data_
private

Definition at line 55 of file compiler.h.

Referenced by data(), ScriptData(), and ~ScriptData().

◆ length_

int v8::internal::ScriptData::length_
private

Definition at line 56 of file compiler.h.

Referenced by length().

◆ owns_data_

bool v8::internal::ScriptData::owns_data_
private

Definition at line 54 of file compiler.h.

Referenced by AcquireDataOwnership(), ReleaseDataOwnership(), and ~ScriptData().


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