V8 Project
v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo Class Reference
+ Collaboration diagram for v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo:

Public Member Functions

 PropertyAccessInfo (HOptimizedGraphBuilder *builder, PropertyAccessType access_type, Type *type, Handle< String > name)
 
bool CanAccessMonomorphic ()
 
bool CanAccessAsMonomorphic (SmallMapList *types)
 
Handle< Mapmap ()
 
Typetype () const
 
Handle< Stringname () const
 
bool IsJSObjectFieldAccessor ()
 
bool GetJSObjectFieldAccess (HObjectAccess *access)
 
bool has_holder ()
 
bool IsLoad () const
 
Handle< JSObjectholder ()
 
Handle< JSFunctionaccessor ()
 
Handle< Objectconstant ()
 
Handle< Maptransition ()
 
SmallMapList * field_maps ()
 
HType field_type () const
 
HObjectAccess access ()
 
bool IsFound () const
 
bool IsProperty () const
 
bool IsField () const
 
bool IsConstant () const
 
bool IsAccessor () const
 
bool IsTransition () const
 
bool IsConfigurable () const
 
bool IsReadOnly () const
 

Private Member Functions

Handle< ObjectGetAccessorsFromMap (Handle< Map > map) const
 
Handle< ObjectGetConstantFromMap (Handle< Map > map) const
 
Handle< HeapTypeGetFieldTypeFromMap (Handle< Map > map) const
 
Handle< MapGetFieldOwnerFromMap (Handle< Map > map) const
 
int GetLocalFieldIndexFromMap (Handle< Map > map) const
 
Representation representation () const
 
TypeToType (Handle< Map > map)
 
Zonezone ()
 
Isolateisolate () const
 
CompilationInfotop_info ()
 
CompilationInfocurrent_info ()
 
bool LoadResult (Handle< Map > map)
 
void LoadFieldMaps (Handle< Map > map)
 
bool LookupDescriptor ()
 
bool LookupInPrototypes ()
 
bool IsCompatible (PropertyAccessInfo *other)
 
void GeneralizeRepresentation (Representation r)
 

Private Attributes

LookupResult lookup_
 
HOptimizedGraphBuilderbuilder_
 
PropertyAccessType access_type_
 
Typetype_
 
Handle< Stringname_
 
Handle< JSObjectholder_
 
Handle< JSFunctionaccessor_
 
Handle< JSObjectapi_holder_
 
Handle< Objectconstant_
 
SmallMapList field_maps_
 
HType field_type_
 
HObjectAccess access_
 

Detailed Description

Definition at line 2420 of file hydrogen.h.

Constructor & Destructor Documentation

◆ PropertyAccessInfo()

v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::PropertyAccessInfo ( HOptimizedGraphBuilder builder,
PropertyAccessType  access_type,
Type type,
Handle< String name 
)
inline

Member Function Documentation

◆ access()

HObjectAccess v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::access ( )
inline

Definition at line 2482 of file hydrogen.h.

2482 { return access_; }

References access_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildLoadNamedField(), v8::internal::HOptimizedGraphBuilder::BuildStoreNamedField(), and GetJSObjectFieldAccess().

+ Here is the caller graph for this function:

◆ accessor()

Handle<JSFunction> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::accessor ( )
inline

Definition at line 2477 of file hydrogen.h.

2477 { return accessor_; }

References accessor_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess().

+ Here is the caller graph for this function:

◆ CanAccessAsMonomorphic()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessAsMonomorphic ( SmallMapList *  types)

Definition at line 6119 of file hydrogen.cc.

