V8 Project
v8::internal::CodeStubGraphBuilder< Stub > Class Template Reference
+ Inheritance diagram for v8::internal::CodeStubGraphBuilder< Stub >:
+ Collaboration diagram for v8::internal::CodeStubGraphBuilder< Stub >:

Public Member Functions

 CodeStubGraphBuilder (Isolate *isolate, Stub *stub)
 
- Public Member Functions inherited from v8::internal::CodeStubGraphBuilderBase
 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 Member Functions

virtual HValueBuildCodeStub ()
 
virtual HValueBuildCodeInitializedStub ()
 
virtual HValueBuildCodeUninitializedStub ()
 
Stub * casted_stub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeInitializedStub ()
 
HValueBuildCodeInitializedStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeInitializedStub ()
 
HValueBuildCodeInitializedStub ()
 
HValueBuildCodeInitializedStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
HValueBuildCodeStub ()
 
- Protected Member Functions inherited from v8::internal::CodeStubGraphBuilderBase
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)
 

Additional Inherited Members

- Static Public Attributes inherited from v8::internal::HGraphBuilder
static const int kElementLoopUnrollThreshold = 8
 
- Protected Types inherited from v8::internal::CodeStubGraphBuilderBase
enum  ArgumentClass { NONE , SINGLE , MULTIPLE }
 

Detailed Description

template<class Stub>
class v8::internal::CodeStubGraphBuilder< Stub >

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

Constructor & Destructor Documentation

◆ CodeStubGraphBuilder()

template<class Stub >
v8::internal::CodeStubGraphBuilder< Stub >::CodeStubGraphBuilder ( Isolate isolate,
Stub *  stub 
)
inline

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

Member Function Documentation

◆ BuildCodeInitializedStub() [1/6]

template<class Stub >
virtual HValue* v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeInitializedStub ( )
inlineprotectedvirtual

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

203  {
204  UNIMPLEMENTED();
205  return NULL;
206  }
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
#define UNIMPLEMENTED()
Definition: logging.h:28

References NULL, and UNIMPLEMENTED.

Referenced by v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeStub().

+ Here is the caller graph for this function:

◆ BuildCodeInitializedStub() [2/6]

HValue * v8::internal::CodeStubGraphBuilder< CompareNilICStub >::BuildCodeInitializedStub ( )
protected

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

1000  {
1001  Isolate* isolate = graph()->isolate();
1002  CompareNilICStub* stub = casted_stub();
1003  HIfContinuation continuation;
1004  Handle<Map> sentinel_map(isolate->heap()->meta_map());
1005  Type* type = stub->GetType(zone(), sentinel_map);
1006  BuildCompareNil(GetParameter(0), type, &continuation);
1007  IfBuilder if_nil(this, &continuation);
1008  if_nil.Then();
1009  if (continuation.IsFalseReachable()) {
1010  if_nil.Else();
1011  if_nil.Return(graph()->GetConstant0());
1012  }
1013  if_nil.End();
1014  return continuation.IsTrueReachable()
1015  ? graph()->GetConstant1()
1016  : graph()->GetConstantUndefined();
1017 }
HParameter * GetParameter(int parameter)
HGraph * graph() const
Definition: hydrogen.h:1063
void BuildCompareNil(HValue *value, Type *type, HIfContinuation *continuation)
Definition: hydrogen.cc:3023
TypeImpl< ZoneTypeConfig > Type

References v8::internal::CompareNilICStub::GetType(), and v8::internal::Isolate::heap().

+ Here is the call graph for this function:

◆ BuildCodeInitializedStub() [3/6]

HValue * v8::internal::CodeStubGraphBuilder< BinaryOpICStub >::BuildCodeInitializedStub ( )
protected

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

1026  {
1027  BinaryOpICState state = casted_stub()->state();
1028 
1029  HValue* left = GetParameter(BinaryOpICStub::kLeft);
1030  HValue* right = GetParameter(BinaryOpICStub::kRight);
1031 
1032  Type* left_type = state.GetLeftType(zone());
1033  Type* right_type = state.GetRightType(zone());
1034  Type* result_type = state.GetResultType(zone());
1035 
1036  DCHECK(!left_type->Is(Type::None()) && !right_type->Is(Type::None()) &&
1037  (state.HasSideEffects() || !result_type->Is(Type::None())));
1038 
1039  HValue* result = NULL;
1040  HAllocationMode allocation_mode(NOT_TENURED);
1041  if (state.op() == Token::ADD &&
1042  (left_type->Maybe(Type::String()) || right_type->Maybe(Type::String())) &&
1043  !left_type->Is(Type::String()) && !right_type->Is(Type::String())) {
1044  // For the generic add stub a fast case for string addition is performance
1045  // critical.
1046  if (left_type->Maybe(Type::String())) {
1047  IfBuilder if_leftisstring(this);
1048  if_leftisstring.If<HIsStringAndBranch>(left);
1049  if_leftisstring.Then();
1050  {
1052  state.op(), left, right,
1053  Type::String(zone()), right_type,
1054  result_type, state.fixed_right_arg(),
1055  allocation_mode));
1056  }
1057  if_leftisstring.Else();
1058  {
1060  state.op(), left, right,
1061  left_type, right_type, result_type,
1062  state.fixed_right_arg(), allocation_mode));
1063  }
1064  if_leftisstring.End();
1065  result = Pop();
1066  } else {
1067  IfBuilder if_rightisstring(this);
1068  if_rightisstring.If<HIsStringAndBranch>(right);
1069  if_rightisstring.Then();
1070  {
1072  state.op(), left, right,
1073  left_type, Type::String(zone()),
1074  result_type, state.fixed_right_arg(),
1075  allocation_mode));
1076  }
1077  if_rightisstring.Else();
1078  {
1080  state.op(), left, right,
1081  left_type, right_type, result_type,
1082  state.fixed_right_arg(), allocation_mode));
1083  }
1084  if_rightisstring.End();
1085  result = Pop();
1086  }
1087  } else {
1088  result = BuildBinaryOperation(
1089  state.op(), left, right,
1090  left_type, right_type, result_type,
1091  state.fixed_right_arg(), allocation_mode);
1092  }
1093 
1094  // If we encounter a generic argument, the number conversion is
1095  // observable, thus we cannot afford to bail out after the fact.
1096  if (!state.HasSideEffects()) {
1097  result = EnforceNumberType(result, result_type);
1098  }
1099 
1100  // Reuse the double box of one of the operands if we are allowed to (i.e.
1101  // chained binops).
1102  if (state.CanReuseDoubleBox()) {
1103  HValue* operand = (state.mode() == OVERWRITE_LEFT) ? left : right;
1104  IfBuilder if_heap_number(this);
1105  if_heap_number.If<HHasInstanceTypeAndBranch>(operand, HEAP_NUMBER_TYPE);
1106  if_heap_number.Then();
1107  Add<HStoreNamedField>(operand, HObjectAccess::ForHeapNumberValue(), result);
1108  Push(operand);
1109  if_heap_number.Else();
1110  Push(result);
1111  if_heap_number.End();
1112  result = Pop();
1113  }
1114 
1115  return result;
1116 }
void Push(HValue *value)
Definition: hydrogen.h:1070
HValue * BuildBinaryOperation(Token::Value op, HValue *left, HValue *right, Type *left_type, Type *right_type, Type *result_type, Maybe< int > fixed_right_arg, HAllocationMode allocation_mode)
Definition: hydrogen.cc:10259
HValue * EnforceNumberType(HValue *number, Type *expected)
Definition: hydrogen.cc:10171
#define DCHECK(condition)
Definition: logging.h:205
@ HEAP_NUMBER_TYPE
Definition: objects.h:669
@ OVERWRITE_LEFT
Definition: ic-state.h:58
@ None
Definition: v8.h:2211

