V8 Project
v8::internal::CodeStubGraphBuilderBase Class Referenceabstract
+ Inheritance diagram for v8::internal::CodeStubGraphBuilderBase:
+ Collaboration diagram for v8::internal::CodeStubGraphBuilderBase:

Public Member Functions

 CodeStubGraphBuilderBase (Isolate *isolate, HydrogenCodeStub *stub)
 
virtual bool BuildGraph ()
 
- Public Member Functions inherited from v8::internal::HGraphBuilder
 HGraphBuilder (CompilationInfo *info)
 
virtual ~HGraphBuilder ()
 
Scopescope () const
 
void set_scope (Scope *scope)
 
HBasicBlock * current_block () const
 
void set_current_block (HBasicBlock *block)
 
HEnvironment * environment () const
 
Zonezone () const
 
HGraph * graph () const
 
Isolateisolate () const
 
CompilationInfotop_info ()
 
HGraph * CreateGraph ()
 
void Push (HValue *value)
 
HValuePop ()
 
HInstructionAddInstruction (HInstruction *instr)
 
void FinishCurrentBlock (HControlInstruction *last)
 
void FinishExitCurrentBlock (HControlInstruction *instruction)
 
void Goto (HBasicBlock *from, HBasicBlock *target, FunctionState *state=NULL, bool add_simulate=true)
 
void Goto (HBasicBlock *target, FunctionState *state=NULL, bool add_simulate=true)
 
void GotoNoSimulate (HBasicBlock *from, HBasicBlock *target)
 
void GotoNoSimulate (HBasicBlock *target)
 
void AddLeaveInlined (HBasicBlock *block, HValue *return_value, FunctionState *state)
 
void AddLeaveInlined (HValue *return_value, FunctionState *state)
 
template<class I >
HInstructionNewUncasted ()
 
template<class I >
INew ()
 
template<class I >
HInstructionAddUncasted ()
 
template<class I >
IAdd ()
 
template<class I , class P1 >
HInstructionNewUncasted (P1 p1)
 
template<class I , class P1 >
INew (P1 p1)
 
template<class I , class P1 >
HInstructionAddUncasted (P1 p1)
 
template<class I , class P1 >
IAdd (P1 p1)
 
template<class I , class P1 , class P2 >
HInstructionNewUncasted (P1 p1, P2 p2)
 
template<class I , class P1 , class P2 >
INew (P1 p1, P2 p2)
 
template<class I , class P1 , class P2 >
HInstructionAddUncasted (P1 p1, P2 p2)
 
template<class I , class P1 , class P2 >
IAdd (P1 p1, P2 p2)
 
template<class I , class P1 , class P2 , class P3 >
HInstructionNewUncasted (P1 p1, P2 p2, P3 p3)
 
template<class I , class P1 , class P2 , class P3 >
INew (P1 p1, P2 p2, P3 p3)
 
template<class I , class P1 , class P2 , class P3 >
HInstructionAddUncasted (P1 p1, P2 p2, P3 p3)
 
template<class I , class P1 , class P2 , class P3 >
IAdd (P1 p1, P2 p2, P3 p3)
 
template<class I , class P1 , class P2 , class P3 , class P4 >
HInstructionNewUncasted (P1 p1, P2 p2, P3 p3, P4 p4)
 
template<class I , class P1 , class P2 , class P3 , class P4 >
INew (P1 p1, P2 p2, P3 p3, P4 p4)
 
template<class I , class P1 , class P2 , class P3 , class P4 >
HInstructionAddUncasted (P1 p1, P2 p2, P3 p3, P4 p4)
 
