Home | History | Annotate | Download | only in src

Lines Matching full:representation

32 #include "hydrogen-infer-representation.h"
71 void HValue::AssumeRepresentation(Representation r) {
74 // The representation of the value is dictated by type feedback and
83 Representation new_rep = RepresentationFromInputs();
87 if (representation().IsSmi() && HasNonSmiUse()) {
89 Representation::Integer32(), h_infer, "use requirements");
94 Representation HValue::RepresentationFromUses() {
95 if (HasNoUses()) return Representation::None();
97 // Array of use counts for each representation.
98 int use_count[Representation::kNumRepresentations] = { 0 };
102 Representation rep = use->observed_input_representation(it.index());
112 int tagged_count = use_count[Representation::kTagged];
113 int double_count = use_count[Representation::kDouble];
114 int int32_count = use_count[Representation::kInteger32];
115 int smi_count = use_count[Representation::kSmi];
117 if (tagged_count > 0) return Representation::Tagged();
118 if (double_count > 0) return Representation::Double();
119 if (int32_count > 0) return Representation::Integer32();
120 if (smi_count > 0) return Representation::Smi();
122 return Representation::None();
126 void HValue::UpdateRepresentation(Representation new_rep,
129 Representation r = representation();
133 PrintF("Changing #%d %s representation %s -> %s based on %s\n",
152 static int32_t ConvertAndSetOverflow(Representation r,
178 static int32_t AddWithoutOverflow(Representation r,
187 static int32_t SubWithoutOverflow(Representation r,
196 static int32_t MulWithoutOverflow(const Representation& r,
221 Representation r = Representation::Integer32();
282 bool Range::AddAndCheckOverflow(const Representation& r, Range* other) {
294 bool Range::SubAndCheckOverflow(const Representation& r, Range* other) {
322 bool Range::MulAndCheckOverflow(const Representation& r, Range* other) {
466 if (!other->representation().Equals(representation())) return false;
568 if (!representation().IsTagged() || type().Equals(HType::Tagged())) return;
857 add->AssumeRepresentation(index()->representation());
868 sar->AssumeRepresentation(index()->representation());
903 Representation index_rep = actual_index->representation();
904 Representation length_rep = actual_length->representation();
906 index_rep = Representation::Smi();
909 length_rep = Representation::Smi();
911 Representation r = index_rep.generalize(length_rep);
912 if (r.is_more_general_than(Representation::Integer32())) {
913 r = Representation::Integer32();
1016 Representation HBranch::observed_input_representation(int index) {
1023 return Representation::Tagged();
1027 return Representation::Double();
1029 return Representation::Tagged();
1032 return Representation::Double();
1035 return Representation::Smi();
1037 return Representation::None();
1068 Representation r = representation();
1074 // Math.abs(kMinInt) overflows its representation, on which the
1081 // In case of Smi representation, clamp Math.abs(Smi::kMinValue) to
1182 if (!representation().IsSmiOrInteger32()) return this;
1203 return arg1->representation().IsSpecialization() &&
1258 stream->Add("%s ", representation().Mnemonic());
1274 // A value with an integer representation does not need to be transformed.
1275 if (dividend->representation().IsInteger32()) {
1294 if (val->representation().IsSmiOrInteger32()) {
1295 if (!val->representation().Equals(representation())) {
1297 val, representation(), false, false);
1317 left, Representation::Integer32(), false, false);
1328 right, Representation::Integer32(), false, false);
1491 if (representation().IsSmi() || type().IsSmi()) {
1536 Representation r = representation();
1557 Representation r = representation();
1578 Representation r = representation();
1599 Representation r = representation();
1622 if (representation().IsInteger32()) {
1644 if (representation().IsInteger32()) {
1710 if (!base->representation().IsInteger32()) return;
1816 new_index->AssumeRepresentation(Representation::Integer32());
1899 if (!phi_operand->representation().IsInteger32()) return 0;
2119 if (representation().IsSmiOrInteger32()) {
2203 // inserting representation changes.
2209 Representation rep = value->observed_input_representation(it.index());
2232 other->non_phi_uses_[Representation::kSmi],
2233 other->non_phi_uses_[Representation::kInteger32],
2234 other->non_phi_uses_[Representation::kDouble],
2235 other->non_phi_uses_[Representation::kTagged]);
2238 for (int i = 0; i < Representation::kNumRepresentations; i++) {
2245 Representation::kNumRepresentations; i++) {
2311 HConstant::HConstant(Handle<Object> handle, Representation r)
2346 Representation r,
2383 Initialize(Representation::Tagged());
2388 Representation r,
2409 Representation r,
2440 Initialize(Representation::External());
2452 void HConstant::Initialize(Representation r) {
2455 r = Representation::Smi();
2457 r = Representation::Integer32();
2459 r = Representation::Double();
2461 r = Representation::External();
2464 r = Representation::Tagged();
2478 if (representation().IsDouble()) return false;
2483 HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const {
2513 Representation::Integer32(),
2518 Representation::Integer32(),
2569 Representation new_rep = RepresentationFromInputs();
2579 if (representation().IsSmi() && HasNonSmiUse()) {
2581 Representation::Integer32(), h_infer, "use requirements");
2586 Representation HBinaryOperation::RepresentationFromInputs() {
2588 // the currently assumed output representation.
2589 Representation rep = representation();
2593 // If any of the actual input representation is more general than what we
2594 // have so far but not Tagged, use that representation instead.
2595 Representation left_rep = left()->representation();
2596 Representation right_rep = right()->representation();
2605 Representation current_rep) {
2613 Representation HBinaryOperation::RepresentationFromOutput() {
2614 Representation rep = representation();
2615 // Consider observed output representation, but ignore it if it's Double,
2622 return Representation::None();
2626 void HBinaryOperation::AssumeRepresentation(Representation r) {
2635 Representation new_rep = RepresentationFromInputs();
2814 ChangeRepresentation(object()->representation());
2825 Representation left_rep = left()->representation();
2826 Representation right_rep = right()->representation();
2827 Representation observed_left = observed_input_representation(0);
2828 Representation observed_right = observed_input_representation(1);
2830 Representation rep = Representation::None();
2837 rep = Representation::Double();
2962 if (!representation().IsTagged()) {
3189 Representation HUnaryMathOperation::RepresentationFromInputs() {
3190 Representation rep = representation();
3191 // If any of the actual input representation is more general than what we
3192 // have so far but not Tagged, use that representation instead.
3193 Representation input_rep = value()->representation();
3274 Representation::None(),
3378 // We must explicitly force Smi representation here because on x64 we
3386 Representation::Smi(),
3412 // We must explicitly force Smi representation here because on x64 we
3416 zone, context(), free_space_size, Representation::Smi(), store_map);
3417 // Must force Smi representation for x64 (see comment above).
3420 Representation::Smi());
3457 if (representation().IsSmiOrInteger32() &&
3458 !value()->representation().Equals(representation())) {
3464 representation().Equals(RequiredInputRepresentation(0))) {
3553 // these can load arbitrary representation of NaN.
3894 // This must happen before representation inference takes place.
3922 it.index(), Representation::Smi());
3930 Representation new_rep = RepresentationFromInputs();
3939 Representation HPhi::RepresentationFromInputs() {
3940 Representation r = Representation::None();
3948 // Returns a representation if all uses agree on the same representation.
3950 Representation HValue::RepresentationFromUseRequirements() {
3951 Representation rep = Representation::None();
3954 Representation use_rep =
3962 rep = Representation::Integer32();
3965 return Representation::None();
3974 Representation use_rep =
4030 Representation representation) {
4039 return HObjectAccess(portion, offset, representation);
4059 Representation representation) {
4061 return HObjectAccess(kBackingStore, offset, representation);
4069 Representation representation;
4072 representation = lookup->representation();
4080 representation = details.representation();
4086 return HObjectAccess(kInobject, offset, representation);
4090 return HObjectAccess(kBackingStore, offset, representation, name);
4097 kInobject, Cell::kValueOffset, Representation::Tagged(),