6120  {
6121  DCHECK(type_->Is(ToType(types->first())));
6122  if (!CanAccessMonomorphic()) return false;
6124  if (types->length() > kMaxLoadPolymorphism) return false;
6125 
6126  HObjectAccess access = HObjectAccess::ForMap(); // bogus default
6128  for (int i = 1; i < types->length(); ++i) {
6129  PropertyAccessInfo test_info(
6130  builder_, access_type_, ToType(types->at(i)), name_);
6131  HObjectAccess test_access = HObjectAccess::ForMap(); // bogus default
6132  if (!test_info.GetJSObjectFieldAccess(&test_access)) return false;
6133  if (!access.Equals(test_access)) return false;
6134  }
6135  return true;
6136  }
6137 
6138  // Currently only handle Type::Number as a polymorphic case.
6139  // TODO(verwaest): Support monomorphic handling of numbers with a HCheckNumber
6140  // instruction.
6141  if (type_->Is(Type::Number())) return false;
6142 
6143  // Multiple maps cannot transition to the same target map.
6144  DCHECK(!IsLoad() || !IsTransition());
6145  if (IsTransition() && types->length() > 1) return false;
6146 
6147  for (int i = 1; i < types->length(); ++i) {
6148  PropertyAccessInfo test_info(
6149  builder_, access_type_, ToType(types->at(i)), name_);
6150  if (!test_info.IsCompatible(this)) return false;
6151  }
6152 
6153  return true;
6154 }
PropertyAccessInfo(HOptimizedGraphBuilder *builder, PropertyAccessType access_type, Type *type, Handle< String > name)
Definition: hydrogen.h:2422
static const int kMaxStorePolymorphism
Definition: hydrogen.h:2147
static const int kMaxLoadPolymorphism
Definition: hydrogen.h:2146
bool Is(TypeImpl *that)
Definition: types.h:390
#define DCHECK(condition)
Definition: logging.h:205
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))

References DCHECK, GetJSObjectFieldAccess(), IsCompatible(), v8::internal::compiler::IsLoad(), v8::internal::HOptimizedGraphBuilder::kMaxLoadPolymorphism, v8::internal::HOptimizedGraphBuilder::kMaxStorePolymorphism, v8::internal::STATIC_ASSERT(), and v8::internal::HOptimizedGraphBuilder::ToType().

Referenced by v8::internal::HOptimizedGraphBuilder::BuildNamedAccess().

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

◆ CanAccessMonomorphic()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessMonomorphic ( )

Definition at line 6084 of file hydrogen.cc.

6084  {
6085  if (!CanInlinePropertyAccess(type_)) return false;
6086  if (IsJSObjectFieldAccessor()) return IsLoad();
6087  if (this->map()->function_with_prototype() &&
6088  !this->map()->has_non_instance_prototype() &&
6089  name_.is_identical_to(isolate()->factory()->prototype_string())) {
6090  return IsLoad();
6091  }
6092  if (!LookupDescriptor()) return false;
6093  if (IsFound()) return IsLoad() || !IsReadOnly();
6094  if (!LookupInPrototypes()) return false;
6095  if (IsLoad()) return true;
6096 
6097  if (IsAccessor()) return true;
6098  Handle<Map> map = this->map();
6099  map->LookupTransition(NULL, *name_, &lookup_);
6100  if (lookup_.IsTransitionToField() && map->unused_property_fields() > 0) {
6101  // Construct the object field access.
6102  int descriptor = transition()->LastAdded();
6103  int index =
6104  transition()->instance_descriptors()->GetFieldIndex(descriptor) -
6105  map->inobject_properties();
6106  PropertyDetails details =
6107  transition()->instance_descriptors()->GetDetails(descriptor);
6108  Representation representation = details.representation();
6109  access_ = HObjectAccess::ForField(map, index, representation, name_);
6110 
6111  // Load field map for heap objects.
6113  return true;
6114  }
6115  return false;
6116 }
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
static bool CanInlinePropertyAccess(Type *type)
Definition: hydrogen.cc:5462

References v8::internal::CanInlinePropertyAccess(), v8::internal::compiler::IsLoad(), v8::internal::HGraphBuilder::isolate(), map, and NULL.

Referenced by v8::internal::HOptimizedGraphBuilder::HandlePolymorphicCallNamed(), and v8::internal::HOptimizedGraphBuilder::HandlePolymorphicNamedFieldAccess().

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

◆ constant()

Handle<Object> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::constant ( )
inline

Definition at line 2478 of file hydrogen.h.

References constant_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), and v8::internal::HOptimizedGraphBuilder::HandlePolymorphicCallNamed().

+ Here is the caller graph for this function:

◆ current_info()

CompilationInfo* v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::current_info ( )
inlineprivate

Definition at line 2516 of file hydrogen.h.

2516 { return builder_->current_info(); }
CompilationInfo * current_info() const
Definition: hydrogen.h:2167

References builder_, and v8::internal::HOptimizedGraphBuilder::current_info().

+ Here is the call graph for this function:

◆ field_maps()

SmallMapList* v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::field_maps ( )
inline

Definition at line 2480 of file hydrogen.h.

References field_maps_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildLoadNamedField(), and v8::internal::HOptimizedGraphBuilder::BuildStoreNamedField().

