Lines Matching refs: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) {
478 if (!other->representation().Equals(representation())) return false;
591 if (!representation().IsTagged() || type().Equals(HType::Tagged())) return;
888 add->AssumeRepresentation(index()->representation());
899 sar->AssumeRepresentation(index()->representation());
934 Representation index_rep = actual_index->representation();
935 Representation length_rep = actual_length->representation();
937 index_rep = Representation::Smi();
940 length_rep = Representation::Smi();
942 Representation r = index_rep.generalize(length_rep);
943 if (r.is_more_general_than(Representation::Integer32())) {
944 r = Representation::Integer32();
951 Representation r = representation();
961 // In case of Smi representation, clamp result to Smi::kMaxValue.
1069 Representation HBranch::observed_input_representation(int index) {
1076 return Representation::Tagged();
1080 return Representation::Double();
1082 return Representation::Tagged();
1085 return Representation::Double();
1088 return Representation::Smi();
1090 return Representation::None();
1098 ASSERT(!value->representation().IsDouble());
1136 Representation r = representation();
1142 // Math.abs(kMinInt) overflows its representation, on which the
1149 // In case of Smi representation, clamp Math.abs(Smi::kMinValue) to
1200 if (value()->representation().IsSpecialization()) {
1264 if (!representation().IsSmiOrInteger32()) return this;
1284 Representation HAdd::RepresentationFromInputs() {
1285 Representation left_rep = left()->representation();
1287 return Representation::External();
1293 Representation HAdd::RequiredInputRepresentation(int index) {
1295 Representation left_rep = left()->representation();
1297 return Representation::Integer32();
1305 return arg1->representation().IsSpecialization() &&
1313 !left()->representation().IsDouble()) { // Left could be -0.
1317 !left()->representation().IsDouble()) { // Right could be -0.
1378 HValue* value, Representation required_representation) {
1395 stream->Add("%s ", representation().Mnemonic());
1411 // A value with an integer representation does not need to be transformed.
1412 if (dividend->representation().IsInteger32()) {
1431 if (val->representation().IsSmiOrInteger32()) {
1432 if (!val->representation().Equals(representation())) {
1434 val, representation(), false, false);
1453 left, Representation::Integer32(), false, false);
1464 right, Representation::Integer32(), false, false);
1626 if (representation().IsSmi() || type().IsSmi()) {
1676 Representation r = representation();
1697 Representation r = representation();
1718 Representation r = representation();
1739 Representation r = representation();
1765 if (representation().IsInteger32()) {
1790 if (representation().IsInteger32()) {
1856 if (!base->representation().IsInteger32()) return;
1962 new_index->AssumeRepresentation(Representation::Integer32());
2045 if (!phi_operand->representation().IsInteger32()) return 0;
2265 if (representation().IsSmiOrInteger32()) {
2349 // inserting representation changes.
2355 Representation rep = value->observed_input_representation(it.index());
2378 other->non_phi_uses_[Representation::kSmi],
2379 other->non_phi_uses_[Representation::kInteger32],
2380 other->non_phi_uses_[Representation::kDouble],
2381 other->non_phi_uses_[Representation::kTagged]);
2384 for (int i = 0; i < Representation::kNumRepresentations; i++) {
2391 for (int i = 0; i < Representation::kNumRepresentations; i++) {
2504 HConstant::HConstant(Handle<Object> handle, Representation r)
2538 Representation r,
2561 Representation r,
2581 Representation r,
2612 Initialize(Representation::External());
2616 void HConstant::Initialize(Representation r) {
2619 r = Representation::Smi();
2621 r = Representation::Integer32();
2623 r = Representation::Double();
2625 r = Representation::External();
2635 r = Representation::Tagged();
2652 if (representation().IsDouble()) return false;
2657 HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const {
2686 Representation::Integer32(),
2691 Representation::Integer32(),
2742 Representation new_rep = RepresentationFromInputs();
2745 if (representation().IsSmi() && HasNonSmiUse()) {
2747 Representation::Integer32(), h_infer, "use requirements");
2760 Representation HBinaryOperation::RepresentationFromInputs() {
2762 // the currently assumed output representation.
2763 Representation rep = representation();
2767 // If any of the actual input representation is more general than what we
2768 // have so far but not Tagged, use that representation instead.
2769 Representation left_rep = left()->representation();
2770 Representation right_rep = right()->representation();
2779 Representation current_rep) {
2787 Representation HBinaryOperation::RepresentationFromOutput() {
2788 Representation rep = representation();
2789 // Consider observed output representation, but ignore it if it's Double,
2796 return Representation::None();
2800 void HBinaryOperation::AssumeRepresentation(Representation r) {
2809 Representation new_rep = RepresentationFromInputs();
2923 if (access().representation().IsInteger8()) {
2926 if (access().representation().IsUInteger8()) {
2929 if (access().representation().IsInteger16()) {
2932 if (access().representation().IsUInteger16()) {
3007 ChangeRepresentation(value()->representation());
3012 if (value()->representation().IsSmiOrInteger32()) {
3024 ChangeRepresentation(value()->representation());
3036 Representation left_rep = left()->representation();
3037 Representation right_rep = right()->representation();
3038 Representation observed_left = observed_input_representation(0);
3039 Representation observed_right = observed_input_representation(1);
3041 Representation rep = Representation::None();
3048 rep = Representation::Double();
3164 if (!representation().IsTagged()) {
3392 Representation HUnaryMathOperation::RepresentationFromInputs() {
3393 Representation rep = representation();
3394 // If any of the actual input representation is more general than what we
3395 // have so far but not Tagged, use that representation instead.
3396 Representation input_rep = value()->representation();
3477 Representation::None(),
3581 // We must explicitly force Smi representation here because on x64 we
3589 Representation::Smi(),
3613 // We must explicitly force Smi representation here because on x64 we
3617 zone, context(), free_space_size, Representation::Smi(), store_map);
3618 // Must force Smi representation for x64 (see comment above).
3621 Representation::Smi());
3658 if (representation().IsSmiOrInteger32() &&
3659 !value()->representation().Equals(representation())) {
3665 representation().Equals(RequiredInputRepresentation(0))) {
3754 // these can load arbitrary representation of NaN.
4114 // This must happen before representation inference takes place.
4142 it.index(), Representation::Smi());
4150 Representation new_rep = RepresentationFromInputs();
4159 Representation HPhi::RepresentationFromInputs() {
4160 Representation r = Representation::None();
4168 // Returns a representation if all uses agree on the same representation.
4170 Representation HValue::RepresentationFromUseRequirements() {
4171 Representation rep = Representation::None();
4177 Representation use_rep =
4185 rep = Representation::Integer32();
4188 return Representation::None();
4197 Representation use_rep =
4253 Representation representation) {
4262 return HObjectAccess(portion, offset, representation);
4271 return HObjectAccess(portion, offset, Representation::Tagged());
4291 Representation representation) {
4293 return HObjectAccess(kBackingStore, offset, representation);
4301 Representation representation;
4304 representation = lookup->representation();
4312 representation = details.representation();
4318 return HObjectAccess(kInobject, offset, representation);
4322 return HObjectAccess(kBackingStore, offset, representation, name);
4329 kInobject, Cell::kValueOffset, Representation::Tagged(),