References v8::internal::ADD, DCHECK, v8::internal::HEAP_NUMBER_TYPE, v8::internal::TypeImpl< Config >::Is(), v8::internal::BinaryOpICStub::kLeft, v8::internal::BinaryOpICStub::kRight, v8::internal::TypeImpl< Config >::Maybe(), v8::None, v8::internal::NOT_TENURED, NULL, v8::internal::OVERWRITE_LEFT, and v8::internal::compiler::Push().

+ Here is the call graph for this function:

◆ BuildCodeInitializedStub() [4/6]

HValue * v8::internal::CodeStubGraphBuilder< StringAddStub >::BuildCodeInitializedStub ( )
protected

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

1150  {
1151  StringAddStub* stub = casted_stub();
1152  StringAddFlags flags = stub->flags();
1153  PretenureFlag pretenure_flag = stub->pretenure_flag();
1154 
1155  HValue* left = GetParameter(StringAddStub::kLeft);
1156  HValue* right = GetParameter(StringAddStub::kRight);
1157 
1158  // Make sure that both arguments are strings if not known in advance.
1160  left = BuildCheckString(left);
1161  }
1163  right = BuildCheckString(right);
1164  }
1165 
1166  return BuildStringAdd(left, right, HAllocationMode(pretenure_flag));
1167 }
HValue * BuildStringAdd(HValue *left, HValue *right, HAllocationMode allocation_mode)
Definition: hydrogen.cc:2349
HValue * BuildCheckString(HValue *string)
Definition: hydrogen.cc:1278
@ STRING_ADD_CHECK_LEFT
Definition: code-stubs.h:1214
@ STRING_ADD_CHECK_RIGHT
Definition: code-stubs.h:1216

References v8::internal::anonymous_namespace{flags.cc}::flags, v8::internal::STRING_ADD_CHECK_LEFT, and v8::internal::STRING_ADD_CHECK_RIGHT.

◆ BuildCodeInitializedStub() [5/6]

HValue * v8::internal::CodeStubGraphBuilder< ToBooleanStub >::BuildCodeInitializedStub ( )
protected

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

1176  {
1177  ToBooleanStub* stub = casted_stub();
1178  HValue* true_value = NULL;
1179  HValue* false_value = NULL;
1180 
1181  switch (stub->mode()) {
1183  true_value = graph()->GetConstant1();
1184  false_value = graph()->GetConstant0();
1185  break;
1187  true_value = graph()->GetConstantTrue();
1188  false_value = graph()->GetConstantFalse();
1189  break;
1191  true_value = graph()->GetConstantFalse();
1192  false_value = graph()->GetConstantTrue();
1193  break;
1194  }
1195 
1196  IfBuilder if_true(this);
1197  if_true.If<HBranch>(GetParameter(0), stub->types());
1198  if_true.Then();
1199  if_true.Return(true_value);
1200  if_true.Else();
1201  if_true.End();
1202  return false_value;
1203 }

References v8::internal::ToBooleanStub::mode(), NULL, v8::internal::ToBooleanStub::RESULT_AS_INVERSE_ODDBALL, v8::internal::ToBooleanStub::RESULT_AS_ODDBALL, v8::internal::ToBooleanStub::RESULT_AS_SMI, and v8::internal::ToBooleanStub::types().

+ Here is the call graph for this function:

◆ BuildCodeInitializedStub() [6/6]

HValue * v8::internal::CodeStubGraphBuilder< StoreGlobalStub >::BuildCodeInitializedStub ( )
protected

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