+ Here is the caller graph for this function:

◆ field_type()

HType v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::field_type ( ) const
inline

Definition at line 2481 of file hydrogen.h.

2481 { return field_type_; }

References field_type_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildLoadNamedField().

+ Here is the caller graph for this function:

◆ GeneralizeRepresentation()

void v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::GeneralizeRepresentation ( Representation  r)
inlineprivate

Definition at line 2524 of file hydrogen.h.

2524  {
2525  access_ = access_.WithRepresentation(
2526  access_.representation().generalize(r));
2527  }

References access_.

Referenced by IsCompatible().

+ Here is the caller graph for this function:

◆ GetAccessorsFromMap()

Handle<Object> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::GetAccessorsFromMap ( Handle< Map map) const
inlineprivate

Definition at line 2495 of file hydrogen.h.

2495  {
2496  return handle(lookup_.GetValueFromMap(*map), isolate());
2497  }
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References v8::internal::handle(), isolate(), lookup_, and map().

+ Here is the call graph for this function:

◆ GetConstantFromMap()

Handle<Object> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::GetConstantFromMap ( Handle< Map map) const
inlineprivate

Definition at line 2498 of file hydrogen.h.

2498  {
2499  return handle(lookup_.GetConstantFromMap(*map), isolate());
2500  }

References v8::internal::handle(), isolate(), lookup_, and map().

+ Here is the call graph for this function:

◆ GetFieldOwnerFromMap()

Handle<Map> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::GetFieldOwnerFromMap ( Handle< Map map) const
inlineprivate

Definition at line 2504 of file hydrogen.h.

2504  {
2505  return handle(lookup_.GetFieldOwnerFromMap(*map));
2506  }

References v8::internal::handle(), lookup_, and map().

+ Here is the call graph for this function:

◆ GetFieldTypeFromMap()

Handle<HeapType> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::GetFieldTypeFromMap ( Handle< Map map) const
inlineprivate

Definition at line 2501 of file hydrogen.h.

2501  {
2502  return handle(lookup_.GetFieldTypeFromMap(*map), isolate());
2503  }

References v8::internal::handle(), isolate(), lookup_, and map().

+ Here is the call graph for this function:

◆ GetJSObjectFieldAccess()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::GetJSObjectFieldAccess ( HObjectAccess *  access)
inline

Definition at line 2456 of file hydrogen.h.

2456  {
2457  int offset;
2458  if (Accessors::IsJSObjectFieldAccessor<Type>(type_, name_, &offset)) {
2459  if (type_->Is(Type::String())) {
2460  DCHECK(String::Equals(isolate()->factory()->length_string(), name_));
2461  *access = HObjectAccess::ForStringLength();
2462  } else if (type_->Is(Type::Array())) {
2463  DCHECK(String::Equals(isolate()->factory()->length_string(), name_));
2464  *access = HObjectAccess::ForArrayLength(map()->elements_kind());
2465  } else {
2466  *access = HObjectAccess::ForMapAndOffset(map(), offset);
2467  }
2468  return true;
2469  }
2470  return false;
2471  }
bool Equals(String *other)
Definition: objects-inl.h:3336
static TypeHandle Array(TypeHandle element, Region *region)
Definition: types.h:340

References access(), v8::internal::TypeImpl< ZoneTypeConfig >::Array(), DCHECK, v8::internal::String::Equals(), v8::internal::TypeImpl< Config >::Is(), isolate(), map(), name_, and type_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), and CanAccessAsMonomorphic().

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

◆ GetLocalFieldIndexFromMap()

int v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::GetLocalFieldIndexFromMap ( Handle< Map map) const
inlineprivate

Definition at line 2507 of file hydrogen.h.

2507  {
2508  return lookup_.GetLocalFieldIndexFromMap(*map);
2509  }

References lookup_, and map().

+ Here is the call graph for this function:

◆ has_holder()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::has_holder ( )
inline

Definition at line 2473 of file hydrogen.h.

2473 { return !holder_.is_null(); }

References holder_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), and IsCompatible().

+ Here is the caller graph for this function:

◆ holder()

Handle<JSObject> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::holder ( )
inline

Definition at line 2476 of file hydrogen.h.

2476 { return holder_; }

References holder_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), and v8::internal::HOptimizedGraphBuilder::HandlePolymorphicCallNamed().

