V8 Project
v8::internal::HydrogenCodeStub Class Referenceabstract

#include <code-stubs.h>

+ Inheritance diagram for v8::internal::HydrogenCodeStub:
+ Collaboration diagram for v8::internal::HydrogenCodeStub:

Classes

class  IsMissBits
 
class  SubMinorKeyBits
 

Public Types

enum  InitializationState { UNINITIALIZED , INITIALIZED }
 

Public Member Functions

virtual Code::Kind GetCodeKind () const
 
virtual Handle< CodeGenerateCode ()=0
 
bool IsUninitialized () const
 
Handle< CodeGenerateLightweightMissCode (ExternalReference miss)
 
template<class StateType >
void TraceTransition (StateType from, StateType to)
 

Static Public Member Functions

template<class SubClass >
static Handle< CodeGetUninitialized (Isolate *isolate)
 

Protected Member Functions

 HydrogenCodeStub (Isolate *isolate, InitializationState state=INITIALIZED)
 
void set_sub_minor_key (uint32_t key)
 
uint32_t sub_minor_key () const
 

Static Protected Attributes

static const int kSubMinorKeyBits = kStubMinorKeyBits - 1
 

Private Member Functions

void GenerateLightweightMiss (MacroAssembler *masm, ExternalReference miss)
 
 DEFINE_CODE_STUB_BASE (HydrogenCodeStub, CodeStub)
 

Detailed Description

Definition at line 431 of file code-stubs.h.

Member Enumeration Documentation

◆ InitializationState

Enumerator
UNINITIALIZED 
INITIALIZED 

Definition at line 433 of file code-stubs.h.

Constructor & Destructor Documentation

◆ HydrogenCodeStub()

v8::internal::HydrogenCodeStub::HydrogenCodeStub ( Isolate isolate,
InitializationState  state = INITIALIZED 
)
inlineexplicitprotected

Definition at line 457 of file code-stubs.h.

459  : CodeStub(isolate) {
460  minor_key_ = IsMissBits::encode(state == UNINITIALIZED);
461  }
static U encode(T value)
Definition: utils.h:217

References v8::internal::BitFieldBase< T, shift, size, U >::encode(), and UNINITIALIZED.

+ Here is the call graph for this function:

Member Function Documentation

◆ DEFINE_CODE_STUB_BASE()

v8::internal::HydrogenCodeStub::DEFINE_CODE_STUB_BASE ( HydrogenCodeStub  ,
CodeStub   
)
private

◆ GenerateCode()

virtual Handle<Code> v8::internal::HydrogenCodeStub::GenerateCode ( )
pure virtual

◆ GenerateLightweightMiss()

void v8::internal::HydrogenCodeStub::GenerateLightweightMiss ( MacroAssembler masm,
ExternalReference  miss 
)
private

Referenced by GenerateLightweightMissCode().

+ Here is the caller graph for this function:

◆ GenerateLightweightMissCode()

Handle< Code > v8::internal::HydrogenCodeStub::GenerateLightweightMissCode ( ExternalReference  miss)

Definition at line 222 of file code-stubs-hydrogen.cc.

223  {
224  Factory* factory = isolate()->factory();
225 
226  // Generate the new code.
227  MacroAssembler masm(isolate(), NULL, 256);
228 
229  {
230  // Update the static counter each time a new code stub is generated.
231  isolate()->counters()->code_stubs()->Increment();
232 
233  // Generate the code for the stub.
234  masm.set_generating_stub(true);
235  NoCurrentFrameScope scope(&masm);
236  GenerateLightweightMiss(&masm, miss);
237  }
238 
239  // Create the code object.
240  CodeDesc desc;
241  masm.GetCode(&desc);
242 
243  // Copy the generated code into a heap object.
245  GetCodeKind(),
246  GetICState(),
247  GetExtraICState(),
248  GetStubType());
249  Handle<Code> new_object = factory->NewCode(
250  desc, flags, masm.CodeObject(), NeedsImmovableCode());
251  return new_object;
252 }
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, CacheHolderFlag holder=kCacheOnReceiver)
Definition: objects-inl.h:4954
uint32_t Flags
Definition: objects.h:4929
virtual Code::Kind GetCodeKind() const
Definition: code-stubs.h:438
void GenerateLightweightMiss(MacroAssembler *masm, ExternalReference miss)
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::internal::MacroAssembler::CodeObject(), v8::internal::Code::ComputeFlags(), v8::internal::anonymous_namespace{flags.cc}::flags, GenerateLightweightMiss(), v8::internal::Assembler::GetCode(), GetCodeKind(), NULL, and v8::internal::MacroAssembler::set_generating_stub().

+ Here is the call graph for this function:

◆ GetCodeKind()

virtual Code::Kind v8::internal::HydrogenCodeStub::GetCodeKind ( ) const
inlinevirtual

◆ GetUninitialized()

template<class SubClass >
static Handle<Code> v8::internal::HydrogenCodeStub::GetUninitialized ( Isolate isolate)
inlinestatic

Definition at line 441 of file code-stubs.h.

441  {
442  SubClass::GenerateAheadOfTime(isolate);
443  return SubClass().GetCode(isolate);
444  }

◆ IsUninitialized()

bool v8::internal::HydrogenCodeStub::IsUninitialized ( ) const
inline

Definition at line 449 of file code-stubs.h.

449 { return IsMissBits::decode(minor_key_); }
static T decode(U value)
Definition: utils.h:228

References v8::internal::BitFieldBase< T, shift, size, U >::decode().

+ Here is the call graph for this function:

◆ set_sub_minor_key()

