V8 Project
v8::internal::FunctionInfoListener Class Reference
+ Collaboration diagram for v8::internal::FunctionInfoListener:

Public Member Functions

 FunctionInfoListener (Isolate *isolate)
 
void FunctionStarted (FunctionLiteral *fun)
 
void FunctionDone ()
 
void FunctionCode (Handle< Code > function_code)
 
void FunctionInfo (Handle< SharedFunctionInfo > shared, Scope *scope, Zone *zone)
 
Handle< JSArrayGetResult ()
 

Private Member Functions

Isolateisolate () const
 
Handle< ObjectSerializeFunctionScope (Scope *scope, Zone *zone)
 

Private Attributes

Handle< JSArrayresult_
 
int len_
 
int current_parent_index_
 

Detailed Description

Definition at line 698 of file liveedit.cc.

Constructor & Destructor Documentation

◆ FunctionInfoListener()

v8::internal::FunctionInfoListener::FunctionInfoListener ( Isolate isolate)
inlineexplicit

Definition at line 700 of file liveedit.cc.

700  {
702  len_ = 0;
703  result_ = isolate->factory()->NewJSArray(10);
704  }
Factory * factory()
Definition: isolate.h:982

References current_parent_index_, v8::internal::Isolate::factory(), isolate(), len_, and result_.

+ Here is the call graph for this function:

Member Function Documentation

◆ FunctionCode()

void v8::internal::FunctionInfoListener::FunctionCode ( Handle< Code function_code)
inline

Definition at line 730 of file liveedit.cc.

730  {
731  FunctionInfoWrapper info =
734  isolate(), result_, current_parent_index_).ToHandleChecked());
735  info.SetFunctionCode(function_code,
736  Handle<HeapObject>(isolate()->heap()->null_value()));
737  }
static FunctionInfoWrapper cast(Object *object)
Definition: liveedit.h:233
static MUST_USE_RESULT MaybeHandle< Object > GetElement(Isolate *isolate, Handle< Object > object, uint32_t index)
Definition: objects-inl.h:1113

References v8::internal::JSArrayBasedStruct< FunctionInfoWrapper >::cast(), current_parent_index_, v8::internal::Object::GetElement(), isolate(), result_, and v8::internal::FunctionInfoWrapper::SetFunctionCode().

+ Here is the call graph for this function:

◆ FunctionDone()

void v8::internal::FunctionInfoListener::FunctionDone ( )
inline

Definition at line 719 of file liveedit.cc.

719  {
720  HandleScope scope(isolate());
721  FunctionInfoWrapper info =
724  isolate(), result_, current_parent_index_).ToHandleChecked());
725  current_parent_index_ = info.GetParentIndex();
726  }

References v8::internal::JSArrayBasedStruct< FunctionInfoWrapper >::cast(), current_parent_index_, v8::internal::Object::GetElement(), v8::internal::FunctionInfoWrapper::GetParentIndex(), isolate(), and result_.

+ Here is the call graph for this function:

◆ FunctionInfo()

void v8::internal::FunctionInfoListener::FunctionInfo ( Handle< SharedFunctionInfo shared,
Scope scope,
Zone zone 
)
inline

Definition at line 741 of file liveedit.cc.

742  {
743  if (!shared->IsSharedFunctionInfo()) {
744  return;
745  }
746  FunctionInfoWrapper info =
749  isolate(), result_, current_parent_index_).ToHandleChecked());
750  info.SetFunctionCode(Handle<Code>(shared->code()),
751  Handle<HeapObject>(shared->scope_info()));
752  info.SetSharedFunctionInfo(shared);
753 
754  Handle<Object> scope_info_list = SerializeFunctionScope(scope, zone);
755  info.SetFunctionScopeInfo(scope_info_list);
756  }
Handle< Object > SerializeFunctionScope(Scope *scope, Zone *zone)
Definition: liveedit.cc:763

References v8::internal::JSArrayBasedStruct< FunctionInfoWrapper >::cast(), current_parent_index_, v8::internal::Object::GetElement(), isolate(), result_, SerializeFunctionScope(), v8::internal::FunctionInfoWrapper::SetFunctionCode(), v8::internal::FunctionInfoWrapper::SetFunctionScopeInfo(), and v8::internal::FunctionInfoWrapper::SetSharedFunctionInfo().

+ Here is the call graph for this function:

◆ FunctionStarted()

void v8::internal::FunctionInfoListener::FunctionStarted ( FunctionLiteral *  fun)
inline