+ Here is the caller graph for this function:

◆ IsAccessor()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsAccessor ( ) const
inline

Definition at line 2488 of file hydrogen.h.

2488 { return lookup_.IsPropertyCallbacks(); }

References lookup_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), and IsCompatible().

+ Here is the caller graph for this function:

◆ IsCompatible()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsCompatible ( PropertyAccessInfo other)
private

Definition at line 5908 of file hydrogen.cc.

5909  {
5910  if (!CanInlinePropertyAccess(type_)) return false;
5911 
5912  // Currently only handle Type::Number as a polymorphic case.
5913  // TODO(verwaest): Support monomorphic handling of numbers with a HCheckNumber
5914  // instruction.
5915  if (type_->Is(Type::Number())) return false;
5916 
5917  // Values are only compatible for monomorphic load if they all behave the same
5918  // regarding value wrappers.
5919  if (type_->Is(Type::NumberOrString())) {
5920  if (!info->type_->Is(Type::NumberOrString())) return false;
5921  } else {
5922  if (info->type_->Is(Type::NumberOrString())) return false;
5923  }
5924 
5925  if (!LookupDescriptor()) return false;
5926 
5927  if (!IsFound()) {
5928  return (!info->IsFound() || info->has_holder()) &&
5929  map()->prototype() == info->map()->prototype();
5930  }
5931 
5932  // Mismatch if the other access info found the property in the prototype
5933  // chain.
5934  if (info->has_holder()) return false;
5935 
5936  if (IsAccessor()) {
5937  return accessor_.is_identical_to(info->accessor_) &&
5938  api_holder_.is_identical_to(info->api_holder_);
5939  }
5940 
5941  if (IsConstant()) {
5942  return constant_.is_identical_to(info->constant_);
5943  }
5944 
5945  DCHECK(IsField());
5946  if (!info->IsField()) return false;
5947 
5948  Representation r = access_.representation();
5949  if (IsLoad()) {
5950  if (!info->access_.representation().IsCompatibleForLoad(r)) return false;
5951  } else {
5952  if (!info->access_.representation().IsCompatibleForStore(r)) return false;
5953  }
5954  if (info->access_.offset() != access_.offset()) return false;
5955  if (info->access_.IsInobject() != access_.IsInobject()) return false;
5956  if (IsLoad()) {
5957  if (field_maps_.is_empty()) {
5958  info->field_maps_.Clear();
5959  } else if (!info->field_maps_.is_empty()) {
5960  for (int i = 0; i < field_maps_.length(); ++i) {
5961  info->field_maps_.AddMapIfMissing(field_maps_.at(i), info->zone());
5962  }
5963  info->field_maps_.Sort();
5964  }
5965  } else {
5966  // We can only merge stores that agree on their field maps. The comparison
5967  // below is safe, since we keep the field maps sorted.
5968  if (field_maps_.length() != info->field_maps_.length()) return false;
5969  for (int i = 0; i < field_maps_.length(); ++i) {
5970  if (!field_maps_.at(i).is_identical_to(info->field_maps_.at(i))) {
5971  return false;
5972  }
5973  }
5974  }
5975  info->GeneralizeRepresentation(r);
5976  info->field_type_ = info->field_type_.Combine(field_type_);
5977  return true;
5978 }

References access_, accessor_, api_holder_, v8::internal::CanInlinePropertyAccess(), constant_, DCHECK, field_maps_, field_type_, GeneralizeRepresentation(), has_holder(), v8::internal::TypeImpl< Config >::Is(), IsAccessor(), IsConstant(), IsField(), IsFound(), IsLoad(), LookupDescriptor(), map(), type_, and zone().

Referenced by CanAccessAsMonomorphic().

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

◆ IsConfigurable()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsConfigurable ( ) const
inline

Definition at line 2491 of file hydrogen.h.

2491 { return lookup_.IsConfigurable(); }

References lookup_.

◆ IsConstant()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsConstant ( ) const
inline

Definition at line 2487 of file hydrogen.h.

2487 { return lookup_.IsConstant(); }

References lookup_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), v8::internal::HOptimizedGraphBuilder::HandlePolymorphicCallNamed(), and IsCompatible().

+ Here is the caller graph for this function:

◆ IsField()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsField ( ) const
inline

Definition at line 2486 of file hydrogen.h.

2486 { return lookup_.IsField(); }

References lookup_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), and IsCompatible().