void v8::internal::HydrogenCodeStub::set_sub_minor_key ( uint32_t  key)
inlineprotected

Definition at line 463 of file code-stubs.h.

463  {
464  minor_key_ = SubMinorKeyBits::update(minor_key_, key);
465  }
static U update(U previous, T value)
Definition: utils.h:223

References v8::internal::BitFieldBase< T, shift, size, U >::update().

Referenced by v8::internal::ArrayConstructorStubBase::ArrayConstructorStubBase(), v8::internal::BinaryOpICStub::BinaryOpICStub(), v8::internal::CompareNilICStub::ClearState(), v8::internal::CompareNilICStub::CompareNilICStub(), v8::internal::ElementsTransitionAndStoreStub::ElementsTransitionAndStoreStub(), v8::internal::FastCloneShallowArrayStub::FastCloneShallowArrayStub(), v8::internal::FastCloneShallowObjectStub::FastCloneShallowObjectStub(), v8::internal::FastNewClosureStub::FastNewClosureStub(), v8::internal::InternalArrayConstructorStubBase::InternalArrayConstructorStubBase(), v8::internal::LoadConstantStub::LoadConstantStub(), v8::internal::LoadFastElementStub::LoadFastElementStub(), v8::internal::LoadFieldStub::LoadFieldStub(), v8::internal::MegamorphicLoadStub::MegamorphicLoadStub(), v8::internal::StoreGlobalStub::set_is_constant(), v8::internal::StoreGlobalStub::set_representation(), v8::internal::StoreFastElementStub::StoreFastElementStub(), v8::internal::StoreFieldStub::StoreFieldStub(), v8::internal::StoreGlobalStub::StoreGlobalStub(), v8::internal::ToBooleanStub::ToBooleanStub(), v8::internal::TransitionElementsKindStub::TransitionElementsKindStub(), v8::internal::CompareNilICStub::UpdateStatus(), v8::internal::ToBooleanStub::UpdateStatus(), and v8::internal::VectorLoadStub::VectorLoadStub().

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

◆ sub_minor_key()

uint32_t v8::internal::HydrogenCodeStub::sub_minor_key ( ) const
inlineprotected

Definition at line 467 of file code-stubs.h.

467 { return SubMinorKeyBits::decode(minor_key_); }

References v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by v8::internal::FastCloneShallowArrayStub::allocation_site_mode(), v8::internal::StoreGlobalStub::check_global(), v8::internal::CompareNilICStub::ClearState(), v8::internal::LoadConstantStub::constant_index(), v8::internal::LoadFastElementStub::elements_kind(), v8::internal::StoreFastElementStub::elements_kind(), v8::internal::ArrayConstructorStubBase::elements_kind(), v8::internal::InternalArrayConstructorStubBase::elements_kind(), v8::internal::TransitionElementsKindStub::from_kind(), v8::internal::ElementsTransitionAndStoreStub::from_kind(), v8::internal::CompareNilICStub::GetExtraICState(), v8::internal::BinaryOpICStub::GetExtraICState(), v8::internal::MegamorphicLoadStub::GetExtraICState(), v8::internal::VectorLoadStub::GetExtraICState(), v8::internal::LoadFieldStub::index(), v8::internal::StoreFieldStub::index(), v8::internal::StoreGlobalStub::is_constant(), v8::internal::LoadFastElementStub::is_js_array(), v8::internal::StoreFastElementStub::is_js_array(), v8::internal::TransitionElementsKindStub::is_js_array(), v8::internal::ElementsTransitionAndStoreStub::is_jsarray(), v8::internal::FastNewClosureStub::kind(), v8::internal::FastCloneShallowObjectStub::length(), v8::internal::ToBooleanStub::mode(), v8::internal::CompareNilICStub::nil_value(), v8::internal::ArrayConstructorStubBase::override_mode(), v8::internal::StoreFieldStub::representation(), v8::internal::StoreGlobalStub::representation(), v8::internal::StoreGlobalStub::set_is_constant(), v8::internal::StoreGlobalStub::set_representation(), v8::internal::CompareNilICStub::state(), v8::internal::StoreFastElementStub::store_mode(), v8::internal::ElementsTransitionAndStoreStub::store_mode(), v8::internal::FastNewClosureStub::strict_mode(), v8::internal::TransitionElementsKindStub::to_kind(), v8::internal::ElementsTransitionAndStoreStub::to_kind(), v8::internal::ToBooleanStub::types(), v8::internal::CompareNilICStub::UpdateStatus(), and v8::internal::ToBooleanStub::UpdateStatus().

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

◆ TraceTransition()

template<class StateType >
void v8::internal::HydrogenCodeStub::TraceTransition ( StateType  from,
StateType  to 
)

Definition at line 458 of file code-stubs.cc.

458  {
459  // Note: Although a no-op transition is semantically OK, it is hinting at a
460  // bug somewhere in our state transition machinery.
461  DCHECK(from != to);
462  if (!FLAG_trace_ic) return;
463  OFStream os(stdout);
464  os << "[";
465  PrintBaseName(os);
466  os << ": " << from << "=>" << to << "]" << endl;
467 }
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
#define DCHECK(condition)
Definition: logging.h:205
OStream & endl(OStream &os)
Definition: ostreams.cc:112

References DCHECK, v8::internal::endl(), and to().

Referenced by v8::internal::CompareNilICStub::UpdateStatus(), and v8::internal::ToBooleanStub::UpdateStatus().

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

Member Data Documentation

◆ kSubMinorKeyBits

const int v8::internal::HydrogenCodeStub::kSubMinorKeyBits = kStubMinorKeyBits - 1
staticprotected

Definition at line 469 of file code-stubs.h.


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