V8 Project
v8::internal::RegExpStack Class Reference

#include <regexp-stack.h>

+ Collaboration diagram for v8::internal::RegExpStack:

Classes

struct  ThreadLocal
 

Public Member Functions

Address stack_base ()
 
size_t stack_capacity ()
 
Addresslimit_address ()
 
Address EnsureCapacity (size_t size)
 
char * ArchiveStack (char *to)
 
char * RestoreStack (char *from)
 
void FreeThreadResources ()
 

Static Public Member Functions

static int ArchiveSpacePerThread ()
 

Static Public Attributes

static const int kStackLimitSlack = 32
 

Private Member Functions

 RegExpStack ()
 
 ~RegExpStack ()
 
Address memory_address ()
 
Address memory_size_address ()
 
void Reset ()
 
 DISALLOW_COPY_AND_ASSIGN (RegExpStack)
 

Private Attributes

ThreadLocal thread_local_
 
Isolateisolate_
 

Static Private Attributes

static const uintptr_t kMemoryTop = static_cast<uintptr_t>(-1)
 
static const size_t kMinimumStackSize = 1 * KB
 
static const size_t kMaximumStackSize = 64 * MB
 

Friends

class ExternalReference
 
class Isolate
 
class RegExpStackScope
 

Detailed Description

Definition at line 35 of file regexp-stack.h.

Constructor & Destructor Documentation

◆ RegExpStack()

v8::internal::RegExpStack::RegExpStack ( )
private

Definition at line 25 of file regexp-stack.cc.

26  : isolate_(NULL) {
27 }
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

◆ ~RegExpStack()

v8::internal::RegExpStack::~RegExpStack ( )
private

Definition at line 30 of file regexp-stack.cc.

References v8::internal::RegExpStack::ThreadLocal::Free(), and thread_local_.

+ Here is the call graph for this function:

Member Function Documentation

◆ ArchiveSpacePerThread()

static int v8::internal::RegExpStack::ArchiveSpacePerThread ( )
inlinestatic

Definition at line 63 of file regexp-stack.h.

63  {
64  return static_cast<int>(sizeof(ThreadLocal));
65  }

Referenced by v8::internal::ArchiveSpacePerThread().

+ Here is the caller graph for this function:

◆ ArchiveStack()

char * v8::internal::RegExpStack::ArchiveStack ( char *  to)

Definition at line 35 of file regexp-stack.cc.

35  {
36  size_t size = sizeof(thread_local_);
37  MemCopy(reinterpret_cast<void*>(to), &thread_local_, size);
38  thread_local_ = ThreadLocal();
39  return to + size;
40 }
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 expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file
enable harmony numeric enable harmony object literal extensions Optimize object size
void MemCopy(void *dest, const void *src, size_t size)
Definition: utils.h:350

References v8::internal::MemCopy(), size, thread_local_, and to().

Referenced by v8::internal::ThreadManager::EagerlyArchiveThread().

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

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::RegExpStack::DISALLOW_COPY_AND_ASSIGN ( RegExpStack  )
private

◆ EnsureCapacity()

Address v8::internal::RegExpStack::EnsureCapacity ( size_t  size)

Definition at line 66 of file regexp-stack.cc.