+ Here is the caller graph for this function:

◆ IsFound()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsFound ( ) const
inline

Definition at line 2484 of file hydrogen.h.

2484 { return lookup_.IsFound(); }

References lookup_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), and IsCompatible().

+ Here is the caller graph for this function:

◆ IsJSObjectFieldAccessor()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsJSObjectFieldAccessor ( )
inline

Definition at line 2451 of file hydrogen.h.

2451  {
2452  int offset; // unused
2453  return Accessors::IsJSObjectFieldAccessor<Type>(type_, name_, &offset);
2454  }

References name_, and type_.

◆ IsLoad()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsLoad ( ) const
inline

Definition at line 2474 of file hydrogen.h.

2474 { return access_type_ == LOAD; }

References access_type_, and v8::internal::LOAD.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), and IsCompatible().

+ Here is the caller graph for this function:

◆ isolate()

Isolate* v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::isolate ( ) const
inlineprivate

Definition at line 2514 of file hydrogen.h.

2514 { return lookup_.isolate(); }

References lookup_.

Referenced by GetAccessorsFromMap(), GetConstantFromMap(), GetFieldTypeFromMap(), and GetJSObjectFieldAccess().

+ Here is the caller graph for this function:

◆ IsProperty()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsProperty ( ) const
inline

Definition at line 2485 of file hydrogen.h.

2485 { return lookup_.IsProperty(); }

References lookup_.

◆ IsReadOnly()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsReadOnly ( ) const
inline

Definition at line 2492 of file hydrogen.h.

2492 { return lookup_.IsReadOnly(); }

References lookup_.

◆ IsTransition()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsTransition ( ) const
inline

Definition at line 2489 of file hydrogen.h.

2489 { return lookup_.IsTransition(); }

References lookup_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), and v8::internal::HOptimizedGraphBuilder::BuildStoreNamedField().

+ Here is the caller graph for this function:

◆ LoadFieldMaps()

void v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::LoadFieldMaps ( Handle< Map map)
private

Definition at line 6026 of file hydrogen.cc.

6027  {
6028  // Clear any previously collected field maps/type.
6029  field_maps_.Clear();
6030  field_type_ = HType::Tagged();
6031 
6032  // Figure out the field type from the accessor map.
6033  Handle<HeapType> field_type = GetFieldTypeFromMap(map);
6034 
6035  // Collect the (stable) maps from the field type.
6036  int num_field_maps = field_type->NumClasses();
6037  if (num_field_maps == 0) return;
6038  DCHECK(access_.representation().IsHeapObject());
6039  field_maps_.Reserve(num_field_maps, zone());
6040  HeapType::Iterator<Map> it = field_type->Classes();
6041  while (!it.Done()) {
6042  Handle<Map> field_map = it.Current();
6043  if (!field_map->is_stable()) {
6044  field_maps_.Clear();
6045  return;
6046  }
6047  field_maps_.Add(field_map, zone());
6048  it.Advance();
6049  }
6050  field_maps_.Sort();
6051  DCHECK_EQ(num_field_maps, field_maps_.length());
6052 
6053  // Determine field HType from field HeapType.
6054  field_type_ = HType::FromType<HeapType>(field_type);
6055  DCHECK(field_type_.IsHeapObject());
6056 
6057  // Add dependency on the map that introduced the field.
6060 }
Handle< Map > GetFieldOwnerFromMap(Handle< Map > map) const
Definition: hydrogen.h:2504
Handle< HeapType > GetFieldTypeFromMap(Handle< Map > map) const
Definition: hydrogen.h:2501
static void AddDependentCompilationInfo(Handle< Map > map, DependentCode::DependencyGroup group, CompilationInfo *info)
Definition: objects.cc:11345
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206

References v8::internal::Map::AddDependentCompilationInfo(), v8::internal::TypeImpl< Config >::Iterator< T >::Advance(), v8::internal::TypeImpl< Config >::Iterator< T >::Current(), DCHECK, DCHECK_EQ, v8::internal::TypeImpl< Config >::Iterator< T >::Done(), v8::internal::DependentCode::kFieldTypeGroup, map, v8::internal::HGraphBuilder::top_info(), and v8::internal::HGraphBuilder::zone().

+ Here is the call graph for this function:

◆ LoadResult()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::LoadResult ( Handle< Map map)
private

Definition at line 5988 of file hydrogen.cc.

