V8 Project
v8::internal::PlatformCodeStub Class Referenceabstract

#include <code-stubs.h>

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

Public Member Functions

virtual Handle< CodeGenerateCode () OVERRIDE
 
virtual Code::Kind GetCodeKind () const
 

Protected Member Functions

 PlatformCodeStub (Isolate *isolate)
 
virtual void Generate (MacroAssembler *masm)=0
 
 DEFINE_CODE_STUB_BASE (PlatformCodeStub, CodeStub)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ PlatformCodeStub()

v8::internal::PlatformCodeStub::PlatformCodeStub ( Isolate isolate)
inlineexplicitprotected

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

341 : CodeStub(isolate) {}

Member Function Documentation

◆ DEFINE_CODE_STUB_BASE()

v8::internal::PlatformCodeStub::DEFINE_CODE_STUB_BASE ( PlatformCodeStub  ,
CodeStub   
)
protected

◆ Generate()

virtual void v8::internal::PlatformCodeStub::Generate ( MacroAssembler masm)
protectedpure virtual

Implemented in v8::internal::RecordWriteStub, v8::internal::RecordWriteStub, v8::internal::RecordWriteStub, v8::internal::RecordWriteStub, v8::internal::RecordWriteStub, v8::internal::RecordWriteStub, v8::internal::RecordWriteStub, and v8::internal::WriteInt32ToHeapNumberStub.

Referenced by GenerateCode().

+ Here is the caller graph for this function:

◆ GenerateCode()

Handle< Code > v8::internal::PlatformCodeStub::GenerateCode ( )
virtual

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

100  {
101  Factory* factory = isolate()->factory();
102 
103  // Generate the new code.
104  MacroAssembler masm(isolate(), NULL, 256);
105 
106  // TODO(yangguo) remove this once the code serializer handles code stubs.
107  if (FLAG_serialize_toplevel) masm.enable_serializer();
108 
109  {
110  // Update the static counter each time a new code stub is generated.
111  isolate()->counters()->code_stubs()->Increment();
112 
113  // Generate the code for the stub.
114  masm.set_generating_stub(true);
115  NoCurrentFrameScope scope(&masm);
116  Generate(&masm);
117  }
118 
119  // Create the code object.
120  CodeDesc desc;
121  masm.GetCode(&desc);
122 
123  // Copy the generated code into a heap object.
125  GetCodeKind(),
126  GetICState(),
127  GetExtraICState(),
128  GetStubType());
129  Handle<Code> new_object = factory->NewCode(
130  desc, flags, masm.CodeObject(), NeedsImmovableCode());
131  return new_object;
132 }
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:338
virtual void Generate(MacroAssembler *masm)=0
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::AssemblerBase::enable_serializer(), v8::internal::anonymous_namespace{flags.cc}::flags, Generate(), 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::PlatformCodeStub::GetCodeKind ( ) const
inlinevirtual

Reimplemented in v8::internal::KeyedLoadICTrampolineStub, v8::internal::LoadICTrampolineStub, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::CallICStub, v8::internal::FINAL< kOperandKind, kNumCachedOperands >, v8::internal::CompareICStub, v8::internal::LoadIndexedInterceptorStub, and v8::internal::FunctionPrototypeStub.

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

338 { return Code::STUB; }

References v8::internal::STUB.

Referenced by GenerateCode().

+ Here is the caller graph for this function:

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