return Representation::FromKind(RepresentationField::decode(value_));
}
- inline Handle<String> name() const {
- return name_;
- }
+ inline Handle<Name> name() const { return name_; }
inline bool immutable() const {
return ImmutableField::decode(value_);
static HObjectAccess ForAllocationSiteList() {
return HObjectAccess(kExternalMemory, 0, Representation::Tagged(),
- Handle<String>::null(), false, false);
+ Handle<Name>::null(), false, false);
}
static HObjectAccess ForFixedArrayLength() {
static HObjectAccess ForCounter() {
return HObjectAccess(kExternalMemory, 0, Representation::Integer32(),
- Handle<String>::null(), false, false);
+ Handle<Name>::null(), false, false);
}
static HObjectAccess ForExternalUInteger8() {
return HObjectAccess(kExternalMemory, 0, Representation::UInteger8(),
- Handle<String>::null(), false, false);
+ Handle<Name>::null(), false, false);
}
// Create an access to an offset in a fixed array header.
// Create an access to a resolved field (in-object or backing store).
static HObjectAccess ForField(Handle<Map> map, int index,
Representation representation,
- Handle<String> name);
+ Handle<Name> name);
static HObjectAccess ForJSTypedArrayLength() {
return HObjectAccess::ForObservableJSObjectOffset(
HObjectAccess(Portion portion, int offset,
Representation representation = Representation::Tagged(),
- Handle<String> name = Handle<String>::null(),
- bool immutable = false,
- bool existing_inobject_property = true)
- : value_(PortionField::encode(portion) |
- RepresentationField::encode(representation.kind()) |
- ImmutableField::encode(immutable ? 1 : 0) |
- ExistingInobjectPropertyField::encode(
- existing_inobject_property ? 1 : 0) |
- OffsetField::encode(offset)),
- name_(name) {
+ Handle<Name> name = Handle<Name>::null(),
+ bool immutable = false, bool existing_inobject_property = true)
+ : value_(PortionField::encode(portion) |
+ RepresentationField::encode(representation.kind()) |
+ ImmutableField::encode(immutable ? 1 : 0) |
+ ExistingInobjectPropertyField::encode(
+ existing_inobject_property ? 1 : 0) |
+ OffsetField::encode(offset)),
+ name_(name) {
// assert that the fields decode correctly
DCHECK(this->offset() == offset);
DCHECK(this->portion() == portion);
class OffsetField : public BitField<int, 9, 23> {};
uint32_t value_; // encodes portion, representation, immutable, and offset
- Handle<String> name_;
+ Handle<Name> name_;
friend class HLoadNamedField;
friend class HStoreNamedField;
public:
PropertyAccessInfo(HOptimizedGraphBuilder* builder,
PropertyAccessType access_type, Handle<Map> map,
- Handle<String> name)
+ Handle<Name> name)
: builder_(builder),
access_type_(access_type),
map_(map),
bool NeedsWrappingFor(Handle<JSFunction> target) const;
Handle<Map> map();
- Handle<String> name() const { return name_; }
+ Handle<Name> name() const { return name_; }
bool IsJSObjectFieldAccessor() {
int offset; // unused
int offset;
if (Accessors::IsJSObjectFieldAccessor(map_, name_, &offset)) {
if (IsStringType()) {
- DCHECK(String::Equals(isolate()->factory()->length_string(), name_));
+ DCHECK(Name::Equals(isolate()->factory()->length_string(), name_));
*access = HObjectAccess::ForStringLength();
} else if (IsArrayType()) {
- DCHECK(String::Equals(isolate()->factory()->length_string(), name_));
+ DCHECK(Name::Equals(isolate()->factory()->length_string(), name_));
*access = HObjectAccess::ForArrayLength(map_->elements_kind());
} else {
*access = HObjectAccess::ForMapAndOffset(map_, offset);
HOptimizedGraphBuilder* builder_;
PropertyAccessType access_type_;
Handle<Map> map_;
- Handle<String> name_;
+ Handle<Name> name_;
Handle<JSObject> holder_;
Handle<JSFunction> accessor_;
Handle<JSObject> api_holder_;