5988  {
5989  if (!IsLoad() && IsProperty() && IsReadOnly()) {
5990  return false;
5991  }
5992 
5993  if (IsField()) {
5994  // Construct the object field access.
5995  int index = GetLocalFieldIndexFromMap(map);
5996  access_ = HObjectAccess::ForField(map, index, representation(), name_);
5997 
5998  // Load field map for heap objects.
5999  LoadFieldMaps(map);
6000  } else if (IsAccessor()) {
6001  Handle<Object> accessors = GetAccessorsFromMap(map);
6002  if (!accessors->IsAccessorPair()) return false;
6003  Object* raw_accessor =
6004  IsLoad() ? Handle<AccessorPair>::cast(accessors)->getter()
6005  : Handle<AccessorPair>::cast(accessors)->setter();
6006  if (!raw_accessor->IsJSFunction()) return false;
6007  Handle<JSFunction> accessor = handle(JSFunction::cast(raw_accessor));
6008  if (accessor->shared()->IsApiFunction()) {
6009  CallOptimization call_optimization(accessor);
6010  if (call_optimization.is_simple_api_call()) {
6011  CallOptimization::HolderLookup holder_lookup;
6012  Handle<Map> receiver_map = this->map();
6013  api_holder_ = call_optimization.LookupHolderOfExpectedType(
6014  receiver_map, &holder_lookup);
6015  }
6016  }
6017  accessor_ = accessor;
6018  } else if (IsConstant()) {
6020  }
6021 
6022  return true;
6023 }
int GetLocalFieldIndexFromMap(Handle< Map > map) const
Definition: hydrogen.h:2507
Handle< Object > GetAccessorsFromMap(Handle< Map > map) const
Definition: hydrogen.h:2495
Handle< Object > GetConstantFromMap(Handle< Map > map) const
Definition: hydrogen.h:2498
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References v8::internal::Handle< T >::cast(), v8::internal::handle(), v8::internal::compiler::IsLoad(), and map.

+ Here is the call graph for this function:

◆ LookupDescriptor()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::LookupDescriptor ( )
private

Definition at line 5981 of file hydrogen.cc.

5981  {
5982  if (!type_->IsClass()) return true;
5983  map()->LookupDescriptor(NULL, *name_, &lookup_);
5984  return LoadResult(map());
5985 }

References map, and NULL.

Referenced by IsCompatible().

+ Here is the caller graph for this function:

◆ LookupInPrototypes()

bool v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::LookupInPrototypes ( )
private

Definition at line 6063 of file hydrogen.cc.

6063  {
6064  Handle<Map> map = this->map();
6065 
6066  while (map->prototype()->IsJSObject()) {
6067  holder_ = handle(JSObject::cast(map->prototype()));
6068  if (holder_->map()->is_deprecated()) {
6070  }
6071  map = Handle<Map>(holder_->map());
6073  lookup_.NotFound();
6074  return false;
6075  }
6076  map->LookupDescriptor(*holder_, *name_, &lookup_);
6077  if (IsFound()) return LoadResult(map);
6078  }
6079  lookup_.NotFound();
6080  return true;
6081 }
static bool TryMigrateInstance(Handle< JSObject > instance)
Definition: objects.cc:3740

References v8::internal::CanInlinePropertyAccess(), v8::internal::handle(), map, v8::internal::HOptimizedGraphBuilder::ToType(), and v8::internal::JSObject::TryMigrateInstance().

+ Here is the call graph for this function:

◆ map()

Handle< Map > v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::map ( )

Definition at line 6157 of file hydrogen.cc.

6157  {
6158  JSFunction* ctor = IC::GetRootConstructor(
6159  type_, current_info()->closure()->context()->native_context());
6160  if (ctor != NULL) return handle(ctor->initial_map());
6161  return type_->AsClass()->Map();
6162 }
static JSFunction * GetRootConstructor(TypeClass *type, Context *native_context)
Definition: ic-inl.h:162
ClassType * AsClass()
Definition: types.h:442

References v8::internal::HOptimizedGraphBuilder::context(), v8::internal::HOptimizedGraphBuilder::current_info(), v8::internal::IC::GetRootConstructor(), v8::internal::handle(), v8::internal::JSFunction::initial_map(), and NULL.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), GetAccessorsFromMap(), GetConstantFromMap(), GetFieldOwnerFromMap(), GetFieldTypeFromMap(), GetJSObjectFieldAccess(), GetLocalFieldIndexFromMap(), v8::internal::HOptimizedGraphBuilder::HandlePolymorphicCallNamed(), v8::internal::HOptimizedGraphBuilder::HandlePolymorphicNamedFieldAccess(), IsCompatible(), and ToType().

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

