V8 Project
v8::PerIsolateData Class Reference
+ Collaboration diagram for v8::PerIsolateData:

Classes

class  RealmScope
 

Public Member Functions

 PerIsolateData (Isolate *isolate)
 
 ~PerIsolateData ()
 

Static Public Member Functions

static PerIsolateDataGet (Isolate *isolate)
 

Private Member Functions

int RealmIndexOrThrow (const v8::FunctionCallbackInfo< v8::Value > &args, int arg_offset)
 
int RealmFind (Handle< Context > context)
 

Private Attributes

Isolateisolate_
 
int realm_count_
 
int realm_current_
 
int realm_switch_
 
Persistent< Context > * realms_
 
Persistent< Valuerealm_shared_
 

Friends

class Shell
 
class RealmScope
 

Detailed Description

Definition at line 78 of file d8.cc.

Constructor & Destructor Documentation

◆ PerIsolateData()

v8::PerIsolateData::PerIsolateData ( Isolate isolate)
inlineexplicit

Definition at line 80 of file d8.cc.

80  : isolate_(isolate), realms_(NULL) {
81  HandleScope scope(isolate);
82  isolate->SetData(0, this);
83  }
Isolate * isolate_
Definition: d8.cc:104
Persistent< Context > * realms_
Definition: d8.cc:108
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL

References v8::Isolate::SetData().

+ Here is the call graph for this function:

◆ ~PerIsolateData()

v8::PerIsolateData::~PerIsolateData ( )
inline

Definition at line 85 of file d8.cc.

85  {
86  isolate_->SetData(0, NULL); // Not really needed, just to be sure...
87  }
void SetData(uint32_t slot, void *data)
Associate embedder-specific data with the isolate.
Definition: v8.h:6872

References isolate_, NULL, and v8::Isolate::SetData().

+ Here is the call graph for this function:

Member Function Documentation

◆ Get()

static PerIsolateData* v8::PerIsolateData::Get ( Isolate isolate)
inlinestatic

Definition at line 89 of file d8.cc.

89  {
90  return reinterpret_cast<PerIsolateData*>(isolate->GetData(0));
91  }
PerIsolateData(Isolate *isolate)
Definition: d8.cc:80

References v8::Isolate::GetData().

Referenced by v8::SourceGroup::ExecuteInThread(), v8::Shell::ExecuteString(), v8::Shell::RealmCreate(), v8::Shell::RealmCurrent(), v8::Shell::RealmDispose(), v8::Shell::RealmEval(), v8::Shell::RealmGlobal(), v8::Shell::RealmOwner(), v8::Shell::RealmSharedGet(), v8::Shell::RealmSharedSet(), v8::Shell::RealmSwitch(), v8::Shell::RunMain(), and v8::Shell::RunShell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RealmFind()

int v8::PerIsolateData::RealmFind ( Handle< Context context)
private

Definition at line 307 of file d8.cc.

307  {
308  for (int i = 0; i < realm_count_; ++i) {
309  if (realms_[i] == context) return i;
310  }
311  return -1;
312 }
int realm_count_
Definition: d8.cc:105

References realm_count_, and realms_.

Referenced by v8::Shell::RealmCurrent(), and v8::Shell::RealmOwner().

+ Here is the caller graph for this function:

◆ RealmIndexOrThrow()

int v8::PerIsolateData::RealmIndexOrThrow ( const v8::FunctionCallbackInfo< v8::Value > &  args,
int  arg_offset 
)
private

Definition at line 315 of file d8.cc.

317  {
318  if (args.Length() < arg_offset || !args[arg_offset]->IsNumber()) {
319  Throw(args.GetIsolate(), "Invalid argument");
320  return -1;
321  }
322  int index = args[arg_offset]->Int32Value();
323  if (index < 0 ||
324  index >= realm_count_ ||
325  realms_[index].IsEmpty()) {
326  Throw(args.GetIsolate(), "Invalid realm index");
327  return -1;
328  }
329  return index;
330 }
Isolate * GetIsolate() const
Definition: v8.h:6342
int Length() const
Definition: v8.h:6360
static Handle< Value > Throw(Isolate *isolate, const char *message)
Definition: d8.cc:72

References v8::FunctionCallbackInfo< T >::GetIsolate(), v8::FunctionCallbackInfo< T >::Length(), realm_count_, realms_, and v8::Throw().

Referenced by v8::Shell::RealmDispose(), v8::Shell::RealmEval(), v8::Shell::RealmGlobal(), and v8::Shell::RealmSwitch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ RealmScope

friend class RealmScope
friend

Definition at line 103 of file d8.cc.

◆ Shell

friend class Shell
friend

Definition at line 102 of file d8.cc.

Member Data Documentation

◆ isolate_

Isolate* v8::PerIsolateData::isolate_
private

Definition at line 104 of file d8.cc.

Referenced by v8::PerIsolateData::RealmScope::RealmScope(), and ~PerIsolateData().

◆ realm_count_

int v8::PerIsolateData::realm_count_
private

◆ realm_current_

int v8::PerIsolateData::realm_current_
private

◆ realm_shared_

Persistent<Value> v8::PerIsolateData::realm_shared_
private

Definition at line 109 of file d8.cc.

Referenced by v8::Shell::RealmSharedGet(), and v8::Shell::RealmSharedSet().

◆ realm_switch_

int v8::PerIsolateData::realm_switch_
private

◆ realms_


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