1212  {
1213  StoreGlobalStub* stub = casted_stub();
1214  Handle<Object> placeholer_value(Smi::FromInt(0), isolate());
1215  Handle<PropertyCell> placeholder_cell =
1216  isolate()->factory()->NewPropertyCell(placeholer_value);
1217 
1218  HParameter* value = GetParameter(StoreDescriptor::kValueIndex);
1219 
1220  if (stub->check_global()) {
1221  // Check that the map of the global has not changed: use a placeholder map
1222  // that will be replaced later with the global object's map.
1223  Handle<Map> placeholder_map = isolate()->factory()->meta_map();
1224  HValue* global = Add<HConstant>(
1226  Add<HCheckMaps>(global, placeholder_map);
1227  }
1228 
1229  HValue* cell = Add<HConstant>(placeholder_cell);
1230  HObjectAccess access(HObjectAccess::ForCellPayload(isolate()));
1231  HValue* cell_contents = Add<HLoadNamedField>(
1232  cell, static_cast<HValue*>(NULL), access);
1233 
1234  if (stub->is_constant()) {
1235  IfBuilder builder(this);
1236  builder.If<HCompareObjectEqAndBranch>(cell_contents, value);
1237  builder.Then();
1238  builder.ElseDeopt("Unexpected cell contents in constant global store");
1239  builder.End();
1240  } else {
1241  // Load the payload of the global parameter cell. A hole indicates that the
1242  // property has been deleted and that the store must be handled by the
1243  // runtime.
1244  IfBuilder builder(this);
1245  HValue* hole_value = graph()->GetConstantHole();
1246  builder.If<HCompareObjectEqAndBranch>(cell_contents, hole_value);
1247  builder.Then();
1248  builder.Deopt("Unexpected cell contents in global store");
1249  builder.Else();
1250  Add<HStoreNamedField>(cell, access, value);
1251  builder.End();
1252  }
1253 
1254  return value;
1255 }
Factory * factory()
Definition: isolate.h:982
static Smi * FromInt(int value)
Definition: objects-inl.h:1321
static Handle< HeapObject > global_placeholder(Isolate *isolate)
Definition: code-stubs.h:1009

References v8::internal::StoreGlobalStub::check_global(), v8::internal::Smi::FromInt(), v8::internal::StoreGlobalStub::global_placeholder(), v8::internal::StoreGlobalStub::is_constant(), v8::internal::StoreDescriptor::kValueIndex, and NULL.

+ Here is the call graph for this function:

◆ BuildCodeStub() [1/29]

template<class Stub >
virtual HValue* v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeStub ( )
inlineprotectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

195  {
196  if (casted_stub()->IsUninitialized()) {
198  } else {
199  return BuildCodeInitializedStub();
200  }
201  }

References v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeInitializedStub(), v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeUninitializedStub(), and v8::internal::CodeStubGraphBuilder< Stub >::casted_stub().

+ Here is the call graph for this function:

◆ BuildCodeStub() [2/29]

HValue * v8::internal::CodeStubGraphBuilder< ToNumberStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

286  {
287  HValue* value = GetParameter(0);
288 
289  // Check if the parameter is already a SMI or heap number.
290  IfBuilder if_number(this);
291  if_number.If<HIsSmiAndBranch>(value);
292  if_number.OrIf<HCompareMap>(value, isolate()->factory()->heap_number_map());
293  if_number.Then();
294 
295  // Return the number.
296  Push(value);
297 
298  if_number.Else();
299 
300  // Convert the parameter to number using the builtin.
301  HValue* function = AddLoadJSBuiltin(Builtins::TO_NUMBER);
302  Add<HPushArguments>(value);
303  Push(Add<HInvokeFunction>(function, 1));
304 
305  if_number.End();
306 
307  return Pop();
308 }
HValue * AddLoadJSBuiltin(Builtins::JavaScript builtin)
Definition: hydrogen.cc:3306

References v8::internal::compiler::Push().

+ Here is the call graph for this function:

◆ BuildCodeStub() [3/29]

HValue * v8::internal::CodeStubGraphBuilder< NumberToStringStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

317  {
319  HValue* number = GetParameter(NumberToStringStub::kNumber);
320  return BuildNumberToString(number, Type::Number(zone()));
321 }
HValue * BuildNumberToString(HValue *object, Type *type)
Definition: hydrogen.cc:1878

◆ BuildCodeStub() [4/29]

HValue * v8::internal::CodeStubGraphBuilder< FastCloneShallowArrayStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

330  {
331  Factory* factory = isolate()->factory();
332  HValue* undefined = graph()->GetConstantUndefined();
333  AllocationSiteMode alloc_site_mode = casted_stub()->allocation_site_mode();
334 
335  // This stub is very performance sensitive, the generated code must be tuned
336  // so that it doesn't build and eager frame.
338 
339  HInstruction* allocation_site = Add<HLoadKeyed>(GetParameter(0),
340  GetParameter(1),
341  static_cast<HValue*>(NULL),
342  FAST_ELEMENTS);
343  IfBuilder checker(this);
344  checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site,
345  undefined);
346  checker.Then();
347 
348  HObjectAccess access = HObjectAccess::ForAllocationSiteOffset(
350  HInstruction* boilerplate = Add<HLoadNamedField>(
351  allocation_site, static_cast<HValue*>(NULL), access);
352  HValue* elements = AddLoadElements(boilerplate);
353  HValue* capacity = AddLoadFixedArrayLength(elements);
354  IfBuilder zero_capacity(this);
355  zero_capacity.If<HCompareNumericAndBranch>(capacity, graph()->GetConstant0(),
356  Token::EQ);
357  zero_capacity.Then();
358  Push(BuildCloneShallowArrayEmpty(boilerplate,
359  allocation_site,
360  alloc_site_mode));
361  zero_capacity.Else();
362  IfBuilder if_fixed_cow(this);
363  if_fixed_cow.If<HCompareMap>(elements, factory->fixed_cow_array_map());
364  if_fixed_cow.Then();
365  Push(BuildCloneShallowArrayCow(boilerplate,
366  allocation_site,
367  alloc_site_mode,
368  FAST_ELEMENTS));
369  if_fixed_cow.Else();
370  IfBuilder if_fixed(this);
371  if_fixed.If<HCompareMap>(elements, factory->fixed_array_map());
372  if_fixed.Then();
374  allocation_site,
375  alloc_site_mode,
376  FAST_ELEMENTS));
377 
378  if_fixed.Else();
380  allocation_site,
381  alloc_site_mode,
383  if_fixed.End();
384  if_fixed_cow.End();
385  zero_capacity.End();
386 
387  checker.ElseDeopt("Uninitialized boilerplate literals");
388  checker.End();
389 
390  return environment()->Pop();
391 }
static const int kTransitionInfoOffset
Definition: objects.h:8254
HEnvironment * environment() const
Definition: hydrogen.h:1059
HLoadNamedField * AddLoadElements(HValue *object, HValue *dependency=NULL)
Definition: hydrogen.cc:2708
HLoadNamedField * AddLoadFixedArrayLength(HValue *object, HValue *dependency=NULL)
Definition: hydrogen.cc:2715
HValue * BuildCloneShallowArrayEmpty(HValue *boilerplate, HValue *allocation_site, AllocationSiteMode mode)
Definition: hydrogen.cc:2950
HValue * BuildCloneShallowArrayCow(HValue *boilerplate, HValue *allocation_site, AllocationSiteMode mode, ElementsKind kind)
Definition: hydrogen.cc:2929
HValue * BuildCloneShallowArrayNonEmpty(HValue *boilerplate, HValue *allocation_site, AllocationSiteMode mode, ElementsKind kind)
Definition: hydrogen.cc:2968