Definition at line 706 of file liveedit.cc.

706  {
707  HandleScope scope(isolate());
708  FunctionInfoWrapper info = FunctionInfoWrapper::Create(isolate());
709  info.SetInitialProperties(fun->name(), fun->start_position(),
710  fun->end_position(), fun->parameter_count(),
711  fun->materialized_literal_count(),
712  fun->slot_count(),
715  SetElementSloppy(result_, len_, info.GetJSArray());
716  len_++;
717  }
static FunctionInfoWrapper Create(Isolate *isolate)
Definition: liveedit.h:227
void SetElementSloppy(Handle< JSObject > object, uint32_t index, Handle< Object > value)
Definition: liveedit.cc:25

References v8::internal::JSArrayBasedStruct< FunctionInfoWrapper >::Create(), current_parent_index_, v8::internal::JSArrayBasedStruct< S >::GetJSArray(), isolate(), len_, result_, v8::internal::SetElementSloppy(), and v8::internal::FunctionInfoWrapper::SetInitialProperties().

+ Here is the call graph for this function:

◆ GetResult()

Handle<JSArray> v8::internal::FunctionInfoListener::GetResult ( )
inline

Definition at line 758 of file liveedit.cc.

758 { return result_; }

References result_.

Referenced by v8::internal::LiveEdit::GatherCompileInfo().

+ Here is the caller graph for this function:

◆ isolate()

Isolate* v8::internal::FunctionInfoListener::isolate ( ) const
inlineprivate

Definition at line 761 of file liveedit.cc.

761 { return result_->GetIsolate(); }

References result_.

Referenced by FunctionCode(), FunctionDone(), FunctionInfo(), FunctionInfoListener(), FunctionStarted(), and SerializeFunctionScope().

+ Here is the caller graph for this function:

◆ SerializeFunctionScope()

Handle<Object> v8::internal::FunctionInfoListener::SerializeFunctionScope ( Scope scope,
Zone zone 
)
inlineprivate

Definition at line 763 of file liveedit.cc.

763  {
764  Handle<JSArray> scope_info_list = isolate()->factory()->NewJSArray(10);
765  int scope_info_length = 0;
766 
767  // Saves some description of scope. It stores name and indexes of
768  // variables in the whole scope chain. Null-named slots delimit
769  // scopes of this chain.
770  Scope* current_scope = scope;
771  while (current_scope != NULL) {
772  HandleScope handle_scope(isolate());
773  ZoneList<Variable*> stack_list(current_scope->StackLocalCount(), zone);
774  ZoneList<Variable*> context_list(
775  current_scope->ContextLocalCount(), zone);
776  current_scope->CollectStackAndContextLocals(&stack_list, &context_list);
777  context_list.Sort(&Variable::CompareIndex);
778 
779  for (int i = 0; i < context_list.length(); i++) {
780  SetElementSloppy(scope_info_list,
781  scope_info_length,
782  context_list[i]->name());
783  scope_info_length++;
785  scope_info_list,
786  scope_info_length,
787  Handle<Smi>(Smi::FromInt(context_list[i]->index()), isolate()));
788  scope_info_length++;
789  }
790  SetElementSloppy(scope_info_list,
791  scope_info_length,
792  Handle<Object>(isolate()->heap()->null_value(),
793  isolate()));
794  scope_info_length++;
795 
796  current_scope = current_scope->outer_scope();
797  }
798 
799  return scope_info_list;
800  }
static Smi * FromInt(int value)
Definition: objects-inl.h:1321
static int CompareIndex(Variable *const *v, Variable *const *w)
Definition: variables.cc:67
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 name
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::Scope::CollectStackAndContextLocals(), v8::internal::Variable::CompareIndex(), v8::internal::Scope::ContextLocalCount(), v8::internal::Isolate::factory(), v8::internal::Smi::FromInt(), isolate(), name, NULL, v8::internal::Scope::outer_scope(), v8::internal::SetElementSloppy(), v8::internal::List< T, AllocationPolicy >::Sort(), and v8::internal::Scope::StackLocalCount().

Referenced by FunctionInfo().

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

Member Data Documentation

◆ current_parent_index_

int v8::internal::FunctionInfoListener::current_parent_index_
private

◆ len_

int v8::internal::FunctionInfoListener::len_
private

Definition at line 803 of file liveedit.cc.

Referenced by FunctionInfoListener(), and FunctionStarted().

◆ result_

Handle<JSArray> v8::internal::FunctionInfoListener::result_
private

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