66  {
67  if (size > kMaximumStackSize) return NULL;
70  Address new_memory = NewArray<byte>(static_cast<int>(size));
71  if (thread_local_.memory_size_ > 0) {
72  // Copy original memory into top of new memory.
73  MemCopy(reinterpret_cast<void*>(new_memory + size -
75  reinterpret_cast<void*>(thread_local_.memory_),
78  }
79  thread_local_.memory_ = new_memory;
82  }
84 }
static const int kStackLimitSlack
Definition: regexp-stack.h:40
static const size_t kMaximumStackSize
Definition: regexp-stack.h:81
static const size_t kMinimumStackSize
Definition: regexp-stack.h:78
void DeleteArray(T *array)
Definition: allocation.h:68
const int kPointerSize
Definition: globals.h:129
byte * Address
Definition: globals.h:101

References v8::internal::DeleteArray(), kMaximumStackSize, kMinimumStackSize, v8::internal::kPointerSize, kStackLimitSlack, v8::internal::RegExpStack::ThreadLocal::limit_, v8::internal::MemCopy(), v8::internal::RegExpStack::ThreadLocal::memory_, v8::internal::RegExpStack::ThreadLocal::memory_size_, NULL, size, and thread_local_.

Referenced by v8::internal::NativeRegExpMacroAssembler::GrowStack(), and v8::internal::RegExpStackScope::RegExpStackScope().

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

◆ FreeThreadResources()

void v8::internal::RegExpStack::FreeThreadResources ( )
inline

Definition at line 68 of file regexp-stack.h.

68 { thread_local_.Free(); }

References v8::internal::RegExpStack::ThreadLocal::Free(), and thread_local_.

Referenced by v8::internal::ThreadManager::FreeThreadResources().

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

◆ limit_address()

Address* v8::internal::RegExpStack::limit_address ( )
inline

Definition at line 56 of file regexp-stack.h.

56 { return &(thread_local_.limit_); }

References v8::internal::RegExpStack::ThreadLocal::limit_, and thread_local_.

◆ memory_address()

Address v8::internal::RegExpStack::memory_address ( )
inlineprivate

Definition at line 99 of file regexp-stack.h.

99  {
100  return reinterpret_cast<Address>(&thread_local_.memory_);
101  }

References v8::internal::RegExpStack::ThreadLocal::memory_, and thread_local_.

◆ memory_size_address()

Address v8::internal::RegExpStack::memory_size_address ( )
inlineprivate

Definition at line 104 of file regexp-stack.h.

104  {
105  return reinterpret_cast<Address>(&thread_local_.memory_size_);
106  }

References v8::internal::RegExpStack::ThreadLocal::memory_size_, and thread_local_.

◆ Reset()

void v8::internal::RegExpStack::Reset ( )
private

Definition at line 50 of file regexp-stack.cc.

50  {
53  thread_local_ = ThreadLocal();
54  }
55 }

References v8::internal::DeleteArray(), kMinimumStackSize, v8::internal::RegExpStack::ThreadLocal::memory_, v8::internal::RegExpStack::ThreadLocal::memory_size_, and thread_local_.

Referenced by v8::internal::RegExpStackScope::~RegExpStackScope().

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

◆ RestoreStack()

char * v8::internal::RegExpStack::RestoreStack ( char *  from)

Definition at line 43 of file regexp-stack.cc.

43  {
44  size_t size = sizeof(thread_local_);
45  MemCopy(&thread_local_, reinterpret_cast<void*>(from), size);
46  return from + size;
47 }

References v8::internal::MemCopy(), size, and thread_local_.

Referenced by v8::internal::ThreadManager::RestoreThread().

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

◆ stack_base()

Address v8::internal::RegExpStack::stack_base ( )
inline

Definition at line 43 of file regexp-stack.h.

43  {
46  }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, v8::internal::RegExpStack::ThreadLocal::memory_, v8::internal::RegExpStack::ThreadLocal::memory_size_, and thread_local_.

Referenced by v8::internal::NativeRegExpMacroAssembler::Execute(), and v8::internal::NativeRegExpMacroAssembler::GrowStack().

+ Here is the caller graph for this function:

◆ stack_capacity()

size_t v8::internal::RegExpStack::stack_capacity ( )
inline

Definition at line 49 of file regexp-stack.h.

49 { return thread_local_.memory_size_; }

References v8::internal::RegExpStack::ThreadLocal::memory_size_, and thread_local_.

Referenced by v8::internal::NativeRegExpMacroAssembler::GrowStack().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ ExternalReference

friend class ExternalReference
friend

Definition at line 116 of file regexp-stack.h.

◆ Isolate

friend class Isolate
friend

Definition at line 117 of file regexp-stack.h.

◆ RegExpStackScope

friend class RegExpStackScope
friend

Definition at line 118 of file regexp-stack.h.

Member Data Documentation

◆ isolate_

Isolate* v8::internal::RegExpStack::isolate_
private

Definition at line 114 of file regexp-stack.h.

Referenced by v8::internal::Isolate::Init().

◆ kMaximumStackSize

const size_t v8::internal::RegExpStack::kMaximumStackSize = 64 * MB
staticprivate

Definition at line 81 of file regexp-stack.h.

Referenced by EnsureCapacity().

◆ kMemoryTop

const uintptr_t v8::internal::RegExpStack::kMemoryTop = static_cast<uintptr_t>(-1)
staticprivate

Definition at line 75 of file regexp-stack.h.

Referenced by v8::internal::RegExpStack::ThreadLocal::Clear().

◆ kMinimumStackSize

const size_t v8::internal::RegExpStack::kMinimumStackSize = 1 * KB
staticprivate

Definition at line 78 of file regexp-stack.h.

Referenced by EnsureCapacity(), and Reset().

◆ kStackLimitSlack

const int v8::internal::RegExpStack::kStackLimitSlack = 32
static

Definition at line 40 of file regexp-stack.h.

Referenced by EnsureCapacity().

◆ thread_local_


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