References v8::internal::EQ, v8::internal::FAST_DOUBLE_ELEMENTS, v8::internal::FAST_ELEMENTS, v8::internal::AllocationSite::kTransitionInfoOffset, NULL, and v8::internal::compiler::Push().

+ Here is the call graph for this function:

◆ BuildCodeStub() [5/29]

HValue * v8::internal::CodeStubGraphBuilder< FastCloneShallowObjectStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

400  {
401  HValue* undefined = graph()->GetConstantUndefined();
402 
403  HInstruction* allocation_site = Add<HLoadKeyed>(GetParameter(0),
404  GetParameter(1),
405  static_cast<HValue*>(NULL),
406  FAST_ELEMENTS);
407 
408  IfBuilder checker(this);
409  checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site,
410  undefined);
411  checker.And();
412 
413  HObjectAccess access = HObjectAccess::ForAllocationSiteOffset(
415  HInstruction* boilerplate = Add<HLoadNamedField>(
416  allocation_site, static_cast<HValue*>(NULL), access);
417 
418  int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize;
419  int object_size = size;
420  if (FLAG_allocation_site_pretenuring) {
422  }
423 
424  HValue* boilerplate_map = Add<HLoadNamedField>(
425  boilerplate, static_cast<HValue*>(NULL),
426  HObjectAccess::ForMap());
427  HValue* boilerplate_size = Add<HLoadNamedField>(
428  boilerplate_map, static_cast<HValue*>(NULL),
429  HObjectAccess::ForMapInstanceSize());
430  HValue* size_in_words = Add<HConstant>(object_size >> kPointerSizeLog2);
431  checker.If<HCompareNumericAndBranch>(boilerplate_size,
432  size_in_words, Token::EQ);
433  checker.Then();
434 
435  HValue* size_in_bytes = Add<HConstant>(size);
436 
437  HInstruction* object = Add<HAllocate>(size_in_bytes, HType::JSObject(),
439 
440  for (int i = 0; i < object_size; i += kPointerSize) {
441  HObjectAccess access = HObjectAccess::ForObservableJSObjectOffset(i);
442  Add<HStoreNamedField>(
443  object, access, Add<HLoadNamedField>(
444  boilerplate, static_cast<HValue*>(NULL), access));
445  }
446 
447  DCHECK(FLAG_allocation_site_pretenuring || (size == object_size));
448  if (FLAG_allocation_site_pretenuring) {
450  object, Add<HConstant>(object_size), allocation_site);
451  }
452 
453  environment()->Push(object);
454  checker.ElseDeopt("Uninitialized boilerplate in fast clone");
455  checker.End();
456 
457  return environment()->Pop();
458 }
void BuildCreateAllocationMemento(HValue *previous_object, HValue *previous_object_size, HValue *payload)
Definition: hydrogen.cc:3075
static const int kHeaderSize
Definition: objects.h:2195
enable harmony numeric enable harmony object literal extensions Optimize object size
const int kPointerSize
Definition: globals.h:129
const int kPointerSizeLog2
Definition: globals.h:147
@ JS_OBJECT_TYPE
Definition: objects.h:731

References DCHECK, v8::internal::EQ, v8::internal::FAST_ELEMENTS, v8::internal::JS_OBJECT_TYPE, v8::internal::JSObject::kHeaderSize, v8::internal::kPointerSize, v8::internal::kPointerSizeLog2, v8::internal::AllocationMemento::kSize, v8::internal::AllocationSite::kTransitionInfoOffset, v8::internal::NOT_TENURED, NULL, and size.

◆ BuildCodeStub() [6/29]

HValue * v8::internal::CodeStubGraphBuilder< CreateAllocationSiteStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