template<class I , class P1 , class P2 , class P3 , class P4 >
IAdd (P1 p1, P2 p2, P3 p3, P4 p4)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 >
HInstructionNewUncasted (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 >
INew (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 >
HInstructionAddUncasted (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 >
IAdd (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
HInstructionNewUncasted (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
INew (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
HInstructionAddUncasted (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
IAdd (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
HInstructionNewUncasted (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
INew (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
HInstructionAddUncasted (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
IAdd (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
HInstructionNewUncasted (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
INew (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
HInstructionAddUncasted (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
 
template<class I , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
IAdd (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
 
void AddSimulate (BailoutId id, RemovableSimulate removable=FIXED_SIMULATE)
 
template<>
HDeoptimize * Add (const char *reason, Deoptimizer::BailoutType type)
 
template<>
HInstructionAddUncasted (const char *reason, Deoptimizer::BailoutType type)
 
template<>
HSimulate * Add (BailoutId id, RemovableSimulate removable)
 
template<>
HSimulate * Add (BailoutId id)
 
template<>
HInstructionAddUncasted (BailoutId id)
 
template<>
HReturn * Add (HValue *value)
 
template<>
HReturn * Add (HConstant *value)
 
template<>
HInstructionAddUncasted (HValue *value)
 
template<>
HInstructionAddUncasted (HConstant *value)
 
template<>
HCallRuntime * Add (Handle< String > name, const Runtime::Function *c_function, int argument_count)
 
template<>
HInstructionAddUncasted (Handle< String > name, const Runtime::Function *c_function, int argument_count)
 
template<>
HContext * New ()
 
template<>
HInstructionNewUncasted ()
 

Protected Types

enum  ArgumentClass { NONE , SINGLE , MULTIPLE }
 

Protected Member Functions

virtual HValueBuildCodeStub ()=0
 
HParameter * GetParameter (int parameter)
 
HValueGetArgumentsLength ()
 
CompilationInfoinfo ()
 
HydrogenCodeStubstub ()
 
HContext * context ()
 
Isolateisolate ()
 
HLoadNamedField * BuildLoadNamedField (HValue *object, FieldIndex index)
 
void BuildStoreNamedField (HValue *object, HValue *value, FieldIndex index, Representation representation)
 
HValueUnmappedCase (HValue *elements, HValue *key)
 
HValueBuildArrayConstructor (ElementsKind kind, AllocationSiteOverrideMode override_mode, ArgumentClass argument_class)
 
HValueBuildInternalArrayConstructor (ElementsKind kind, ArgumentClass argument_class)
 
void BuildCheckAndInstallOptimizedCode (HValue *js_function, HValue *native_context, IfBuilder *builder, HValue *optimized_map, HValue *map_index)
 
void BuildInstallCode (HValue *js_function, HValue *shared_info)
 
HInstructionLoadFromOptimizedCodeMap (HValue *optimized_map, HValue *iterator, int field_offset)
 
void BuildInstallFromOptimizedCodeMap (HValue *js_function, HValue *shared_info, HValue *native_context)
 
- Protected Member Functions inherited from v8::internal::HGraphBuilder
HBasicBlock * CreateBasicBlock (HEnvironment *env)
 
HBasicBlock * CreateLoopHeaderBlock ()
 
template<class BitFieldClass >
HValueBuildDecodeField (HValue *encoded_field)
 
HValueBuildGetElementsKind (HValue *object)
 
HValueBuildCheckHeapObject (HValue *object)
 
HValueBuildCheckString (HValue *string)
 
HValueBuildWrapReceiver (HValue *object, HValue *function)
 
HValueBuildCheckForCapacityGrow (HValue *object, HValue *elements, ElementsKind kind, HValue *length, HValue *key, bool is_js_array, PropertyAccessType access_type)
 
HValueBuildCopyElementsOnWrite (HValue *object, HValue *elements, ElementsKind kind, HValue *length)
 
void BuildTransitionElementsKind (HValue *object, HValue *map, ElementsKind from_kind, ElementsKind to_kind, bool is_jsarray)
 
HValueBuildNumberToString (HValue *object, Type *type)
 
void BuildJSObjectCheck (HValue *receiver, int bit_field_mask)
 
void BuildKeyedIndexCheck (HValue *key, HIfContinuation *join_continuation)
 
void BuildTestForDictionaryProperties (HValue *object, HIfContinuation *continuation)
 
void BuildNonGlobalObjectCheck (HValue *receiver)
 
HValueBuildKeyedLookupCacheHash (HValue *object, HValue *key)
 
HValueBuildUncheckedDictionaryElementLoad (HValue *receiver, HValue *elements, HValue *key, HValue *hash)
 
HValueBuildRegExpConstructResult (HValue *length, HValue *index, HValue *input)
 
HAllocate * BuildAllocate (HValue *object_size, HType type, InstanceType instance_type, HAllocationMode allocation_mode)
 
HValueBuildAddStringLengths (HValue *left_length, HValue *right_length)
 
HValueBuildCreateConsString (HValue *length, HValue *left, HValue *right, HAllocationMode allocation_mode)
 
void BuildCopySeqStringChars (HValue *src, HValue *src_offset, String::Encoding src_encoding, HValue *dst, HValue *dst_offset, String::Encoding dst_encoding, HValue *length)
 
HValueBuildObjectSizeAlignment (HValue *unaligned_size, int header_size)
 
HValueBuildUncheckedStringAdd (HValue *left, HValue *right, HAllocationMode allocation_mode)
 
HValueBuildStringAdd (HValue *left, HValue *right, HAllocationMode allocation_mode)
 
HInstructionBuildUncheckedMonomorphicElementAccess (HValue *checked_object, HValue *key, HValue *val, bool is_js_array, ElementsKind elements_kind, PropertyAccessType access_type, LoadKeyedHoleMode load_mode, KeyedAccessStoreMode store_mode)
 
HInstructionAddElementAccess (HValue *elements, HValue *checked_key, HValue *val, HValue *dependency, ElementsKind elements_kind, PropertyAccessType access_type, LoadKeyedHoleMode load_mode=NEVER_RETURN_HOLE)
 
HInstructionAddLoadStringInstanceType (HValue *string)
 
HInstructionAddLoadStringLength (HValue *string)
 
HStoreNamedField * AddStoreMapConstant (HValue *object, Handle< Map > map)
 
HLoadNamedField * AddLoadMap (HValue *object, HValue *dependency=NULL)
 
HLoadNamedField * AddLoadElements (HValue *object, HValue *dependency=NULL)
 
bool MatchRotateRight (HValue *left, HValue *right, HValue **operand, HValue **shift_amount)
 
HValueBuildBinaryOperation (Token::Value op, HValue *left, HValue *right, Type *left_type, Type *right_type, Type *result_type, Maybe< int > fixed_right_arg, HAllocationMode allocation_mode)
 
HLoadNamedField * AddLoadFixedArrayLength (HValue *object, HValue *dependency=NULL)
 
HLoadNamedField * AddLoadArrayLength (HValue *object, ElementsKind kind, HValue *dependency=NULL)
 
HValueAddLoadJSBuiltin (Builtins::JavaScript builtin)
 
HValueEnforceNumberType (HValue *number, Type *expected)
 
HValueTruncateToNumber (HValue *value, Type **expected)
 
void FinishExitWithHardDeoptimization (const char *reason)
 
void AddIncrementCounter (StatsCounter *counter)
 
HValueBuildNewElementsCapacity (HValue *old_capacity)
 
HValueBuildAllocateArrayFromLength (JSArrayBuilder *array_builder, HValue *length_argument)
 
HValueBuildCalculateElementsSize (ElementsKind kind, HValue *capacity)
 
HAllocate * AllocateJSArrayObject (AllocationSiteMode mode)
 
HConstant * EstablishElementsAllocationSize (ElementsKind kind, int capacity)
 
HAllocate * BuildAllocateElements (ElementsKind kind, HValue *size_in_bytes)
 
void BuildInitializeElementsHeader (HValue *elements, ElementsKind kind, HValue *capacity)
 
HValueBuildAllocateElementsAndInitializeElementsHeader (ElementsKind kind, HValue *capacity)
 
void BuildJSArrayHeader (HValue *array, HValue *array_map, HValue *elements, AllocationSiteMode mode, ElementsKind elements_kind, HValue *allocation_site_payload, HValue *length_field)
 
HValueBuildGrowElementsCapacity (HValue *object, HValue *elements, ElementsKind kind, ElementsKind new_kind, HValue *length, HValue *new_capacity)
 
void BuildFillElementsWithValue (HValue *elements, ElementsKind elements_kind, HValue *from, HValue *to, HValue *value)
 
void BuildFillElementsWithHole (HValue *elements, ElementsKind elements_kind, HValue *from, HValue *to)
 
void BuildCopyElements (HValue *from_elements, ElementsKind from_elements_kind, HValue *to_elements, ElementsKind to_elements_kind, HValue *length, HValue *capacity)
 
HValueBuildCloneShallowArrayCow (HValue *boilerplate, HValue *allocation_site, AllocationSiteMode mode, ElementsKind kind)
 
HValueBuildCloneShallowArrayEmpty (HValue *boilerplate, HValue *allocation_site, AllocationSiteMode mode)
 
HValueBuildCloneShallowArrayNonEmpty (HValue *boilerplate, HValue *allocation_site, AllocationSiteMode mode, ElementsKind kind)
 
HValueBuildElementIndexHash (HValue *index)
 
void BuildCompareNil (HValue *value, Type *type, HIfContinuation *continuation)
 
void BuildCreateAllocationMemento (HValue *previous_object, HValue *previous_object_size, HValue *payload)
 
HInstructionBuildConstantMapCheck (Handle< JSObject > constant)
 
HInstructionBuildCheckPrototypeMaps (Handle< JSObject > prototype, Handle< JSObject > holder)
 
HInstructionBuildGetNativeContext (HValue *closure)
 
HInstructionBuildGetNativeContext ()
 
HInstructionBuildGetArrayFunction ()
 
void SetSourcePosition (int position)
 
void EnterInlinedSource (int start_position, int id)
 
HSourcePosition ScriptPositionToSourcePosition (int position)
 
HSourcePosition source_position ()
 
void set_source_position (HSourcePosition position)
 
template<typename ViewClass >
void BuildArrayBufferViewInitialization (HValue *obj, HValue *buffer, HValue *byte_offset, HValue *byte_length)
 

Private Member Functions

HValueBuildArraySingleArgumentConstructor (JSArrayBuilder *builder)
 
HValueBuildArrayNArgumentsConstructor (JSArrayBuilder *builder, ElementsKind kind)
 

Private Attributes

SmartArrayPointer< HParameter * > parameters_
 
HValuearguments_length_
 
CompilationInfoWithZone info_
 
CodeStubDescriptor descriptor_
 
HContext * context_
 

Additional Inherited Members

- Static Public Attributes inherited from v8::internal::HGraphBuilder
static const int kElementLoopUnrollThreshold = 8
 

Detailed Description

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

Member Enumeration Documentation

◆ ArgumentClass

Constructor & Destructor Documentation

◆ CodeStubGraphBuilderBase()

v8::internal::CodeStubGraphBuilderBase::CodeStubGraphBuilderBase ( Isolate isolate,
HydrogenCodeStub stub 
)
inline

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

38  : HGraphBuilder(&info_),
40  info_(stub, isolate),
42  context_(NULL) {
43  int parameter_count = descriptor_.GetEnvironmentParameterCount();
44  parameters_.Reset(new HParameter*[parameter_count]);
45  }
int GetEnvironmentParameterCount() const
Definition: code-stubs.h:380
SmartArrayPointer< HParameter * > parameters_
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 descriptor_, v8::internal::CodeStubDescriptor::GetEnvironmentParameterCount(), parameters_, and v8::internal::SmartPointerBase< Deallocator, T >::Reset().

+ Here is the call graph for this function:

Member Function Documentation

◆ BuildArrayConstructor()

HValue * v8::internal::CodeStubGraphBuilderBase::BuildArrayConstructor ( ElementsKind  kind,
AllocationSiteOverrideMode  override_mode,
ArgumentClass  argument_class 
)
protected

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

811  {
814  JSArrayBuilder array_builder(this, kind, alloc_site, constructor,
815  override_mode);
816  HValue* result = NULL;
817  switch (argument_class) {
818  case NONE:
819  // This stub is very performance sensitive, the generated code must be
820  // tuned so that it doesn't build and eager frame.
822  result = array_builder.AllocateEmptyArray();
823  break;
824  case SINGLE:
825  result = BuildArraySingleArgumentConstructor(&array_builder);
826  break;
827  case MULTIPLE:
828  result = BuildArrayNArgumentsConstructor(&array_builder, kind);
829  break;
830  }
831 
832  return result;
833 }
HValue * BuildArrayNArgumentsConstructor(JSArrayBuilder *builder, ElementsKind kind)
HValue * BuildArraySingleArgumentConstructor(JSArrayBuilder *builder)
HParameter * GetParameter(int parameter)

References BuildArrayNArgumentsConstructor(), BuildArraySingleArgumentConstructor(), GetParameter(), info(), v8::internal::ArrayConstructorStubBase::kAllocationSite, v8::internal::ArrayConstructorStubBase::kConstructor, v8::internal::CompilationInfo::MarkMustNotHaveEagerFrame(), MULTIPLE, NONE, NULL, and SINGLE.

+ Here is the call graph for this function:

◆ BuildArrayNArgumentsConstructor()

HValue * v8::internal::CodeStubGraphBuilderBase::BuildArrayNArgumentsConstructor ( JSArrayBuilder *  builder,
ElementsKind  kind 
)
private

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

876  {
877  // Insert a bounds check because the number of arguments might exceed
878  // the kInitialMaxFastElementArray limit. This cannot happen for code
879  // that was parsed, but calling via Array.apply(thisArg, [...]) might
880  // trigger it.
881  HValue* length = GetArgumentsLength();
882  HConstant* max_alloc_length =
884  HValue* checked_length = Add<HBoundsCheck>(length, max_alloc_length);
885 
886  // We need to fill with the hole if it's a smi array in the multi-argument
887  // case because we might have to bail out while copying arguments into
888  // the array because they aren't compatible with a smi array.
889  // If it's a double array, no problem, and if it's fast then no
890  // problem either because doubles are boxed.
891  //
892  // TODO(mvstanton): consider an instruction to memset fill the array
893  // with zero in this case instead.
894  JSArrayBuilder::FillMode fill_mode = IsFastSmiElementsKind(kind)
895  ? JSArrayBuilder::FILL_WITH_HOLE
896  : JSArrayBuilder::DONT_FILL_WITH_HOLE;
897  HValue* new_object = array_builder->AllocateArray(checked_length,
898  max_alloc_length,
899  checked_length,
900  fill_mode);
901  HValue* elements = array_builder->GetElementsLocation();
902  DCHECK(elements != NULL);
903 
904  // Now populate the elements correctly.
905  LoopBuilder builder(this,
906  context(),
907  LoopBuilder::kPostIncrement);
908  HValue* start = graph()->GetConstant0();
909  HValue* key = builder.BeginBody(start, checked_length, Token::LT);
910  HInstruction* argument_elements = Add<HArgumentsElements>(false);
911  HInstruction* argument = Add<HAccessArgumentsAt>(
912  argument_elements, checked_length, key);
913 
914  Add<HStoreKeyed>(elements, key, argument, kind);
915  builder.EndBody();
916  return new_object;
917 }
HGraph * graph() const
Definition: hydrogen.h:1063
static const int kInitialMaxFastElementArray
Definition: objects.h:2180
#define DCHECK(condition)
Definition: logging.h:205
bool IsFastSmiElementsKind(ElementsKind kind)

References context(), DCHECK, GetArgumentsLength(), v8::internal::HGraphBuilder::graph(), v8::internal::IsFastSmiElementsKind(), v8::internal::JSObject::kInitialMaxFastElementArray, and NULL.

Referenced by BuildArrayConstructor(), and BuildInternalArrayConstructor().

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

◆ BuildArraySingleArgumentConstructor()

HValue * v8::internal::CodeStubGraphBuilderBase::BuildArraySingleArgumentConstructor ( JSArrayBuilder *  builder)
private

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

862  {
863  // Smi check and range check on the input arg.
864  HValue* constant_one = graph()->GetConstant1();
865  HValue* constant_zero = graph()->GetConstant0();
866 
867  HInstruction* elements = Add<HArgumentsElements>(false);
868  HInstruction* argument = Add<HAccessArgumentsAt>(
869  elements, constant_one, constant_zero);
870 
871  return BuildAllocateArrayFromLength(array_builder, argument);
872 }
HValue * BuildAllocateArrayFromLength(JSArrayBuilder *array_builder, HValue *length_argument)
Definition: hydrogen.cc:2514

References v8::internal::HGraphBuilder::BuildAllocateArrayFromLength(), and v8::internal::HGraphBuilder::graph().

Referenced by BuildArrayConstructor(), and BuildInternalArrayConstructor().

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

◆ BuildCheckAndInstallOptimizedCode()

void v8::internal::CodeStubGraphBuilderBase::BuildCheckAndInstallOptimizedCode ( HValue js_function,
HValue native_context,
IfBuilder *  builder,
HValue optimized_map,
HValue map_index 
)
protected

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

1302  {
1303  HValue* osr_ast_id_none = Add<HConstant>(BailoutId::None().ToInt());
1304  HValue* context_slot = LoadFromOptimizedCodeMap(
1305  optimized_map, map_index, SharedFunctionInfo::kContextOffset);
1306  HValue* osr_ast_slot = LoadFromOptimizedCodeMap(
1307  optimized_map, map_index, SharedFunctionInfo::kOsrAstIdOffset);
1308  builder->If<HCompareObjectEqAndBranch>(native_context,
1309  context_slot);
1310  builder->AndIf<HCompareObjectEqAndBranch>(osr_ast_slot, osr_ast_id_none);
1311  builder->Then();
1312  HValue* code_object = LoadFromOptimizedCodeMap(optimized_map,
1314  // and the literals
1315  HValue* literals = LoadFromOptimizedCodeMap(optimized_map,
1317 
1318  Counters* counters = isolate()->counters();
1319  AddIncrementCounter(counters->fast_new_closure_install_optimized());
1320 
1321  // TODO(fschneider): Idea: store proper code pointers in the optimized code
1322  // map and either unmangle them on marking or do nothing as the whole map is
1323  // discarded on major GC anyway.
1324  Add<HStoreCodeEntry>(js_function, code_object);
1325  Add<HStoreNamedField>(js_function, HObjectAccess::ForLiteralsPointer(),
1326  literals);
1327 
1328  // Now link a function into a list of optimized functions.
1329  HValue* optimized_functions_list = Add<HLoadNamedField>(
1330  native_context, static_cast<HValue*>(NULL),
1331  HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST));
1332  Add<HStoreNamedField>(js_function,
1333  HObjectAccess::ForNextFunctionLinkPointer(),
1334  optimized_functions_list);
1335 
1336  // This store is the only one that should have a write barrier.
1337  Add<HStoreNamedField>(native_context,
1338  HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST),
1339  js_function);
1340 
1341  // The builder continues in the "then" after this function.
1342 }
static BailoutId None()
Definition: utils.h:960
HInstruction * LoadFromOptimizedCodeMap(HValue *optimized_map, HValue *iterator, int field_offset)
void AddIncrementCounter(StatsCounter *counter)
Definition: hydrogen.cc:1219
Counters * counters()
Definition: isolate.h:857
static const int kCachedCodeOffset
Definition: objects.h:6626
static const int kOsrAstIdOffset
Definition: objects.h:6628
static const int kLiteralsOffset
Definition: objects.h:6627
static const int kContextOffset
Definition: objects.h:6625
enable harmony numeric literals(0o77, 0b11)") DEFINE_BOOL(harmony_object_literals

References v8::internal::HGraphBuilder::AddIncrementCounter(), v8::internal::Isolate::counters(), isolate(), v8::internal::SharedFunctionInfo::kCachedCodeOffset, v8::internal::SharedFunctionInfo::kContextOffset, v8::internal::SharedFunctionInfo::kLiteralsOffset, v8::internal::SharedFunctionInfo::kOsrAstIdOffset, literals(), LoadFromOptimizedCodeMap(), v8::internal::BailoutId::None(), NULL, and v8::internal::Context::OPTIMIZED_FUNCTIONS_LIST.

Referenced by BuildInstallFromOptimizedCodeMap().

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

◆ BuildCodeStub()

virtual HValue* v8::internal::CodeStubGraphBuilderBase::BuildCodeStub ( )
protectedpure virtual

Implemented in v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< KeyedLoadGenericStub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, v8::internal::CodeStubGraphBuilder< Stub >, and v8::internal::CodeStubGraphBuilder< Stub >.

Referenced by BuildGraph().

+ Here is the caller graph for this function:

◆ BuildGraph()

bool v8::internal::CodeStubGraphBuilderBase::BuildGraph ( )
virtual

Implements v8::internal::HGraphBuilder.

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

114  {
115  // Update the static counter each time a new code stub is generated.
116  isolate()->counters()->code_stubs()->Increment();
117 
118  if (FLAG_trace_hydrogen_stubs) {
119  const char* name = CodeStub::MajorName(stub()->MajorKey(), false);
120  PrintF("-----------------------------------------------------------\n");
121  PrintF("Compiling stub %s using hydrogen\n", name);
122  isolate()->GetHTracer()->TraceCompilation(&info_);
123  }
124 
125  int param_count = descriptor_.GetEnvironmentParameterCount();
126  HEnvironment* start_environment = graph()->start_environment();
127  HBasicBlock* next_block = CreateBasicBlock(start_environment);
128  Goto(next_block);
129  next_block->SetJoinId(BailoutId::StubEntry());
130  set_current_block(next_block);
131 
132  bool runtime_stack_params = descriptor_.stack_parameter_count().is_valid();
133  HInstruction* stack_parameter_count = NULL;
134  for (int i = 0; i < param_count; ++i) {
136  HParameter* param = Add<HParameter>(i,
137  HParameter::REGISTER_PARAMETER, r);
138  start_environment->Bind(i, param);
139  parameters_[i] = param;
141  param->set_type(HType::Smi());
142  stack_parameter_count = param;
143  arguments_length_ = stack_parameter_count;
144  }
145  }
146 
147  DCHECK(!runtime_stack_params || arguments_length_ != NULL);
148  if (!runtime_stack_params) {
149  stack_parameter_count = graph()->GetConstantMinus1();
150  arguments_length_ = graph()->GetConstant0();
151  }
152 
153  context_ = Add<HContext>();
154  start_environment->BindContext(context_);
155 
156  Add<HSimulate>(BailoutId::StubEntry());
157 
158  NoObservableSideEffectsScope no_effects(this);
159 
160  HValue* return_value = BuildCodeStub();
161 
162  // We might have extra expressions to pop from the stack in addition to the
163  // arguments above.
164  HInstruction* stack_pop_count = stack_parameter_count;
166  if (!stack_parameter_count->IsConstant() &&
168  HInstruction* constant_one = graph()->GetConstant1();
169  stack_pop_count = AddUncasted<HAdd>(stack_parameter_count, constant_one);
170  stack_pop_count->ClearFlag(HValue::kCanOverflow);
171  // TODO(mvstanton): verify that stack_parameter_count+1 really fits in a
172  // smi.
173  } else {
175  stack_pop_count = Add<HConstant>(count);
176  }
177  }
178 
179  if (current_block() != NULL) {
180  HReturn* hreturn_instruction = New<HReturn>(return_value,
181  stack_pop_count);
182  FinishCurrentBlock(hreturn_instruction);
183  }
184  return true;
185 }
static BailoutId StubEntry()
Definition: utils.h:964
Representation GetEnvironmentParameterRepresentation(int index) const
Definition: code-stubs.h:384
StubFunctionMode function_mode() const
Definition: code-stubs.h:412
Register stack_parameter_count() const
Definition: code-stubs.h:411
bool IsEnvironmentParameterCountRegister(int index) const
Definition: code-stubs.h:397
void set_current_block(HBasicBlock *block)
Definition: hydrogen.h:1058
void Goto(HBasicBlock *from, HBasicBlock *target, FunctionState *state=NULL, bool add_simulate=true)
Definition: hydrogen.h:1080
HBasicBlock * CreateBasicBlock(HEnvironment *env)
Definition: hydrogen.cc:1240
HBasicBlock * current_block() const
Definition: hydrogen.h:1057
void FinishCurrentBlock(HControlInstruction *last)
Definition: hydrogen.cc:1198
HTracer * GetHTracer()
Definition: isolate.cc:2148
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
@ JS_FUNCTION_STUB_MODE
Definition: code-stubs.h:350
void PrintF(const char *format,...)
Definition: utils.cc:80

References arguments_length_, BuildCodeStub(), v8::internal::HValue::ClearFlag(), context_, v8::internal::Isolate::counters(), v8::internal::HGraphBuilder::CreateBasicBlock(), v8::internal::HGraphBuilder::current_block(), DCHECK, descriptor_, v8::internal::HGraphBuilder::FinishCurrentBlock(), v8::internal::CodeStubDescriptor::function_mode(), v8::internal::CodeStubDescriptor::GetEnvironmentParameterCount(), v8::internal::CodeStubDescriptor::GetEnvironmentParameterRepresentation(), v8::internal::Isolate::GetHTracer(), v8::internal::HGraphBuilder::Goto(), v8::internal::HGraphBuilder::graph(), v8::internal::CodeStubDescriptor::hint_stack_parameter_count(), info_, v8::internal::Register::is_valid(), v8::internal::CodeStubDescriptor::IsEnvironmentParameterCountRegister(), isolate(), v8::internal::JS_FUNCTION_STUB_MODE, v8::internal::HValue::kCanOverflow, name, NULL, parameters_, v8::internal::PrintF(), v8::internal::HGraphBuilder::set_current_block(), v8::internal::CodeStubDescriptor::stack_parameter_count(), stub(), and v8::internal::BailoutId::StubEntry().

+ Here is the call graph for this function:

◆ BuildInstallCode()

void v8::internal::CodeStubGraphBuilderBase::BuildInstallCode ( HValue js_function,
HValue shared_info 
)
protected

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

1346  {
1347  Add<HStoreNamedField>(js_function,
1348  HObjectAccess::ForNextFunctionLinkPointer(),
1349  graph()->GetConstantUndefined());
1350  HValue* code_object = Add<HLoadNamedField>(
1351  shared_info, static_cast<HValue*>(NULL), HObjectAccess::ForCodeOffset());
1352  Add<HStoreCodeEntry>(js_function, code_object);
1353 }

References v8::internal::HGraphBuilder::graph(), and NULL.

Referenced by BuildInstallFromOptimizedCodeMap().

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

◆ BuildInstallFromOptimizedCodeMap()

void v8::internal::CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap ( HValue js_function,
HValue shared_info,
HValue native_context 
)
protected

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

1377  {
1378  Counters* counters = isolate()->counters();
1379  IfBuilder is_optimized(this);
1380  HInstruction* optimized_map = Add<HLoadNamedField>(
1381  shared_info, static_cast<HValue*>(NULL),
1382  HObjectAccess::ForOptimizedCodeMap());
1383  HValue* null_constant = Add<HConstant>(0);
1384  is_optimized.If<HCompareObjectEqAndBranch>(optimized_map, null_constant);
1385  is_optimized.Then();
1386  {
1387  BuildInstallCode(js_function, shared_info);
1388  }
1389  is_optimized.Else();
1390  {
1391  AddIncrementCounter(counters->fast_new_closure_try_optimized());
1392  // optimized_map points to fixed array of 3-element entries
1393  // (native context, optimized code, literals).
1394  // Map must never be empty, so check the first elements.
1395  HValue* first_entry_index =
1396  Add<HConstant>(SharedFunctionInfo::kEntriesStart);
1397  IfBuilder already_in(this);
1398  BuildCheckAndInstallOptimizedCode(js_function, native_context, &already_in,
1399  optimized_map, first_entry_index);
1400  already_in.Else();
1401  {
1402  // Iterate through the rest of map backwards. Do not double check first
1403  // entry. After the loop, if no matching optimized code was found,
1404  // install unoptimized code.
1405  // for(i = map.length() - SharedFunctionInfo::kEntryLength;
1406  // i > SharedFunctionInfo::kEntriesStart;
1407  // i -= SharedFunctionInfo::kEntryLength) { .. }
1408  HValue* shared_function_entry_length =
1409  Add<HConstant>(SharedFunctionInfo::kEntryLength);
1410  LoopBuilder loop_builder(this,
1411  context(),
1412  LoopBuilder::kPostDecrement,
1413  shared_function_entry_length);
1414  HValue* array_length = Add<HLoadNamedField>(
1415  optimized_map, static_cast<HValue*>(NULL),
1416  HObjectAccess::ForFixedArrayLength());
1417  HValue* start_pos = AddUncasted<HSub>(array_length,
1418  shared_function_entry_length);
1419  HValue* slot_iterator = loop_builder.BeginBody(start_pos,
1420  first_entry_index,
1421  Token::GT);
1422  {
1423  IfBuilder done_check(this);
1424  BuildCheckAndInstallOptimizedCode(js_function, native_context,
1425  &done_check,
1426  optimized_map,
1427  slot_iterator);
1428  // Fall out of the loop
1429  loop_builder.Break();
1430  }
1431  loop_builder.EndBody();
1432 
1433  // If slot_iterator equals first entry index, then we failed to find and
1434  // install optimized code
1435  IfBuilder no_optimized_code_check(this);
1436  no_optimized_code_check.If<HCompareNumericAndBranch>(
1437  slot_iterator, first_entry_index, Token::EQ);
1438  no_optimized_code_check.Then();
1439  {
1440  // Store the unoptimized code
1441  BuildInstallCode(js_function, shared_info);
1442  }
1443  }
1444  }
1445 }
void BuildInstallCode(HValue *js_function, HValue *shared_info)
void BuildCheckAndInstallOptimizedCode(HValue *js_function, HValue *native_context, IfBuilder *builder, HValue *optimized_map, HValue *map_index)
static const int kEntriesStart
Definition: objects.h:6624
static const int kEntryLength
Definition: objects.h:6629

References v8::internal::HGraphBuilder::AddIncrementCounter(), BuildCheckAndInstallOptimizedCode(), BuildInstallCode(), context(), v8::internal::Isolate::counters(), v8::internal::EQ, isolate(), v8::internal::SharedFunctionInfo::kEntriesStart, v8::internal::SharedFunctionInfo::kEntryLength, and NULL.

+ Here is the call graph for this function:

◆ BuildInternalArrayConstructor()

HValue * v8::internal::CodeStubGraphBuilderBase::BuildInternalArrayConstructor ( ElementsKind  kind,
ArgumentClass  argument_class 
)
protected

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

837  {
838  HValue* constructor = GetParameter(
840  JSArrayBuilder array_builder(this, kind, constructor);
841 
842  HValue* result = NULL;
843  switch (argument_class) {
844  case NONE:
845  // This stub is very performance sensitive, the generated code must be
846  // tuned so that it doesn't build and eager frame.
848  result = array_builder.AllocateEmptyArray();
849  break;
850  case SINGLE:
851  result = BuildArraySingleArgumentConstructor(&array_builder);
852  break;
853  case MULTIPLE:
854  result = BuildArrayNArgumentsConstructor(&array_builder, kind);
855  break;
856  }
857  return result;
858 }

References BuildArrayNArgumentsConstructor(), BuildArraySingleArgumentConstructor(), GetParameter(), info(), v8::internal::InternalArrayConstructorStubBase::kConstructor, v8::internal::CompilationInfo::MarkMustNotHaveEagerFrame(), MULTIPLE, NONE, NULL, and SINGLE.

+ Here is the call graph for this function:

◆ BuildLoadNamedField()

HLoadNamedField * v8::internal::CodeStubGraphBuilderBase::BuildLoadNamedField ( HValue object,
FieldIndex  index 
)
protected

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

558  {
559  Representation representation = index.is_double()
561  : Representation::Tagged();
562  int offset = index.offset();
563  HObjectAccess access = index.is_inobject()
564  ? HObjectAccess::ForObservableJSObjectOffset(offset, representation)
565  : HObjectAccess::ForBackingStoreOffset(offset, representation);
566  if (index.is_double()) {
567  // Load the heap number.
568  object = Add<HLoadNamedField>(
569  object, static_cast<HValue*>(NULL),
570  access.WithRepresentation(Representation::Tagged()));
571  // Load the double value from it.
572  access = HObjectAccess::ForHeapNumberValue();
573  }
574  return Add<HLoadNamedField>(object, static_cast<HValue*>(NULL), access);
575 }
static Representation Double()
static Representation Tagged()

References v8::internal::Representation::Double(), NULL, and v8::internal::Representation::Tagged().

+ Here is the call graph for this function:

◆ BuildStoreNamedField()

void v8::internal::CodeStubGraphBuilderBase::BuildStoreNamedField ( HValue object,
HValue value,
FieldIndex  index,
Representation  representation 
)
protected

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

724  {
725  DCHECK(!index.is_double() || representation.IsDouble());
726  int offset = index.offset();
727  HObjectAccess access =
728  index.is_inobject()
729  ? HObjectAccess::ForObservableJSObjectOffset(offset, representation)
730  : HObjectAccess::ForBackingStoreOffset(offset, representation);
731 
732  if (representation.IsDouble()) {
733  // Load the heap number.
734  object = Add<HLoadNamedField>(
735  object, static_cast<HValue*>(NULL),
736  access.WithRepresentation(Representation::Tagged()));
737  // Store the double value into it.
738  access = HObjectAccess::ForHeapNumberValue();
739  } else if (representation.IsHeapObject()) {
740  BuildCheckHeapObject(value);
741  }
742 
743  Add<HStoreNamedField>(object, access, value, INITIALIZING_STORE);
744 }
HValue * BuildCheckHeapObject(HValue *object)
Definition: hydrogen.cc:1266

References v8::internal::HGraphBuilder::BuildCheckHeapObject(), DCHECK, v8::internal::INITIALIZING_STORE, v8::internal::Representation::IsDouble(), v8::internal::Representation::IsHeapObject(), NULL, and v8::internal::Representation::Tagged().

+ Here is the call graph for this function:

◆ context()

HContext* v8::internal::CodeStubGraphBuilderBase::context ( )
inlineprotectedvirtual

Implements v8::internal::HGraphBuilder.

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

61 { return context_; }

References context_.

Referenced by BuildArrayNArgumentsConstructor(), and BuildInstallFromOptimizedCodeMap().

+ Here is the caller graph for this function:

◆ GetArgumentsLength()

HValue* v8::internal::CodeStubGraphBuilderBase::GetArgumentsLength ( )
inlineprotected

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

54  {
55  // This is initialized in BuildGraph()
57  return arguments_length_;
58  }

References arguments_length_, DCHECK, and NULL.

Referenced by BuildArrayNArgumentsConstructor().

+ Here is the caller graph for this function:

◆ GetParameter()

HParameter* v8::internal::CodeStubGraphBuilderBase::GetParameter ( int  parameter)
inlineprotected

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

50  {
52  return parameters_[parameter];
53  }

References DCHECK, descriptor_, v8::internal::CodeStubDescriptor::GetEnvironmentParameterCount(), and parameters_.

Referenced by BuildArrayConstructor(), v8::internal::CodeStubGraphBuilder< KeyedLoadGenericStub >::BuildCodeStub(), and BuildInternalArrayConstructor().

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

◆ info()

CompilationInfo* v8::internal::CodeStubGraphBuilderBase::info ( )
inlineprotected

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

59 { return &info_; }

References info_.

Referenced by BuildArrayConstructor(), and BuildInternalArrayConstructor().

+ Here is the caller graph for this function:

◆ isolate()

Isolate* v8::internal::CodeStubGraphBuilderBase::isolate ( )
inlineprotected

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

62 { return info_.isolate(); }
Isolate * isolate() const
Definition: compiler.h:96

References info_, and v8::internal::CompilationInfo::isolate().

Referenced by BuildCheckAndInstallOptimizedCode(), v8::internal::CodeStubGraphBuilder< KeyedLoadGenericStub >::BuildCodeStub(), BuildGraph(), BuildInstallFromOptimizedCodeMap(), and UnmappedCase().

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

◆ LoadFromOptimizedCodeMap()

HInstruction * v8::internal::CodeStubGraphBuilderBase::LoadFromOptimizedCodeMap ( HValue optimized_map,
HValue iterator,
int  field_offset 
)
protected

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

1359  {
1360  // By making sure to express these loads in the form [<hvalue> + constant]
1361  // the keyed load can be hoisted.
1362  DCHECK(field_offset >= 0 && field_offset < SharedFunctionInfo::kEntryLength);
1363  HValue* field_slot = iterator;
1364  if (field_offset > 0) {
1365  HValue* field_offset_value = Add<HConstant>(field_offset);
1366  field_slot = AddUncasted<HAdd>(iterator, field_offset_value);
1367  }
1368  HInstruction* field_entry = Add<HLoadKeyed>(optimized_map, field_slot,
1369  static_cast<HValue*>(NULL), FAST_ELEMENTS);
1370  return field_entry;
1371 }

References DCHECK, v8::internal::FAST_ELEMENTS, v8::internal::SharedFunctionInfo::kEntryLength, and NULL.

Referenced by BuildCheckAndInstallOptimizedCode().

+ Here is the caller graph for this function:

◆ stub()

HydrogenCodeStub* v8::internal::CodeStubGraphBuilderBase::stub ( )
inlineprotected

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

60 { return info_.code_stub(); }
HydrogenCodeStub * code_stub() const
Definition: compiler.h:115

References v8::internal::CompilationInfo::code_stub(), and info_.

Referenced by BuildGraph(), v8::internal::CodeStubGraphBuilder< Stub >::casted_stub(), and v8::internal::CodeStubGraphBuilder< KeyedLoadGenericStub >::casted_stub().

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

◆ UnmappedCase()

HValue * v8::internal::CodeStubGraphBuilderBase::UnmappedCase ( HValue elements,
HValue key 
)
protected

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

606  {
607  HValue* result;
608  HInstruction* backing_store = Add<HLoadKeyed>(
609  elements, graph()->GetConstant1(), static_cast<HValue*>(NULL),
611  Add<HCheckMaps>(backing_store, isolate()->factory()->fixed_array_map());
612  HValue* backing_store_length =
613  Add<HLoadNamedField>(backing_store, static_cast<HValue*>(NULL),
614  HObjectAccess::ForFixedArrayLength());
615  IfBuilder in_unmapped_range(this);
616  in_unmapped_range.If<HCompareNumericAndBranch>(key, backing_store_length,
617  Token::LT);
618  in_unmapped_range.Then();
619  {
620  result = Add<HLoadKeyed>(backing_store, key, static_cast<HValue*>(NULL),
622  }
623  in_unmapped_range.ElseDeopt("Outside of range");
624  in_unmapped_range.End();
625  return result;
626 }

References v8::internal::ALLOW_RETURN_HOLE, v8::internal::FAST_ELEMENTS, v8::internal::FAST_HOLEY_ELEMENTS, v8::internal::HGraphBuilder::graph(), isolate(), v8::internal::NEVER_RETURN_HOLE, and NULL.

+ Here is the call graph for this function:

Member Data Documentation

◆ arguments_length_

HValue* v8::internal::CodeStubGraphBuilderBase::arguments_length_
private

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

Referenced by BuildGraph(), and GetArgumentsLength().

◆ context_

HContext* v8::internal::CodeStubGraphBuilderBase::context_
private

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

Referenced by BuildGraph(), and context().

◆ descriptor_

CodeStubDescriptor v8::internal::CodeStubGraphBuilderBase::descriptor_
private

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

Referenced by BuildGraph(), CodeStubGraphBuilderBase(), and GetParameter().

◆ info_

CompilationInfoWithZone v8::internal::CodeStubGraphBuilderBase::info_
private

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

Referenced by BuildGraph(), info(), isolate(), and stub().

◆ parameters_

SmartArrayPointer<HParameter*> v8::internal::CodeStubGraphBuilderBase::parameters_
private

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

Referenced by BuildGraph(), CodeStubGraphBuilderBase(), and GetParameter().


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