◆ name()

Handle<String> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::name ( ) const
inline

Definition at line 2449 of file hydrogen.h.

2449 { return name_; }

References name_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildLoadNamedField(), and v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess().

+ Here is the caller graph for this function:

◆ representation()

Representation v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::representation ( ) const
inlineprivate

Definition at line 2510 of file hydrogen.h.

2510 { return lookup_.representation(); }

References lookup_.

◆ top_info()

CompilationInfo* v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::top_info ( )
inlineprivate

Definition at line 2515 of file hydrogen.h.

2515 { return builder_->top_info(); }
CompilationInfo * top_info()
Definition: hydrogen.h:1065

References builder_, and v8::internal::HGraphBuilder::top_info().

+ Here is the call graph for this function:

◆ ToType()

Type* v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::ToType ( Handle< Map map)
inlineprivate

Definition at line 2512 of file hydrogen.h.

2512 { return builder_->ToType(map); }
Type * ToType(Handle< Map > map)
Definition: hydrogen.cc:4513

References builder_, map(), and v8::internal::HOptimizedGraphBuilder::ToType().

+ Here is the call graph for this function:

◆ transition()

Handle<Map> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::transition ( )
inline

Definition at line 2479 of file hydrogen.h.

2479 { return handle(lookup_.GetTransitionTarget()); }

References v8::internal::handle(), and lookup_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildStoreNamedField().

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

◆ type()

Type* v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::type ( ) const
inline

Definition at line 2448 of file hydrogen.h.

2448 { return type_; }

References type_.

Referenced by v8::internal::HOptimizedGraphBuilder::BuildMonomorphicAccess(), v8::internal::HOptimizedGraphBuilder::BuildNamedAccess(), v8::internal::HOptimizedGraphBuilder::HandlePolymorphicCallNamed(), and v8::internal::HOptimizedGraphBuilder::HandlePolymorphicNamedFieldAccess().

+ Here is the caller graph for this function:

◆ zone()

Zone* v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::zone ( )
inlineprivate

Definition at line 2513 of file hydrogen.h.

2513 { return builder_->zone(); }

References builder_, and v8::internal::HGraphBuilder::zone().

Referenced by IsCompatible().

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

Member Data Documentation

◆ access_

HObjectAccess v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::access_
private

Definition at line 2540 of file hydrogen.h.

Referenced by access(), GeneralizeRepresentation(), and IsCompatible().

◆ access_type_

PropertyAccessType v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::access_type_
private

Definition at line 2531 of file hydrogen.h.

Referenced by IsLoad().

◆ accessor_

Handle<JSFunction> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::accessor_
private

Definition at line 2535 of file hydrogen.h.

Referenced by accessor(), and IsCompatible().

◆ api_holder_

Handle<JSObject> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::api_holder_
private

Definition at line 2536 of file hydrogen.h.

Referenced by IsCompatible().

◆ builder_

HOptimizedGraphBuilder* v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::builder_
private

Definition at line 2530 of file hydrogen.h.

Referenced by current_info(), top_info(), ToType(), and zone().

◆ constant_

Handle<Object> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::constant_
private

Definition at line 2537 of file hydrogen.h.

Referenced by constant(), and IsCompatible().

◆ field_maps_

SmallMapList v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::field_maps_
private

Definition at line 2538 of file hydrogen.h.

Referenced by field_maps(), and IsCompatible().

◆ field_type_

HType v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::field_type_
private

Definition at line 2539 of file hydrogen.h.

Referenced by field_type(), and IsCompatible().

◆ holder_

Handle<JSObject> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::holder_
private

Definition at line 2534 of file hydrogen.h.

Referenced by has_holder(), and holder().

◆ lookup_

◆ name_

Handle<String> v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::name_
private

Definition at line 2533 of file hydrogen.h.

Referenced by GetJSObjectFieldAccess(), IsJSObjectFieldAccessor(), and name().

◆ type_

Type* v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::type_
private

Definition at line 2532 of file hydrogen.h.

Referenced by GetJSObjectFieldAccess(), IsCompatible(), IsJSObjectFieldAccessor(), and type().


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