467  {
468  HValue* size = Add<HConstant>(AllocationSite::kSize);
469  HInstruction* object = Add<HAllocate>(size, HType::JSObject(), TENURED,
471 
472  // Store the map
473  Handle<Map> allocation_site_map = isolate()->factory()->allocation_site_map();
474  AddStoreMapConstant(object, allocation_site_map);
475 
476  // Store the payload (smi elements kind)
477  HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind());
478  Add<HStoreNamedField>(object,
479  HObjectAccess::ForAllocationSiteOffset(
481  initial_elements_kind);
482 
483  // Unlike literals, constructed arrays don't have nested sites
484  Add<HStoreNamedField>(object,
485  HObjectAccess::ForAllocationSiteOffset(
487  graph()->GetConstant0());
488 
489  // Pretenuring calculation field.
490  Add<HStoreNamedField>(object,
491  HObjectAccess::ForAllocationSiteOffset(
493  graph()->GetConstant0());
494 
495  // Pretenuring memento creation count field.
496  Add<HStoreNamedField>(object,
497  HObjectAccess::ForAllocationSiteOffset(
499  graph()->GetConstant0());
500 
501  // Store an empty fixed array for the code dependency.
502  HConstant* empty_fixed_array =
503  Add<HConstant>(isolate()->factory()->empty_fixed_array());
504  Add<HStoreNamedField>(
505  object,
506  HObjectAccess::ForAllocationSiteOffset(
508  empty_fixed_array);
509 
510  // Link the object to the allocation site list
511  HValue* site_list = Add<HConstant>(
512  ExternalReference::allocation_sites_list_address(isolate()));
513  HValue* site = Add<HLoadNamedField>(
514  site_list, static_cast<HValue*>(NULL),
515  HObjectAccess::ForAllocationSiteList());
516  // TODO(mvstanton): This is a store to a weak pointer, which we may want to
517  // mark as such in order to skip the write barrier, once we have a unified
518  // system for weakness. For now we decided to keep it like this because having
519  // an initial write barrier backed store makes this pointer strong until the
520  // next GC, and allocation sites are designed to survive several GCs anyway.
521  Add<HStoreNamedField>(
522  object,
523  HObjectAccess::ForAllocationSiteOffset(AllocationSite::kWeakNextOffset),
524  site);
525  Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(),
526  object);
527 
528  HInstruction* feedback_vector = GetParameter(0);
529  HInstruction* slot = GetParameter(1);
530  Add<HStoreKeyed>(feedback_vector, slot, object, FAST_ELEMENTS,
532  return feedback_vector;
533 }
static const int kPretenureDataOffset
Definition: objects.h:8256
static const int kWeakNextOffset
Definition: objects.h:8261
static const int kDependentCodeOffset
Definition: objects.h:8259
static const int kSize
Definition: objects.h:8262
static const int kPretenureCreateCountOffset
Definition: objects.h:8257
static const int kNestedSiteOffset
Definition: objects.h:8255
HStoreNamedField * AddStoreMapConstant(HValue *object, Handle< Map > map)
Definition: hydrogen.h:1438
ElementsKind GetInitialFastElementsKind()
Definition: elements-kind.h:78

References v8::internal::FAST_ELEMENTS, v8::internal::feedback_vector, v8::internal::GetInitialFastElementsKind(), v8::internal::INITIALIZING_STORE, v8::internal::JS_OBJECT_TYPE, v8::internal::AllocationSite::kDependentCodeOffset, v8::internal::AllocationSite::kNestedSiteOffset, v8::internal::AllocationSite::kPretenureCreateCountOffset, v8::internal::AllocationSite::kPretenureDataOffset, v8::internal::AllocationSite::kSize, v8::internal::AllocationSite::kTransitionInfoOffset, v8::internal::AllocationSite::kWeakNextOffset, NULL, size, and v8::internal::TENURED.

+ Here is the call graph for this function:

◆ BuildCodeStub() [7/29]

HValue * v8::internal::CodeStubGraphBuilder< LoadFastElementStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

542  {
543  HInstruction* load = BuildUncheckedMonomorphicElementAccess(
546  casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD,
548  return load;
549 }
HInstruction * BuildUncheckedMonomorphicElementAccess(HValue *checked_object, HValue *key, HValue *val, bool is_js_array, ElementsKind elements_kind, PropertyAccessType access_type, LoadKeyedHoleMode load_mode, KeyedAccessStoreMode store_mode)
Definition: hydrogen.cc:2398
@ STANDARD_STORE
Definition: objects.h:154

References v8::internal::LoadDescriptor::kNameIndex, v8::internal::LoadDescriptor::kReceiverIndex, v8::internal::LOAD, v8::internal::NEVER_RETURN_HOLE, NULL, and v8::internal::STANDARD_STORE.

◆ BuildCodeStub() [8/29]

HValue * v8::internal::CodeStubGraphBuilder< LoadFieldStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

579  {
580  return BuildLoadNamedField(GetParameter(0), casted_stub()->index());
581 }
HLoadNamedField * BuildLoadNamedField(HValue *object, FieldIndex index)

◆ BuildCodeStub() [9/29]

HValue * v8::internal::CodeStubGraphBuilder< LoadConstantStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

590  {
591  HValue* map = AddLoadMap(GetParameter(0), NULL);
592  HObjectAccess descriptors_access = HObjectAccess::ForObservableJSObjectOffset(
594  HValue* descriptors =
595  Add<HLoadNamedField>(map, static_cast<HValue*>(NULL), descriptors_access);
596  HObjectAccess value_access = HObjectAccess::ForObservableJSObjectOffset(
597  DescriptorArray::GetValueOffset(casted_stub()->constant_index()));
598  return Add<HLoadNamedField>(descriptors, static_cast<HValue*>(NULL),
599  value_access);
600 }
static int GetValueOffset(int descriptor_number)
Definition: objects-inl.h:2965
HLoadNamedField * AddLoadMap(HValue *object, HValue *dependency=NULL)
Definition: hydrogen.cc:2702
static const int kDescriptorsOffset
Definition: objects.h:6198
static Representation Tagged()
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 map

References v8::internal::DescriptorArray::GetValueOffset(), v8::internal::Map::kDescriptorsOffset, map, NULL, and v8::internal::Representation::Tagged().

+ Here is the call graph for this function:

◆ BuildCodeStub() [10/29]

Implements v8::internal::CodeStubGraphBuilderBase.

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

630  {
631  HValue* receiver = GetParameter(LoadDescriptor::kReceiverIndex);
633 
634  // Mapped arguments are actual arguments. Unmapped arguments are values added
635  // to the arguments object after it was created for the call. Mapped arguments
636  // are stored in the context at indexes given by elements[key + 2]. Unmapped
637  // arguments are stored as regular indexed properties in the arguments array,
638  // held at elements[1]. See NewSloppyArguments() in runtime.cc for a detailed
639  // look at argument object construction.
640  //
641  // The sloppy arguments elements array has a special format:
642  //
643  // 0: context
644  // 1: unmapped arguments array
645  // 2: mapped_index0,
646  // 3: mapped_index1,
647  // ...
648  //
649  // length is 2 + min(number_of_actual_arguments, number_of_formal_arguments).
650  // If key + 2 >= elements.length then attempt to look in the unmapped
651  // arguments array (given by elements[1]) and return the value at key, missing
652  // to the runtime if the unmapped arguments array is not a fixed array or if
653  // key >= unmapped_arguments_array.length.
654  //
655  // Otherwise, t = elements[key + 2]. If t is the hole, then look up the value
656  // in the unmapped arguments array, as described above. Otherwise, t is a Smi
657  // index into the context array given at elements[0]. Return the value at
658  // context[t].
659 
660  key = AddUncasted<HForceRepresentation>(key, Representation::Smi());
661  IfBuilder positive_smi(this);
662  positive_smi.If<HCompareNumericAndBranch>(key, graph()->GetConstant0(),
663  Token::LT);
664  positive_smi.ThenDeopt("key is negative");
665  positive_smi.End();
666 
667  HValue* constant_two = Add<HConstant>(2);
668  HValue* elements = AddLoadElements(receiver, static_cast<HValue*>(NULL));
669  HValue* elements_length =
670  Add<HLoadNamedField>(elements, static_cast<HValue*>(NULL),
671  HObjectAccess::ForFixedArrayLength());
672  HValue* adjusted_length = AddUncasted<HSub>(elements_length, constant_two);
673  IfBuilder in_range(this);
674  in_range.If<HCompareNumericAndBranch>(key, adjusted_length, Token::LT);
675  in_range.Then();
676  {
677  HValue* index = AddUncasted<HAdd>(key, constant_two);
678  HInstruction* mapped_index =
679  Add<HLoadKeyed>(elements, index, static_cast<HValue*>(NULL),
681 
682  IfBuilder is_valid(this);
683  is_valid.IfNot<HCompareObjectEqAndBranch>(mapped_index,
684  graph()->GetConstantHole());
685  is_valid.Then();
686  {
687  // TODO(mvstanton): I'd like to assert from this point, that if the
688  // mapped_index is not the hole that it is indeed, a smi. An unnecessary
689  // smi check is being emitted.
690  HValue* the_context =
691  Add<HLoadKeyed>(elements, graph()->GetConstant0(),
692  static_cast<HValue*>(NULL), FAST_ELEMENTS);
694  HValue* result =
695  Add<HLoadKeyed>(the_context, mapped_index, static_cast<HValue*>(NULL),
697  environment()->Push(result);
698  }
699  is_valid.Else();
700  {
701  HValue* result = UnmappedCase(elements, key);
702  environment()->Push(result);
703  }
704  is_valid.End();
705  }
706  in_range.Else();
707  {
708  HValue* result = UnmappedCase(elements, key);
709  environment()->Push(result);
710  }
711  in_range.End();
712 
713  return environment()->Pop();
714 }
HValue * UnmappedCase(HValue *elements, HValue *key)
static const int kHeaderSize
Definition: objects.h:2393
static Representation Smi()

References v8::internal::ALLOW_RETURN_HOLE, DCHECK, v8::internal::FAST_ELEMENTS, v8::internal::FAST_HOLEY_ELEMENTS, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::LoadDescriptor::kNameIndex, v8::internal::LoadDescriptor::kReceiverIndex, NULL, and v8::internal::Representation::Smi().

+ Here is the call graph for this function:

◆ BuildCodeStub() [11/29]

HValue * v8::internal::CodeStubGraphBuilder< StoreFieldStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

748  {
750  casted_stub()->representation());
751  return GetParameter(2);
752 }
void BuildStoreNamedField(HValue *object, HValue *value, FieldIndex index, Representation representation)

◆ BuildCodeStub() [12/29]

HValue * v8::internal::CodeStubGraphBuilder< StringLengthStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

759  {
760  HValue* string = BuildLoadNamedField(GetParameter(0),
761  FieldIndex::ForInObjectOffset(JSValue::kValueOffset));
762  return BuildLoadNamedField(string,
763  FieldIndex::ForInObjectOffset(String::kLengthOffset));
764 }
static const int kValueOffset
Definition: objects.h:7546
static const int kLengthOffset
Definition: objects.h:8802

References v8::internal::String::kLengthOffset, and v8::internal::JSValue::kValueOffset.

◆ BuildCodeStub() [13/29]

◆ BuildCodeStub() [14/29]

HValue * v8::internal::CodeStubGraphBuilder< TransitionElementsKindStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

791  {
793 
795  GetParameter(1),
796  casted_stub()->from_kind(),
797  casted_stub()->to_kind(),
798  casted_stub()->is_js_array());
799 
800  return GetParameter(0);
801 }
void BuildTransitionElementsKind(HValue *object, HValue *map, ElementsKind from_kind, ElementsKind to_kind, bool is_jsarray)
Definition: hydrogen.cc:1394

◆ BuildCodeStub() [15/29]

Implements v8::internal::CodeStubGraphBuilderBase.

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

921  {
922  ElementsKind kind = casted_stub()->elements_kind();
923  AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
924  return BuildArrayConstructor(kind, override_mode, NONE);
925 }
HValue * BuildArrayConstructor(ElementsKind kind, AllocationSiteOverrideMode override_mode, ArgumentClass argument_class)
AllocationSiteOverrideMode
Definition: code-stubs.h:716

References NONE.

◆ BuildCodeStub() [16/29]

Implements v8::internal::CodeStubGraphBuilderBase.

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

935  {
936  ElementsKind kind = casted_stub()->elements_kind();
937  AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
938  return BuildArrayConstructor(kind, override_mode, SINGLE);
939 }

◆ BuildCodeStub() [17/29]

Implements v8::internal::CodeStubGraphBuilderBase.

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

948  {
949  ElementsKind kind = casted_stub()->elements_kind();
950  AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
951  return BuildArrayConstructor(kind, override_mode, MULTIPLE);
952 }

◆ BuildCodeStub() [18/29]

Implements v8::internal::CodeStubGraphBuilderBase.

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

962  {
963  ElementsKind kind = casted_stub()->elements_kind();
964  return BuildInternalArrayConstructor(kind, NONE);
965 }
HValue * BuildInternalArrayConstructor(ElementsKind kind, ArgumentClass argument_class)

References NONE.

◆ BuildCodeStub() [19/29]

Implements v8::internal::CodeStubGraphBuilderBase.

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

975  {
976  ElementsKind kind = casted_stub()->elements_kind();
978 }

◆ BuildCodeStub() [20/29]

Implements v8::internal::CodeStubGraphBuilderBase.

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

988  {
989  ElementsKind kind = casted_stub()->elements_kind();
991 }

◆ BuildCodeStub() [21/29]

HValue * v8::internal::CodeStubGraphBuilder< BinaryOpWithAllocationSiteStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

1125  {
1126  BinaryOpICState state = casted_stub()->state();
1127 
1128  HValue* allocation_site = GetParameter(
1129  BinaryOpWithAllocationSiteStub::kAllocationSite);
1130  HValue* left = GetParameter(BinaryOpWithAllocationSiteStub::kLeft);
1131  HValue* right = GetParameter(BinaryOpWithAllocationSiteStub::kRight);
1132 
1133  Type* left_type = state.GetLeftType(zone());
1134  Type* right_type = state.GetRightType(zone());
1135  Type* result_type = state.GetResultType(zone());
1136  HAllocationMode allocation_mode(allocation_site);
1137 
1138  return BuildBinaryOperation(state.op(), left, right,
1139  left_type, right_type, result_type,
1140  state.fixed_right_arg(), allocation_mode);
1141 }

◆ BuildCodeStub() [22/29]

Implements v8::internal::CodeStubGraphBuilderBase.

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

1264  {
1269 
1270  if (FLAG_trace_elements_transitions) {
1271  // Tracing elements transitions is the job of the runtime.
1272  Add<HDeoptimize>("Tracing elements transitions", Deoptimizer::EAGER);
1273  } else {
1275 
1277  casted_stub()->from_kind(),
1278  casted_stub()->to_kind(),
1279  casted_stub()->is_jsarray());
1280 
1281  BuildUncheckedMonomorphicElementAccess(object, key, value,
1282  casted_stub()->is_jsarray(),
1283  casted_stub()->to_kind(),
1285  casted_stub()->store_mode());
1286  }
1287 
1288  return value;
1289 }

References v8::internal::ALLOW_RETURN_HOLE, v8::internal::Deoptimizer::EAGER, v8::internal::ElementsTransitionAndStoreStub::kKeyIndex, v8::internal::ElementsTransitionAndStoreStub::kMapIndex, v8::internal::ElementsTransitionAndStoreStub::kObjectIndex, v8::internal::ElementsTransitionAndStoreStub::kValueIndex, map, and v8::internal::STORE.

◆ BuildCodeStub() [23/29]

HValue * v8::internal::CodeStubGraphBuilder< FastNewClosureStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

1449  {
1450  Counters* counters = isolate()->counters();
1451  Factory* factory = isolate()->factory();
1452  HInstruction* empty_fixed_array =
1453  Add<HConstant>(factory->empty_fixed_array());
1454  HValue* shared_info = GetParameter(0);
1455 
1456  AddIncrementCounter(counters->fast_new_closure_total());
1457 
1458  // Create a new closure from the given function info in new space
1459  HValue* size = Add<HConstant>(JSFunction::kSize);
1460  HInstruction* js_function = Add<HAllocate>(size, HType::JSObject(),
1462 
1463  int map_index = Context::FunctionMapIndex(casted_stub()->strict_mode(),
1464  casted_stub()->kind());
1465 
1466  // Compute the function map in the current native context and set that
1467  // as the map of the allocated object.
1468  HInstruction* native_context = BuildGetNativeContext();
1469  HInstruction* map_slot_value = Add<HLoadNamedField>(
1470  native_context, static_cast<HValue*>(NULL),
1471  HObjectAccess::ForContextSlot(map_index));
1472  Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value);
1473 
1474  // Initialize the rest of the function.
1475  Add<HStoreNamedField>(js_function, HObjectAccess::ForPropertiesPointer(),
1476  empty_fixed_array);
1477  Add<HStoreNamedField>(js_function, HObjectAccess::ForElementsPointer(),
1478  empty_fixed_array);
1479  Add<HStoreNamedField>(js_function, HObjectAccess::ForLiteralsPointer(),
1480  empty_fixed_array);
1481  Add<HStoreNamedField>(js_function, HObjectAccess::ForPrototypeOrInitialMap(),
1482  graph()->GetConstantHole());
1483  Add<HStoreNamedField>(js_function,
1484  HObjectAccess::ForSharedFunctionInfoPointer(),
1485  shared_info);
1486  Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(),
1487  context());
1488 
1489  // Initialize the code pointer in the function to be the one
1490  // found in the shared function info object.
1491  // But first check if there is an optimized version for our context.
1492  if (FLAG_cache_optimized_code) {
1493  BuildInstallFromOptimizedCodeMap(js_function, shared_info, native_context);
1494  } else {
1495  BuildInstallCode(js_function, shared_info);
1496  }
1497 
1498  return js_function;
1499 }
void BuildInstallFromOptimizedCodeMap(HValue *js_function, HValue *shared_info, HValue *native_context)
void BuildInstallCode(HValue *js_function, HValue *shared_info)
static int FunctionMapIndex(StrictMode strict_mode, FunctionKind kind)
Definition: contexts.h:556
void AddIncrementCounter(StatsCounter *counter)
Definition: hydrogen.cc:1219
HInstruction * BuildGetNativeContext()
Definition: hydrogen.cc:3120
Counters * counters()
Definition: isolate.h:857
static const int kSize
Definition: objects.h:7385
@ JS_FUNCTION_TYPE
Definition: objects.h:749

References v8::internal::Context::FunctionMapIndex(), v8::internal::JS_FUNCTION_TYPE, v8::internal::JSFunction::kSize, v8::internal::NOT_TENURED, NULL, and size.

+ Here is the call graph for this function:

◆ BuildCodeStub() [24/29]

HValue * v8::internal::CodeStubGraphBuilder< FastNewContextStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

1508  {
1509  int length = casted_stub()->slots() + Context::MIN_CONTEXT_SLOTS;
1510 
1511  // Get the function.
1512  HParameter* function = GetParameter(FastNewContextStub::kFunction);
1513 
1514  // Allocate the context in new space.
1515  HAllocate* function_context = Add<HAllocate>(
1516  Add<HConstant>(length * kPointerSize + FixedArray::kHeaderSize),
1517  HType::HeapObject(), NOT_TENURED, FIXED_ARRAY_TYPE);
1518 
1519  // Set up the object header.
1520  AddStoreMapConstant(function_context,
1521  isolate()->factory()->function_context_map());
1522  Add<HStoreNamedField>(function_context,
1523  HObjectAccess::ForFixedArrayLength(),
1524  Add<HConstant>(length));
1525 
1526  // Set up the fixed slots.
1527  Add<HStoreNamedField>(function_context,
1528  HObjectAccess::ForContextSlot(Context::CLOSURE_INDEX),
1529  function);
1530  Add<HStoreNamedField>(function_context,
1531  HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX),
1532  context());
1533  Add<HStoreNamedField>(function_context,
1534  HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX),
1535  graph()->GetConstant0());
1536 
1537  // Copy the global object from the previous context.
1538  HValue* global_object = Add<HLoadNamedField>(
1539  context(), static_cast<HValue*>(NULL),
1540  HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
1541  Add<HStoreNamedField>(function_context,
1542  HObjectAccess::ForContextSlot(
1544  global_object);
1545 
1546  // Initialize the rest of the slots to undefined.
1547  for (int i = Context::MIN_CONTEXT_SLOTS; i < length; ++i) {
1548  Add<HStoreNamedField>(function_context,
1549  HObjectAccess::ForContextSlot(i),
1550  graph()->GetConstantUndefined());
1551  }
1552 
1553  return function_context;
1554 }
@ FIXED_ARRAY_TYPE
Definition: objects.h:717

References v8::internal::Context::CLOSURE_INDEX, v8::internal::Context::EXTENSION_INDEX, v8::internal::FIXED_ARRAY_TYPE, v8::internal::Context::GLOBAL_OBJECT_INDEX, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::kPointerSize, v8::internal::Context::MIN_CONTEXT_SLOTS, v8::internal::NOT_TENURED, NULL, and v8::internal::Context::PREVIOUS_INDEX.

◆ BuildCodeStub() [25/29]

HValue * v8::internal::CodeStubGraphBuilder< LoadDictionaryElementStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

1563  {
1564  HValue* receiver = GetParameter(LoadDescriptor::kReceiverIndex);
1566 
1567  Add<HCheckSmi>(key);
1568 
1569  HValue* elements = AddLoadElements(receiver);
1570 
1571  HValue* hash = BuildElementIndexHash(key);
1572 
1573  return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash);
1574 }
HValue * BuildUncheckedDictionaryElementLoad(HValue *receiver, HValue *elements, HValue *key, HValue *hash)
Definition: hydrogen.cc:1667
HValue * BuildElementIndexHash(HValue *index)
Definition: hydrogen.cc:1634

References v8::internal::LoadDescriptor::kNameIndex, and v8::internal::LoadDescriptor::kReceiverIndex.

◆ BuildCodeStub() [26/29]

HValue * v8::internal::CodeStubGraphBuilder< RegExpConstructResultStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

1583  {
1584  // Determine the parameters.
1585  HValue* length = GetParameter(RegExpConstructResultStub::kLength);
1586  HValue* index = GetParameter(RegExpConstructResultStub::kIndex);
1587  HValue* input = GetParameter(RegExpConstructResultStub::kInput);
1588 
1590 
1591  return BuildRegExpConstructResult(length, index, input);
1592 }
HValue * BuildRegExpConstructResult(HValue *length, HValue *index, HValue *input)
Definition: hydrogen.cc:1807

◆ BuildCodeStub() [27/29]

HValue * v8::internal::CodeStubGraphBuilder< VectorLoadStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

1908  {
1910  Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER);
1911  return receiver;
1912 }

References v8::internal::Deoptimizer::EAGER, and v8::internal::VectorLoadICDescriptor::kReceiverIndex.

◆ BuildCodeStub() [28/29]

HValue * v8::internal::CodeStubGraphBuilder< VectorKeyedLoadStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

1919  {
1921  Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER);
1922  return receiver;
1923 }

References v8::internal::Deoptimizer::EAGER, and v8::internal::VectorLoadICDescriptor::kReceiverIndex.

◆ BuildCodeStub() [29/29]

HValue * v8::internal::CodeStubGraphBuilder< MegamorphicLoadStub >::BuildCodeStub ( )
protectedvirtual

Implements v8::internal::CodeStubGraphBuilderBase.

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

1937  {
1938  // The return address is on the stack.
1939  HValue* receiver = GetParameter(LoadDescriptor::kReceiverIndex);
1941 
1942  // Probe the stub cache.
1944  Code::ComputeHandlerFlags(Code::LOAD_IC));
1945  Add<HTailCallThroughMegamorphicCache>(receiver, name, flags);
1946 
1947  // We never continue.
1948  return graph()->GetConstant0();
1949 }
static Flags ComputeHandlerFlags(Kind handler_kind, StubType type=NORMAL, CacheHolderFlag holder=kCacheOnReceiver)
Definition: objects-inl.h:4975
static Flags RemoveTypeAndHolderFromFlags(Flags flags)
Definition: objects-inl.h:5012
uint32_t Flags
Definition: objects.h:4929
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

References v8::internal::Code::ComputeHandlerFlags(), v8::internal::anonymous_namespace{flags.cc}::flags, v8::internal::LoadDescriptor::kNameIndex, v8::internal::LoadDescriptor::kReceiverIndex, name, and v8::internal::Code::RemoveTypeAndHolderFromFlags().

+ Here is the call graph for this function:

◆ BuildCodeUninitializedStub()

template<class Stub >
virtual HValue* v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeUninitializedStub ( )
inlineprotectedvirtual

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

208  {
209  // Force a deopt that falls back to the runtime.
210  HValue* undefined = graph()->GetConstantUndefined();
211  IfBuilder builder(this);
212  builder.IfNot<HCompareObjectEqAndBranch, HValue*>(undefined, undefined);
213  builder.Then();
214  builder.ElseDeopt("Forced deopt to runtime");
215  return undefined;
216  }

References v8::internal::HGraphBuilder::graph().

Referenced by v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeStub().

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

◆ casted_stub()

template<class Stub >
Stub* v8::internal::CodeStubGraphBuilder< Stub >::casted_stub ( )
inlineprotected

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

218 { return static_cast<Stub*>(stub()); }

References v8::internal::CodeStubGraphBuilderBase::stub().

Referenced by v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeStub().

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

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