OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/double.h" | 8 #include "src/double.h" |
9 #include "src/factory.h" | 9 #include "src/factory.h" |
10 #include "src/hydrogen-infer-representation.h" | 10 #include "src/hydrogen-infer-representation.h" |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 | 521 |
522 void HValue::SetBlock(HBasicBlock* block) { | 522 void HValue::SetBlock(HBasicBlock* block) { |
523 DCHECK(block_ == NULL || block == NULL); | 523 DCHECK(block_ == NULL || block == NULL); |
524 block_ = block; | 524 block_ = block; |
525 if (id_ == kNoNumber && block != NULL) { | 525 if (id_ == kNoNumber && block != NULL) { |
526 id_ = block->graph()->GetNextValueID(this); | 526 id_ = block->graph()->GetNextValueID(this); |
527 } | 527 } |
528 } | 528 } |
529 | 529 |
530 | 530 |
531 OStream& operator<<(OStream& os, const HValue& v) { return v.PrintTo(os); } | 531 std::ostream& operator<<(std::ostream& os, const HValue& v) { |
| 532 return v.PrintTo(os); |
| 533 } |
532 | 534 |
533 | 535 |
534 OStream& operator<<(OStream& os, const TypeOf& t) { | 536 std::ostream& operator<<(std::ostream& os, const TypeOf& t) { |
535 if (t.value->representation().IsTagged() && | 537 if (t.value->representation().IsTagged() && |
536 !t.value->type().Equals(HType::Tagged())) | 538 !t.value->type().Equals(HType::Tagged())) |
537 return os; | 539 return os; |
538 return os << " type:" << t.value->type(); | 540 return os << " type:" << t.value->type(); |
539 } | 541 } |
540 | 542 |
541 | 543 |
542 OStream& operator<<(OStream& os, const ChangesOf& c) { | 544 std::ostream& operator<<(std::ostream& os, const ChangesOf& c) { |
543 GVNFlagSet changes_flags = c.value->ChangesFlags(); | 545 GVNFlagSet changes_flags = c.value->ChangesFlags(); |
544 if (changes_flags.IsEmpty()) return os; | 546 if (changes_flags.IsEmpty()) return os; |
545 os << " changes["; | 547 os << " changes["; |
546 if (changes_flags == c.value->AllSideEffectsFlagSet()) { | 548 if (changes_flags == c.value->AllSideEffectsFlagSet()) { |
547 os << "*"; | 549 os << "*"; |
548 } else { | 550 } else { |
549 bool add_comma = false; | 551 bool add_comma = false; |
550 #define PRINT_DO(Type) \ | 552 #define PRINT_DO(Type) \ |
551 if (changes_flags.Contains(k##Type)) { \ | 553 if (changes_flags.Contains(k##Type)) { \ |
552 if (add_comma) os << ","; \ | 554 if (add_comma) os << ","; \ |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 } | 613 } |
612 | 614 |
613 | 615 |
614 void HValue::ComputeInitialRange(Zone* zone) { | 616 void HValue::ComputeInitialRange(Zone* zone) { |
615 DCHECK(!HasRange()); | 617 DCHECK(!HasRange()); |
616 range_ = InferRange(zone); | 618 range_ = InferRange(zone); |
617 DCHECK(HasRange()); | 619 DCHECK(HasRange()); |
618 } | 620 } |
619 | 621 |
620 | 622 |
621 OStream& operator<<(OStream& os, const HSourcePosition& p) { | 623 std::ostream& operator<<(std::ostream& os, const HSourcePosition& p) { |
622 if (p.IsUnknown()) { | 624 if (p.IsUnknown()) { |
623 return os << "<?>"; | 625 return os << "<?>"; |
624 } else if (FLAG_hydrogen_track_positions) { | 626 } else if (FLAG_hydrogen_track_positions) { |
625 return os << "<" << p.inlining_id() << ":" << p.position() << ">"; | 627 return os << "<" << p.inlining_id() << ":" << p.position() << ">"; |
626 } else { | 628 } else { |
627 return os << "<0:" << p.raw() << ">"; | 629 return os << "<0:" << p.raw() << ">"; |
628 } | 630 } |
629 } | 631 } |
630 | 632 |
631 | 633 |
632 OStream& HInstruction::PrintTo(OStream& os) const { // NOLINT | 634 std::ostream& HInstruction::PrintTo(std::ostream& os) const { // NOLINT |
633 os << Mnemonic() << " "; | 635 os << Mnemonic() << " "; |
634 PrintDataTo(os) << ChangesOf(this) << TypeOf(this); | 636 PrintDataTo(os) << ChangesOf(this) << TypeOf(this); |
635 if (CheckFlag(HValue::kHasNoObservableSideEffects)) os << " [noOSE]"; | 637 if (CheckFlag(HValue::kHasNoObservableSideEffects)) os << " [noOSE]"; |
636 if (CheckFlag(HValue::kIsDead)) os << " [dead]"; | 638 if (CheckFlag(HValue::kIsDead)) os << " [dead]"; |
637 return os; | 639 return os; |
638 } | 640 } |
639 | 641 |
640 | 642 |
641 OStream& HInstruction::PrintDataTo(OStream& os) const { // NOLINT | 643 std::ostream& HInstruction::PrintDataTo(std::ostream& os) const { // NOLINT |
642 for (int i = 0; i < OperandCount(); ++i) { | 644 for (int i = 0; i < OperandCount(); ++i) { |
643 if (i > 0) os << " "; | 645 if (i > 0) os << " "; |
644 os << NameOf(OperandAt(i)); | 646 os << NameOf(OperandAt(i)); |
645 } | 647 } |
646 return os; | 648 return os; |
647 } | 649 } |
648 | 650 |
649 | 651 |
650 void HInstruction::Unlink() { | 652 void HInstruction::Unlink() { |
651 DCHECK(IsLinked()); | 653 DCHECK(IsLinked()); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 case HValue::kTypeof: | 907 case HValue::kTypeof: |
906 case HValue::kUnaryMathOperation: | 908 case HValue::kUnaryMathOperation: |
907 case HValue::kWrapReceiver: | 909 case HValue::kWrapReceiver: |
908 return true; | 910 return true; |
909 } | 911 } |
910 UNREACHABLE(); | 912 UNREACHABLE(); |
911 return true; | 913 return true; |
912 } | 914 } |
913 | 915 |
914 | 916 |
915 OStream& operator<<(OStream& os, const NameOf& v) { | 917 std::ostream& operator<<(std::ostream& os, const NameOf& v) { |
916 return os << v.value->representation().Mnemonic() << v.value->id(); | 918 return os << v.value->representation().Mnemonic() << v.value->id(); |
917 } | 919 } |
918 | 920 |
919 OStream& HDummyUse::PrintDataTo(OStream& os) const { // NOLINT | 921 std::ostream& HDummyUse::PrintDataTo(std::ostream& os) const { // NOLINT |
920 return os << NameOf(value()); | 922 return os << NameOf(value()); |
921 } | 923 } |
922 | 924 |
923 | 925 |
924 OStream& HEnvironmentMarker::PrintDataTo(OStream& os) const { // NOLINT | 926 std::ostream& HEnvironmentMarker::PrintDataTo( |
| 927 std::ostream& os) const { // NOLINT |
925 return os << (kind() == BIND ? "bind" : "lookup") << " var[" << index() | 928 return os << (kind() == BIND ? "bind" : "lookup") << " var[" << index() |
926 << "]"; | 929 << "]"; |
927 } | 930 } |
928 | 931 |
929 | 932 |
930 OStream& HUnaryCall::PrintDataTo(OStream& os) const { // NOLINT | 933 std::ostream& HUnaryCall::PrintDataTo(std::ostream& os) const { // NOLINT |
931 return os << NameOf(value()) << " #" << argument_count(); | 934 return os << NameOf(value()) << " #" << argument_count(); |
932 } | 935 } |
933 | 936 |
934 | 937 |
935 OStream& HCallJSFunction::PrintDataTo(OStream& os) const { // NOLINT | 938 std::ostream& HCallJSFunction::PrintDataTo(std::ostream& os) const { // NOLINT |
936 return os << NameOf(function()) << " #" << argument_count(); | 939 return os << NameOf(function()) << " #" << argument_count(); |
937 } | 940 } |
938 | 941 |
939 | 942 |
940 HCallJSFunction* HCallJSFunction::New( | 943 HCallJSFunction* HCallJSFunction::New( |
941 Zone* zone, | 944 Zone* zone, |
942 HValue* context, | 945 HValue* context, |
943 HValue* function, | 946 HValue* function, |
944 int argument_count, | 947 int argument_count, |
945 bool pass_argument_count) { | 948 bool pass_argument_count) { |
946 bool has_stack_check = false; | 949 bool has_stack_check = false; |
947 if (function->IsConstant()) { | 950 if (function->IsConstant()) { |
948 HConstant* fun_const = HConstant::cast(function); | 951 HConstant* fun_const = HConstant::cast(function); |
949 Handle<JSFunction> jsfun = | 952 Handle<JSFunction> jsfun = |
950 Handle<JSFunction>::cast(fun_const->handle(zone->isolate())); | 953 Handle<JSFunction>::cast(fun_const->handle(zone->isolate())); |
951 has_stack_check = !jsfun.is_null() && | 954 has_stack_check = !jsfun.is_null() && |
952 (jsfun->code()->kind() == Code::FUNCTION || | 955 (jsfun->code()->kind() == Code::FUNCTION || |
953 jsfun->code()->kind() == Code::OPTIMIZED_FUNCTION); | 956 jsfun->code()->kind() == Code::OPTIMIZED_FUNCTION); |
954 } | 957 } |
955 | 958 |
956 return new(zone) HCallJSFunction( | 959 return new(zone) HCallJSFunction( |
957 function, argument_count, pass_argument_count, | 960 function, argument_count, pass_argument_count, |
958 has_stack_check); | 961 has_stack_check); |
959 } | 962 } |
960 | 963 |
961 | 964 |
962 OStream& HBinaryCall::PrintDataTo(OStream& os) const { // NOLINT | 965 std::ostream& HBinaryCall::PrintDataTo(std::ostream& os) const { // NOLINT |
963 return os << NameOf(first()) << " " << NameOf(second()) << " #" | 966 return os << NameOf(first()) << " " << NameOf(second()) << " #" |
964 << argument_count(); | 967 << argument_count(); |
965 } | 968 } |
966 | 969 |
967 | 970 |
968 void HBoundsCheck::ApplyIndexChange() { | 971 void HBoundsCheck::ApplyIndexChange() { |
969 if (skip_check()) return; | 972 if (skip_check()) return; |
970 | 973 |
971 DecompositionResult decomposition; | 974 DecompositionResult decomposition; |
972 bool index_is_decomposable = index()->TryDecompose(&decomposition); | 975 bool index_is_decomposable = index()->TryDecompose(&decomposition); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 } | 1011 } |
1009 | 1012 |
1010 SetOperandAt(0, current_index); | 1013 SetOperandAt(0, current_index); |
1011 | 1014 |
1012 base_ = NULL; | 1015 base_ = NULL; |
1013 offset_ = 0; | 1016 offset_ = 0; |
1014 scale_ = 0; | 1017 scale_ = 0; |
1015 } | 1018 } |
1016 | 1019 |
1017 | 1020 |
1018 OStream& HBoundsCheck::PrintDataTo(OStream& os) const { // NOLINT | 1021 std::ostream& HBoundsCheck::PrintDataTo(std::ostream& os) const { // NOLINT |
1019 os << NameOf(index()) << " " << NameOf(length()); | 1022 os << NameOf(index()) << " " << NameOf(length()); |
1020 if (base() != NULL && (offset() != 0 || scale() != 0)) { | 1023 if (base() != NULL && (offset() != 0 || scale() != 0)) { |
1021 os << " base: (("; | 1024 os << " base: (("; |
1022 if (base() != index()) { | 1025 if (base() != index()) { |
1023 os << NameOf(index()); | 1026 os << NameOf(index()); |
1024 } else { | 1027 } else { |
1025 os << "index"; | 1028 os << "index"; |
1026 } | 1029 } |
1027 os << " + " << offset() << ") >> " << scale() << ")"; | 1030 os << " + " << offset() << ") >> " << scale() << ")"; |
1028 } | 1031 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 } | 1066 } |
1064 | 1067 |
1065 // In case of Smi representation, clamp result to Smi::kMaxValue. | 1068 // In case of Smi representation, clamp result to Smi::kMaxValue. |
1066 if (r.IsSmi()) result->ClampToSmi(); | 1069 if (r.IsSmi()) result->ClampToSmi(); |
1067 return result; | 1070 return result; |
1068 } | 1071 } |
1069 return HValue::InferRange(zone); | 1072 return HValue::InferRange(zone); |
1070 } | 1073 } |
1071 | 1074 |
1072 | 1075 |
1073 OStream& HBoundsCheckBaseIndexInformation::PrintDataTo( | 1076 std::ostream& HBoundsCheckBaseIndexInformation::PrintDataTo( |
1074 OStream& os) const { // NOLINT | 1077 std::ostream& os) const { // NOLINT |
1075 // TODO(svenpanne) This 2nd base_index() looks wrong... | 1078 // TODO(svenpanne) This 2nd base_index() looks wrong... |
1076 return os << "base: " << NameOf(base_index()) | 1079 return os << "base: " << NameOf(base_index()) |
1077 << ", check: " << NameOf(base_index()); | 1080 << ", check: " << NameOf(base_index()); |
1078 } | 1081 } |
1079 | 1082 |
1080 | 1083 |
1081 OStream& HCallWithDescriptor::PrintDataTo(OStream& os) const { // NOLINT | 1084 std::ostream& HCallWithDescriptor::PrintDataTo( |
| 1085 std::ostream& os) const { // NOLINT |
1082 for (int i = 0; i < OperandCount(); i++) { | 1086 for (int i = 0; i < OperandCount(); i++) { |
1083 os << NameOf(OperandAt(i)) << " "; | 1087 os << NameOf(OperandAt(i)) << " "; |
1084 } | 1088 } |
1085 return os << "#" << argument_count(); | 1089 return os << "#" << argument_count(); |
1086 } | 1090 } |
1087 | 1091 |
1088 | 1092 |
1089 OStream& HCallNewArray::PrintDataTo(OStream& os) const { // NOLINT | 1093 std::ostream& HCallNewArray::PrintDataTo(std::ostream& os) const { // NOLINT |
1090 os << ElementsKindToString(elements_kind()) << " "; | 1094 os << ElementsKindToString(elements_kind()) << " "; |
1091 return HBinaryCall::PrintDataTo(os); | 1095 return HBinaryCall::PrintDataTo(os); |
1092 } | 1096 } |
1093 | 1097 |
1094 | 1098 |
1095 OStream& HCallRuntime::PrintDataTo(OStream& os) const { // NOLINT | 1099 std::ostream& HCallRuntime::PrintDataTo(std::ostream& os) const { // NOLINT |
1096 os << name()->ToCString().get() << " "; | 1100 os << name()->ToCString().get() << " "; |
1097 if (save_doubles() == kSaveFPRegs) os << "[save doubles] "; | 1101 if (save_doubles() == kSaveFPRegs) os << "[save doubles] "; |
1098 return os << "#" << argument_count(); | 1102 return os << "#" << argument_count(); |
1099 } | 1103 } |
1100 | 1104 |
1101 | 1105 |
1102 OStream& HClassOfTestAndBranch::PrintDataTo(OStream& os) const { // NOLINT | 1106 std::ostream& HClassOfTestAndBranch::PrintDataTo( |
| 1107 std::ostream& os) const { // NOLINT |
1103 return os << "class_of_test(" << NameOf(value()) << ", \"" | 1108 return os << "class_of_test(" << NameOf(value()) << ", \"" |
1104 << class_name()->ToCString().get() << "\")"; | 1109 << class_name()->ToCString().get() << "\")"; |
1105 } | 1110 } |
1106 | 1111 |
1107 | 1112 |
1108 OStream& HWrapReceiver::PrintDataTo(OStream& os) const { // NOLINT | 1113 std::ostream& HWrapReceiver::PrintDataTo(std::ostream& os) const { // NOLINT |
1109 return os << NameOf(receiver()) << " " << NameOf(function()); | 1114 return os << NameOf(receiver()) << " " << NameOf(function()); |
1110 } | 1115 } |
1111 | 1116 |
1112 | 1117 |
1113 OStream& HAccessArgumentsAt::PrintDataTo(OStream& os) const { // NOLINT | 1118 std::ostream& HAccessArgumentsAt::PrintDataTo( |
| 1119 std::ostream& os) const { // NOLINT |
1114 return os << NameOf(arguments()) << "[" << NameOf(index()) << "], length " | 1120 return os << NameOf(arguments()) << "[" << NameOf(index()) << "], length " |
1115 << NameOf(length()); | 1121 << NameOf(length()); |
1116 } | 1122 } |
1117 | 1123 |
1118 | 1124 |
1119 OStream& HAllocateBlockContext::PrintDataTo(OStream& os) const { // NOLINT | 1125 std::ostream& HAllocateBlockContext::PrintDataTo( |
| 1126 std::ostream& os) const { // NOLINT |
1120 return os << NameOf(context()) << " " << NameOf(function()); | 1127 return os << NameOf(context()) << " " << NameOf(function()); |
1121 } | 1128 } |
1122 | 1129 |
1123 | 1130 |
1124 OStream& HControlInstruction::PrintDataTo(OStream& os) const { // NOLINT | 1131 std::ostream& HControlInstruction::PrintDataTo( |
| 1132 std::ostream& os) const { // NOLINT |
1125 os << " goto ("; | 1133 os << " goto ("; |
1126 bool first_block = true; | 1134 bool first_block = true; |
1127 for (HSuccessorIterator it(this); !it.Done(); it.Advance()) { | 1135 for (HSuccessorIterator it(this); !it.Done(); it.Advance()) { |
1128 if (!first_block) os << ", "; | 1136 if (!first_block) os << ", "; |
1129 os << *it.Current(); | 1137 os << *it.Current(); |
1130 first_block = false; | 1138 first_block = false; |
1131 } | 1139 } |
1132 return os << ")"; | 1140 return os << ")"; |
1133 } | 1141 } |
1134 | 1142 |
1135 | 1143 |
1136 OStream& HUnaryControlInstruction::PrintDataTo(OStream& os) const { // NOLINT | 1144 std::ostream& HUnaryControlInstruction::PrintDataTo( |
| 1145 std::ostream& os) const { // NOLINT |
1137 os << NameOf(value()); | 1146 os << NameOf(value()); |
1138 return HControlInstruction::PrintDataTo(os); | 1147 return HControlInstruction::PrintDataTo(os); |
1139 } | 1148 } |
1140 | 1149 |
1141 | 1150 |
1142 OStream& HReturn::PrintDataTo(OStream& os) const { // NOLINT | 1151 std::ostream& HReturn::PrintDataTo(std::ostream& os) const { // NOLINT |
1143 return os << NameOf(value()) << " (pop " << NameOf(parameter_count()) | 1152 return os << NameOf(value()) << " (pop " << NameOf(parameter_count()) |
1144 << " values)"; | 1153 << " values)"; |
1145 } | 1154 } |
1146 | 1155 |
1147 | 1156 |
1148 Representation HBranch::observed_input_representation(int index) { | 1157 Representation HBranch::observed_input_representation(int index) { |
1149 static const ToBooleanStub::Types tagged_types( | 1158 static const ToBooleanStub::Types tagged_types( |
1150 ToBooleanStub::NULL_TYPE | | 1159 ToBooleanStub::NULL_TYPE | |
1151 ToBooleanStub::SPEC_OBJECT | | 1160 ToBooleanStub::SPEC_OBJECT | |
1152 ToBooleanStub::STRING | | 1161 ToBooleanStub::STRING | |
(...skipping 25 matching lines...) Expand all Loading... |
1178 *block = HConstant::cast(value)->BooleanValue() | 1187 *block = HConstant::cast(value)->BooleanValue() |
1179 ? FirstSuccessor() | 1188 ? FirstSuccessor() |
1180 : SecondSuccessor(); | 1189 : SecondSuccessor(); |
1181 return true; | 1190 return true; |
1182 } | 1191 } |
1183 *block = NULL; | 1192 *block = NULL; |
1184 return false; | 1193 return false; |
1185 } | 1194 } |
1186 | 1195 |
1187 | 1196 |
1188 OStream& HBranch::PrintDataTo(OStream& os) const { // NOLINT | 1197 std::ostream& HBranch::PrintDataTo(std::ostream& os) const { // NOLINT |
1189 return HUnaryControlInstruction::PrintDataTo(os) << " " | 1198 return HUnaryControlInstruction::PrintDataTo(os) << " " |
1190 << expected_input_types(); | 1199 << expected_input_types(); |
1191 } | 1200 } |
1192 | 1201 |
1193 | 1202 |
1194 OStream& HCompareMap::PrintDataTo(OStream& os) const { // NOLINT | 1203 std::ostream& HCompareMap::PrintDataTo(std::ostream& os) const { // NOLINT |
1195 os << NameOf(value()) << " (" << *map().handle() << ")"; | 1204 os << NameOf(value()) << " (" << *map().handle() << ")"; |
1196 HControlInstruction::PrintDataTo(os); | 1205 HControlInstruction::PrintDataTo(os); |
1197 if (known_successor_index() == 0) { | 1206 if (known_successor_index() == 0) { |
1198 os << " [true]"; | 1207 os << " [true]"; |
1199 } else if (known_successor_index() == 1) { | 1208 } else if (known_successor_index() == 1) { |
1200 os << " [false]"; | 1209 os << " [false]"; |
1201 } | 1210 } |
1202 return os; | 1211 return os; |
1203 } | 1212 } |
1204 | 1213 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 // In case of Smi representation, clamp Math.abs(Smi::kMinValue) to | 1257 // In case of Smi representation, clamp Math.abs(Smi::kMinValue) to |
1249 // Smi::kMaxValue. | 1258 // Smi::kMaxValue. |
1250 if (r.IsSmi()) result->ClampToSmi(); | 1259 if (r.IsSmi()) result->ClampToSmi(); |
1251 return result; | 1260 return result; |
1252 } | 1261 } |
1253 } | 1262 } |
1254 return HValue::InferRange(zone); | 1263 return HValue::InferRange(zone); |
1255 } | 1264 } |
1256 | 1265 |
1257 | 1266 |
1258 OStream& HUnaryMathOperation::PrintDataTo(OStream& os) const { // NOLINT | 1267 std::ostream& HUnaryMathOperation::PrintDataTo( |
| 1268 std::ostream& os) const { // NOLINT |
1259 return os << OpName() << " " << NameOf(value()); | 1269 return os << OpName() << " " << NameOf(value()); |
1260 } | 1270 } |
1261 | 1271 |
1262 | 1272 |
1263 OStream& HUnaryOperation::PrintDataTo(OStream& os) const { // NOLINT | 1273 std::ostream& HUnaryOperation::PrintDataTo(std::ostream& os) const { // NOLINT |
1264 return os << NameOf(value()); | 1274 return os << NameOf(value()); |
1265 } | 1275 } |
1266 | 1276 |
1267 | 1277 |
1268 OStream& HHasInstanceTypeAndBranch::PrintDataTo(OStream& os) const { // NOLINT | 1278 std::ostream& HHasInstanceTypeAndBranch::PrintDataTo( |
| 1279 std::ostream& os) const { // NOLINT |
1269 os << NameOf(value()); | 1280 os << NameOf(value()); |
1270 switch (from_) { | 1281 switch (from_) { |
1271 case FIRST_JS_RECEIVER_TYPE: | 1282 case FIRST_JS_RECEIVER_TYPE: |
1272 if (to_ == LAST_TYPE) os << " spec_object"; | 1283 if (to_ == LAST_TYPE) os << " spec_object"; |
1273 break; | 1284 break; |
1274 case JS_REGEXP_TYPE: | 1285 case JS_REGEXP_TYPE: |
1275 if (to_ == JS_REGEXP_TYPE) os << " reg_exp"; | 1286 if (to_ == JS_REGEXP_TYPE) os << " reg_exp"; |
1276 break; | 1287 break; |
1277 case JS_ARRAY_TYPE: | 1288 case JS_ARRAY_TYPE: |
1278 if (to_ == JS_ARRAY_TYPE) os << " array"; | 1289 if (to_ == JS_ARRAY_TYPE) os << " array"; |
1279 break; | 1290 break; |
1280 case JS_FUNCTION_TYPE: | 1291 case JS_FUNCTION_TYPE: |
1281 if (to_ == JS_FUNCTION_TYPE) os << " function"; | 1292 if (to_ == JS_FUNCTION_TYPE) os << " function"; |
1282 break; | 1293 break; |
1283 default: | 1294 default: |
1284 break; | 1295 break; |
1285 } | 1296 } |
1286 return os; | 1297 return os; |
1287 } | 1298 } |
1288 | 1299 |
1289 | 1300 |
1290 OStream& HTypeofIsAndBranch::PrintDataTo(OStream& os) const { // NOLINT | 1301 std::ostream& HTypeofIsAndBranch::PrintDataTo( |
| 1302 std::ostream& os) const { // NOLINT |
1291 os << NameOf(value()) << " == " << type_literal()->ToCString().get(); | 1303 os << NameOf(value()) << " == " << type_literal()->ToCString().get(); |
1292 return HControlInstruction::PrintDataTo(os); | 1304 return HControlInstruction::PrintDataTo(os); |
1293 } | 1305 } |
1294 | 1306 |
1295 | 1307 |
1296 static String* TypeOfString(HConstant* constant, Isolate* isolate) { | 1308 static String* TypeOfString(HConstant* constant, Isolate* isolate) { |
1297 Heap* heap = isolate->heap(); | 1309 Heap* heap = isolate->heap(); |
1298 if (constant->HasNumberValue()) return heap->number_string(); | 1310 if (constant->HasNumberValue()) return heap->number_string(); |
1299 if (constant->IsUndetectable()) return heap->undefined_string(); | 1311 if (constant->IsUndetectable()) return heap->undefined_string(); |
1300 if (constant->HasStringValue()) return heap->string_string(); | 1312 if (constant->HasStringValue()) return heap->string_string(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 bool number_type = | 1345 bool number_type = |
1334 type_literal_.IsKnownGlobal(isolate()->heap()->number_string()); | 1346 type_literal_.IsKnownGlobal(isolate()->heap()->number_string()); |
1335 *block = number_type ? FirstSuccessor() : SecondSuccessor(); | 1347 *block = number_type ? FirstSuccessor() : SecondSuccessor(); |
1336 return true; | 1348 return true; |
1337 } | 1349 } |
1338 *block = NULL; | 1350 *block = NULL; |
1339 return false; | 1351 return false; |
1340 } | 1352 } |
1341 | 1353 |
1342 | 1354 |
1343 OStream& HCheckMapValue::PrintDataTo(OStream& os) const { // NOLINT | 1355 std::ostream& HCheckMapValue::PrintDataTo(std::ostream& os) const { // NOLINT |
1344 return os << NameOf(value()) << " " << NameOf(map()); | 1356 return os << NameOf(value()) << " " << NameOf(map()); |
1345 } | 1357 } |
1346 | 1358 |
1347 | 1359 |
1348 HValue* HCheckMapValue::Canonicalize() { | 1360 HValue* HCheckMapValue::Canonicalize() { |
1349 if (map()->IsConstant()) { | 1361 if (map()->IsConstant()) { |
1350 HConstant* c_map = HConstant::cast(map()); | 1362 HConstant* c_map = HConstant::cast(map()); |
1351 return HCheckMaps::CreateAndInsertAfter( | 1363 return HCheckMaps::CreateAndInsertAfter( |
1352 block()->graph()->zone(), value(), c_map->MapValue(), | 1364 block()->graph()->zone(), value(), c_map->MapValue(), |
1353 c_map->HasStableMapValue(), this); | 1365 c_map->HasStableMapValue(), this); |
1354 } | 1366 } |
1355 return this; | 1367 return this; |
1356 } | 1368 } |
1357 | 1369 |
1358 | 1370 |
1359 OStream& HForInPrepareMap::PrintDataTo(OStream& os) const { // NOLINT | 1371 std::ostream& HForInPrepareMap::PrintDataTo(std::ostream& os) const { // NOLINT |
1360 return os << NameOf(enumerable()); | 1372 return os << NameOf(enumerable()); |
1361 } | 1373 } |
1362 | 1374 |
1363 | 1375 |
1364 OStream& HForInCacheArray::PrintDataTo(OStream& os) const { // NOLINT | 1376 std::ostream& HForInCacheArray::PrintDataTo(std::ostream& os) const { // NOLINT |
1365 return os << NameOf(enumerable()) << " " << NameOf(map()) << "[" << idx_ | 1377 return os << NameOf(enumerable()) << " " << NameOf(map()) << "[" << idx_ |
1366 << "]"; | 1378 << "]"; |
1367 } | 1379 } |
1368 | 1380 |
1369 | 1381 |
1370 OStream& HLoadFieldByIndex::PrintDataTo(OStream& os) const { // NOLINT | 1382 std::ostream& HLoadFieldByIndex::PrintDataTo( |
| 1383 std::ostream& os) const { // NOLINT |
1371 return os << NameOf(object()) << " " << NameOf(index()); | 1384 return os << NameOf(object()) << " " << NameOf(index()); |
1372 } | 1385 } |
1373 | 1386 |
1374 | 1387 |
1375 static bool MatchLeftIsOnes(HValue* l, HValue* r, HValue** negated) { | 1388 static bool MatchLeftIsOnes(HValue* l, HValue* r, HValue** negated) { |
1376 if (!l->EqualsInteger32Constant(~0)) return false; | 1389 if (!l->EqualsInteger32Constant(~0)) return false; |
1377 *negated = r; | 1390 *negated = r; |
1378 return true; | 1391 return true; |
1379 } | 1392 } |
1380 | 1393 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 | 1510 |
1498 HValue* HWrapReceiver::Canonicalize() { | 1511 HValue* HWrapReceiver::Canonicalize() { |
1499 if (HasNoUses()) return NULL; | 1512 if (HasNoUses()) return NULL; |
1500 if (receiver()->type().IsJSObject()) { | 1513 if (receiver()->type().IsJSObject()) { |
1501 return receiver(); | 1514 return receiver(); |
1502 } | 1515 } |
1503 return this; | 1516 return this; |
1504 } | 1517 } |
1505 | 1518 |
1506 | 1519 |
1507 OStream& HTypeof::PrintDataTo(OStream& os) const { // NOLINT | 1520 std::ostream& HTypeof::PrintDataTo(std::ostream& os) const { // NOLINT |
1508 return os << NameOf(value()); | 1521 return os << NameOf(value()); |
1509 } | 1522 } |
1510 | 1523 |
1511 | 1524 |
1512 HInstruction* HForceRepresentation::New(Zone* zone, HValue* context, | 1525 HInstruction* HForceRepresentation::New(Zone* zone, HValue* context, |
1513 HValue* value, Representation representation) { | 1526 HValue* value, Representation representation) { |
1514 if (FLAG_fold_constants && value->IsConstant()) { | 1527 if (FLAG_fold_constants && value->IsConstant()) { |
1515 HConstant* c = HConstant::cast(value); | 1528 HConstant* c = HConstant::cast(value); |
1516 c = c->CopyToRepresentation(representation, zone); | 1529 c = c->CopyToRepresentation(representation, zone); |
1517 if (c != NULL) return c; | 1530 if (c != NULL) return c; |
1518 } | 1531 } |
1519 return new(zone) HForceRepresentation(value, representation); | 1532 return new(zone) HForceRepresentation(value, representation); |
1520 } | 1533 } |
1521 | 1534 |
1522 | 1535 |
1523 OStream& HForceRepresentation::PrintDataTo(OStream& os) const { // NOLINT | 1536 std::ostream& HForceRepresentation::PrintDataTo( |
| 1537 std::ostream& os) const { // NOLINT |
1524 return os << representation().Mnemonic() << " " << NameOf(value()); | 1538 return os << representation().Mnemonic() << " " << NameOf(value()); |
1525 } | 1539 } |
1526 | 1540 |
1527 | 1541 |
1528 OStream& HChange::PrintDataTo(OStream& os) const { // NOLINT | 1542 std::ostream& HChange::PrintDataTo(std::ostream& os) const { // NOLINT |
1529 HUnaryOperation::PrintDataTo(os); | 1543 HUnaryOperation::PrintDataTo(os); |
1530 os << " " << from().Mnemonic() << " to " << to().Mnemonic(); | 1544 os << " " << from().Mnemonic() << " to " << to().Mnemonic(); |
1531 | 1545 |
1532 if (CanTruncateToSmi()) os << " truncating-smi"; | 1546 if (CanTruncateToSmi()) os << " truncating-smi"; |
1533 if (CanTruncateToInt32()) os << " truncating-int32"; | 1547 if (CanTruncateToInt32()) os << " truncating-int32"; |
1534 if (CheckFlag(kBailoutOnMinusZero)) os << " -0?"; | 1548 if (CheckFlag(kBailoutOnMinusZero)) os << " -0?"; |
1535 if (CheckFlag(kAllowUndefinedAsNaN)) os << " allow-undefined-as-nan"; | 1549 if (CheckFlag(kAllowUndefinedAsNaN)) os << " allow-undefined-as-nan"; |
1536 return os; | 1550 return os; |
1537 } | 1551 } |
1538 | 1552 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 case IS_INTERNALIZED_STRING: | 1644 case IS_INTERNALIZED_STRING: |
1631 *mask = kIsNotStringMask | kIsNotInternalizedMask; | 1645 *mask = kIsNotStringMask | kIsNotInternalizedMask; |
1632 *tag = kInternalizedTag; | 1646 *tag = kInternalizedTag; |
1633 return; | 1647 return; |
1634 default: | 1648 default: |
1635 UNREACHABLE(); | 1649 UNREACHABLE(); |
1636 } | 1650 } |
1637 } | 1651 } |
1638 | 1652 |
1639 | 1653 |
1640 OStream& HCheckMaps::PrintDataTo(OStream& os) const { // NOLINT | 1654 std::ostream& HCheckMaps::PrintDataTo(std::ostream& os) const { // NOLINT |
1641 os << NameOf(value()) << " [" << *maps()->at(0).handle(); | 1655 os << NameOf(value()) << " [" << *maps()->at(0).handle(); |
1642 for (int i = 1; i < maps()->size(); ++i) { | 1656 for (int i = 1; i < maps()->size(); ++i) { |
1643 os << "," << *maps()->at(i).handle(); | 1657 os << "," << *maps()->at(i).handle(); |
1644 } | 1658 } |
1645 os << "]"; | 1659 os << "]"; |
1646 if (IsStabilityCheck()) os << "(stability-check)"; | 1660 if (IsStabilityCheck()) os << "(stability-check)"; |
1647 return os; | 1661 return os; |
1648 } | 1662 } |
1649 | 1663 |
1650 | 1664 |
(...skipping 10 matching lines...) Expand all Loading... |
1661 MarkAsStabilityCheck(); | 1675 MarkAsStabilityCheck(); |
1662 break; | 1676 break; |
1663 } | 1677 } |
1664 } | 1678 } |
1665 } | 1679 } |
1666 } | 1680 } |
1667 return this; | 1681 return this; |
1668 } | 1682 } |
1669 | 1683 |
1670 | 1684 |
1671 OStream& HCheckValue::PrintDataTo(OStream& os) const { // NOLINT | 1685 std::ostream& HCheckValue::PrintDataTo(std::ostream& os) const { // NOLINT |
1672 return os << NameOf(value()) << " " << Brief(*object().handle()); | 1686 return os << NameOf(value()) << " " << Brief(*object().handle()); |
1673 } | 1687 } |
1674 | 1688 |
1675 | 1689 |
1676 HValue* HCheckValue::Canonicalize() { | 1690 HValue* HCheckValue::Canonicalize() { |
1677 return (value()->IsConstant() && | 1691 return (value()->IsConstant() && |
1678 HConstant::cast(value())->EqualsUnique(object_)) ? NULL : this; | 1692 HConstant::cast(value())->EqualsUnique(object_)) ? NULL : this; |
1679 } | 1693 } |
1680 | 1694 |
1681 | 1695 |
1682 const char* HCheckInstanceType::GetCheckName() const { | 1696 const char* HCheckInstanceType::GetCheckName() const { |
1683 switch (check_) { | 1697 switch (check_) { |
1684 case IS_SPEC_OBJECT: return "object"; | 1698 case IS_SPEC_OBJECT: return "object"; |
1685 case IS_JS_ARRAY: return "array"; | 1699 case IS_JS_ARRAY: return "array"; |
1686 case IS_STRING: return "string"; | 1700 case IS_STRING: return "string"; |
1687 case IS_INTERNALIZED_STRING: return "internalized_string"; | 1701 case IS_INTERNALIZED_STRING: return "internalized_string"; |
1688 } | 1702 } |
1689 UNREACHABLE(); | 1703 UNREACHABLE(); |
1690 return ""; | 1704 return ""; |
1691 } | 1705 } |
1692 | 1706 |
1693 | 1707 |
1694 OStream& HCheckInstanceType::PrintDataTo(OStream& os) const { // NOLINT | 1708 std::ostream& HCheckInstanceType::PrintDataTo( |
| 1709 std::ostream& os) const { // NOLINT |
1695 os << GetCheckName() << " "; | 1710 os << GetCheckName() << " "; |
1696 return HUnaryOperation::PrintDataTo(os); | 1711 return HUnaryOperation::PrintDataTo(os); |
1697 } | 1712 } |
1698 | 1713 |
1699 | 1714 |
1700 OStream& HCallStub::PrintDataTo(OStream& os) const { // NOLINT | 1715 std::ostream& HCallStub::PrintDataTo(std::ostream& os) const { // NOLINT |
1701 os << CodeStub::MajorName(major_key_, false) << " "; | 1716 os << CodeStub::MajorName(major_key_, false) << " "; |
1702 return HUnaryCall::PrintDataTo(os); | 1717 return HUnaryCall::PrintDataTo(os); |
1703 } | 1718 } |
1704 | 1719 |
1705 | 1720 |
1706 OStream& HTailCallThroughMegamorphicCache::PrintDataTo( | 1721 std::ostream& HTailCallThroughMegamorphicCache::PrintDataTo( |
1707 OStream& os) const { // NOLINT | 1722 std::ostream& os) const { // NOLINT |
1708 for (int i = 0; i < OperandCount(); i++) { | 1723 for (int i = 0; i < OperandCount(); i++) { |
1709 os << NameOf(OperandAt(i)) << " "; | 1724 os << NameOf(OperandAt(i)) << " "; |
1710 } | 1725 } |
1711 return os << "flags: " << flags(); | 1726 return os << "flags: " << flags(); |
1712 } | 1727 } |
1713 | 1728 |
1714 | 1729 |
1715 OStream& HUnknownOSRValue::PrintDataTo(OStream& os) const { // NOLINT | 1730 std::ostream& HUnknownOSRValue::PrintDataTo(std::ostream& os) const { // NOLINT |
1716 const char* type = "expression"; | 1731 const char* type = "expression"; |
1717 if (environment_->is_local_index(index_)) type = "local"; | 1732 if (environment_->is_local_index(index_)) type = "local"; |
1718 if (environment_->is_special_index(index_)) type = "special"; | 1733 if (environment_->is_special_index(index_)) type = "special"; |
1719 if (environment_->is_parameter_index(index_)) type = "parameter"; | 1734 if (environment_->is_parameter_index(index_)) type = "parameter"; |
1720 return os << type << " @ " << index_; | 1735 return os << type << " @ " << index_; |
1721 } | 1736 } |
1722 | 1737 |
1723 | 1738 |
1724 OStream& HInstanceOf::PrintDataTo(OStream& os) const { // NOLINT | 1739 std::ostream& HInstanceOf::PrintDataTo(std::ostream& os) const { // NOLINT |
1725 return os << NameOf(left()) << " " << NameOf(right()) << " " | 1740 return os << NameOf(left()) << " " << NameOf(right()) << " " |
1726 << NameOf(context()); | 1741 << NameOf(context()); |
1727 } | 1742 } |
1728 | 1743 |
1729 | 1744 |
1730 Range* HValue::InferRange(Zone* zone) { | 1745 Range* HValue::InferRange(Zone* zone) { |
1731 Range* result; | 1746 Range* result; |
1732 if (representation().IsSmi() || type().IsSmi()) { | 1747 if (representation().IsSmi() || type().IsSmi()) { |
1733 result = new(zone) Range(Smi::kMinValue, Smi::kMaxValue); | 1748 result = new(zone) Range(Smi::kMinValue, Smi::kMaxValue); |
1734 result->set_can_be_minus_zero(false); | 1749 result->set_can_be_minus_zero(false); |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2432 } | 2447 } |
2433 } | 2448 } |
2434 | 2449 |
2435 | 2450 |
2436 void HPushArguments::AddInput(HValue* value) { | 2451 void HPushArguments::AddInput(HValue* value) { |
2437 inputs_.Add(NULL, value->block()->zone()); | 2452 inputs_.Add(NULL, value->block()->zone()); |
2438 SetOperandAt(OperandCount() - 1, value); | 2453 SetOperandAt(OperandCount() - 1, value); |
2439 } | 2454 } |
2440 | 2455 |
2441 | 2456 |
2442 OStream& HPhi::PrintTo(OStream& os) const { // NOLINT | 2457 std::ostream& HPhi::PrintTo(std::ostream& os) const { // NOLINT |
2443 os << "["; | 2458 os << "["; |
2444 for (int i = 0; i < OperandCount(); ++i) { | 2459 for (int i = 0; i < OperandCount(); ++i) { |
2445 os << " " << NameOf(OperandAt(i)) << " "; | 2460 os << " " << NameOf(OperandAt(i)) << " "; |
2446 } | 2461 } |
2447 return os << " uses:" << UseCount() << "_" | 2462 return os << " uses:" << UseCount() << "_" |
2448 << smi_non_phi_uses() + smi_indirect_uses() << "s_" | 2463 << smi_non_phi_uses() + smi_indirect_uses() << "s_" |
2449 << int32_non_phi_uses() + int32_indirect_uses() << "i_" | 2464 << int32_non_phi_uses() + int32_indirect_uses() << "i_" |
2450 << double_non_phi_uses() + double_indirect_uses() << "d_" | 2465 << double_non_phi_uses() + double_indirect_uses() << "d_" |
2451 << tagged_non_phi_uses() + tagged_indirect_uses() << "t" | 2466 << tagged_non_phi_uses() + tagged_indirect_uses() << "t" |
2452 << TypeOf(this) << "]"; | 2467 << TypeOf(this) << "]"; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2564 AddPushedValue(from_values->at(i)); | 2579 AddPushedValue(from_values->at(i)); |
2565 } | 2580 } |
2566 } | 2581 } |
2567 } | 2582 } |
2568 pop_count_ += from->pop_count_; | 2583 pop_count_ += from->pop_count_; |
2569 from->DeleteAndReplaceWith(NULL); | 2584 from->DeleteAndReplaceWith(NULL); |
2570 } | 2585 } |
2571 } | 2586 } |
2572 | 2587 |
2573 | 2588 |
2574 OStream& HSimulate::PrintDataTo(OStream& os) const { // NOLINT | 2589 std::ostream& HSimulate::PrintDataTo(std::ostream& os) const { // NOLINT |
2575 os << "id=" << ast_id().ToInt(); | 2590 os << "id=" << ast_id().ToInt(); |
2576 if (pop_count_ > 0) os << " pop " << pop_count_; | 2591 if (pop_count_ > 0) os << " pop " << pop_count_; |
2577 if (values_.length() > 0) { | 2592 if (values_.length() > 0) { |
2578 if (pop_count_ > 0) os << " /"; | 2593 if (pop_count_ > 0) os << " /"; |
2579 for (int i = values_.length() - 1; i >= 0; --i) { | 2594 for (int i = values_.length() - 1; i >= 0; --i) { |
2580 if (HasAssignedIndexAt(i)) { | 2595 if (HasAssignedIndexAt(i)) { |
2581 os << " var[" << GetAssignedIndexAt(i) << "] = "; | 2596 os << " var[" << GetAssignedIndexAt(i) << "] = "; |
2582 } else { | 2597 } else { |
2583 os << " push "; | 2598 os << " push "; |
2584 } | 2599 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2626 // same capture id in the current and all outer environments. | 2641 // same capture id in the current and all outer environments. |
2627 void HCapturedObject::ReplayEnvironment(HEnvironment* env) { | 2642 void HCapturedObject::ReplayEnvironment(HEnvironment* env) { |
2628 DCHECK(env != NULL); | 2643 DCHECK(env != NULL); |
2629 while (env != NULL) { | 2644 while (env != NULL) { |
2630 ReplayEnvironmentNested(env->values(), this); | 2645 ReplayEnvironmentNested(env->values(), this); |
2631 env = env->outer(); | 2646 env = env->outer(); |
2632 } | 2647 } |
2633 } | 2648 } |
2634 | 2649 |
2635 | 2650 |
2636 OStream& HCapturedObject::PrintDataTo(OStream& os) const { // NOLINT | 2651 std::ostream& HCapturedObject::PrintDataTo(std::ostream& os) const { // NOLINT |
2637 os << "#" << capture_id() << " "; | 2652 os << "#" << capture_id() << " "; |
2638 return HDematerializedObject::PrintDataTo(os); | 2653 return HDematerializedObject::PrintDataTo(os); |
2639 } | 2654 } |
2640 | 2655 |
2641 | 2656 |
2642 void HEnterInlined::RegisterReturnTarget(HBasicBlock* return_target, | 2657 void HEnterInlined::RegisterReturnTarget(HBasicBlock* return_target, |
2643 Zone* zone) { | 2658 Zone* zone) { |
2644 DCHECK(return_target->IsInlineReturnTarget()); | 2659 DCHECK(return_target->IsInlineReturnTarget()); |
2645 return_targets_.Add(return_target, zone); | 2660 return_targets_.Add(return_target, zone); |
2646 } | 2661 } |
2647 | 2662 |
2648 | 2663 |
2649 OStream& HEnterInlined::PrintDataTo(OStream& os) const { // NOLINT | 2664 std::ostream& HEnterInlined::PrintDataTo(std::ostream& os) const { // NOLINT |
2650 return os << function()->debug_name()->ToCString().get() | 2665 return os << function()->debug_name()->ToCString().get() |
2651 << ", id=" << function()->id().ToInt(); | 2666 << ", id=" << function()->id().ToInt(); |
2652 } | 2667 } |
2653 | 2668 |
2654 | 2669 |
2655 static bool IsInteger32(double value) { | 2670 static bool IsInteger32(double value) { |
2656 double roundtrip_value = static_cast<double>(static_cast<int32_t>(value)); | 2671 double roundtrip_value = static_cast<double>(static_cast<int32_t>(value)); |
2657 return bit_cast<int64_t>(roundtrip_value) == bit_cast<int64_t>(value); | 2672 return bit_cast<int64_t>(roundtrip_value) == bit_cast<int64_t>(value); |
2658 } | 2673 } |
2659 | 2674 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2929 new(zone) HConstant(1) : new(zone) HConstant(0); | 2944 new(zone) HConstant(1) : new(zone) HConstant(0); |
2930 } else if (handle->IsUndefined()) { | 2945 } else if (handle->IsUndefined()) { |
2931 res = new(zone) HConstant(base::OS::nan_value()); | 2946 res = new(zone) HConstant(base::OS::nan_value()); |
2932 } else if (handle->IsNull()) { | 2947 } else if (handle->IsNull()) { |
2933 res = new(zone) HConstant(0); | 2948 res = new(zone) HConstant(0); |
2934 } | 2949 } |
2935 return Maybe<HConstant*>(res != NULL, res); | 2950 return Maybe<HConstant*>(res != NULL, res); |
2936 } | 2951 } |
2937 | 2952 |
2938 | 2953 |
2939 OStream& HConstant::PrintDataTo(OStream& os) const { // NOLINT | 2954 std::ostream& HConstant::PrintDataTo(std::ostream& os) const { // NOLINT |
2940 if (has_int32_value_) { | 2955 if (has_int32_value_) { |
2941 os << int32_value_ << " "; | 2956 os << int32_value_ << " "; |
2942 } else if (has_double_value_) { | 2957 } else if (has_double_value_) { |
2943 os << double_value_ << " "; | 2958 os << double_value_ << " "; |
2944 } else if (has_external_reference_value_) { | 2959 } else if (has_external_reference_value_) { |
2945 os << reinterpret_cast<void*>(external_reference_value_.address()) << " "; | 2960 os << reinterpret_cast<void*>(external_reference_value_.address()) << " "; |
2946 } else { | 2961 } else { |
2947 // The handle() method is silently and lazily mutating the object. | 2962 // The handle() method is silently and lazily mutating the object. |
2948 Handle<Object> h = const_cast<HConstant*>(this)->handle(Isolate::Current()); | 2963 Handle<Object> h = const_cast<HConstant*>(this)->handle(Isolate::Current()); |
2949 os << Brief(*h) << " "; | 2964 os << Brief(*h) << " "; |
2950 if (HasStableMapValue()) os << "[stable-map] "; | 2965 if (HasStableMapValue()) os << "[stable-map] "; |
2951 if (HasObjectMap()) os << "[map " << *ObjectMap().handle() << "] "; | 2966 if (HasObjectMap()) os << "[map " << *ObjectMap().handle() << "] "; |
2952 } | 2967 } |
2953 if (!is_not_in_new_space_) os << "[new space] "; | 2968 if (!is_not_in_new_space_) os << "[new space] "; |
2954 return os; | 2969 return os; |
2955 } | 2970 } |
2956 | 2971 |
2957 | 2972 |
2958 OStream& HBinaryOperation::PrintDataTo(OStream& os) const { // NOLINT | 2973 std::ostream& HBinaryOperation::PrintDataTo(std::ostream& os) const { // NOLINT |
2959 os << NameOf(left()) << " " << NameOf(right()); | 2974 os << NameOf(left()) << " " << NameOf(right()); |
2960 if (CheckFlag(kCanOverflow)) os << " !"; | 2975 if (CheckFlag(kCanOverflow)) os << " !"; |
2961 if (CheckFlag(kBailoutOnMinusZero)) os << " -0?"; | 2976 if (CheckFlag(kBailoutOnMinusZero)) os << " -0?"; |
2962 return os; | 2977 return os; |
2963 } | 2978 } |
2964 | 2979 |
2965 | 2980 |
2966 void HBinaryOperation::InferRepresentation(HInferRepresentationPhase* h_infer) { | 2981 void HBinaryOperation::InferRepresentation(HInferRepresentationPhase* h_infer) { |
2967 DCHECK(CheckFlag(kFlexibleRepresentation)); | 2982 DCHECK(CheckFlag(kFlexibleRepresentation)); |
2968 Representation new_rep = RepresentationFromInputs(); | 2983 Representation new_rep = RepresentationFromInputs(); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3175 case EXTERNAL_INT16_ELEMENTS: | 3190 case EXTERNAL_INT16_ELEMENTS: |
3176 return new(zone) Range(kMinInt16, kMaxInt16); | 3191 return new(zone) Range(kMinInt16, kMaxInt16); |
3177 case EXTERNAL_UINT16_ELEMENTS: | 3192 case EXTERNAL_UINT16_ELEMENTS: |
3178 return new(zone) Range(kMinUInt16, kMaxUInt16); | 3193 return new(zone) Range(kMinUInt16, kMaxUInt16); |
3179 default: | 3194 default: |
3180 return HValue::InferRange(zone); | 3195 return HValue::InferRange(zone); |
3181 } | 3196 } |
3182 } | 3197 } |
3183 | 3198 |
3184 | 3199 |
3185 OStream& HCompareGeneric::PrintDataTo(OStream& os) const { // NOLINT | 3200 std::ostream& HCompareGeneric::PrintDataTo(std::ostream& os) const { // NOLINT |
3186 os << Token::Name(token()) << " "; | 3201 os << Token::Name(token()) << " "; |
3187 return HBinaryOperation::PrintDataTo(os); | 3202 return HBinaryOperation::PrintDataTo(os); |
3188 } | 3203 } |
3189 | 3204 |
3190 | 3205 |
3191 OStream& HStringCompareAndBranch::PrintDataTo(OStream& os) const { // NOLINT | 3206 std::ostream& HStringCompareAndBranch::PrintDataTo( |
| 3207 std::ostream& os) const { // NOLINT |
3192 os << Token::Name(token()) << " "; | 3208 os << Token::Name(token()) << " "; |
3193 return HControlInstruction::PrintDataTo(os); | 3209 return HControlInstruction::PrintDataTo(os); |
3194 } | 3210 } |
3195 | 3211 |
3196 | 3212 |
3197 OStream& HCompareNumericAndBranch::PrintDataTo(OStream& os) const { // NOLINT | 3213 std::ostream& HCompareNumericAndBranch::PrintDataTo( |
| 3214 std::ostream& os) const { // NOLINT |
3198 os << Token::Name(token()) << " " << NameOf(left()) << " " << NameOf(right()); | 3215 os << Token::Name(token()) << " " << NameOf(left()) << " " << NameOf(right()); |
3199 return HControlInstruction::PrintDataTo(os); | 3216 return HControlInstruction::PrintDataTo(os); |
3200 } | 3217 } |
3201 | 3218 |
3202 | 3219 |
3203 OStream& HCompareObjectEqAndBranch::PrintDataTo(OStream& os) const { // NOLINT | 3220 std::ostream& HCompareObjectEqAndBranch::PrintDataTo( |
| 3221 std::ostream& os) const { // NOLINT |
3204 os << NameOf(left()) << " " << NameOf(right()); | 3222 os << NameOf(left()) << " " << NameOf(right()); |
3205 return HControlInstruction::PrintDataTo(os); | 3223 return HControlInstruction::PrintDataTo(os); |
3206 } | 3224 } |
3207 | 3225 |
3208 | 3226 |
3209 bool HCompareObjectEqAndBranch::KnownSuccessorBlock(HBasicBlock** block) { | 3227 bool HCompareObjectEqAndBranch::KnownSuccessorBlock(HBasicBlock** block) { |
3210 if (known_successor_index() != kNoKnownSuccessorIndex) { | 3228 if (known_successor_index() != kNoKnownSuccessorIndex) { |
3211 *block = SuccessorAt(known_successor_index()); | 3229 *block = SuccessorAt(known_successor_index()); |
3212 return true; | 3230 return true; |
3213 } | 3231 } |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3333 return false; | 3351 return false; |
3334 } | 3352 } |
3335 | 3353 |
3336 | 3354 |
3337 void HCompareMinusZeroAndBranch::InferRepresentation( | 3355 void HCompareMinusZeroAndBranch::InferRepresentation( |
3338 HInferRepresentationPhase* h_infer) { | 3356 HInferRepresentationPhase* h_infer) { |
3339 ChangeRepresentation(value()->representation()); | 3357 ChangeRepresentation(value()->representation()); |
3340 } | 3358 } |
3341 | 3359 |
3342 | 3360 |
3343 OStream& HGoto::PrintDataTo(OStream& os) const { // NOLINT | 3361 std::ostream& HGoto::PrintDataTo(std::ostream& os) const { // NOLINT |
3344 return os << *SuccessorAt(0); | 3362 return os << *SuccessorAt(0); |
3345 } | 3363 } |
3346 | 3364 |
3347 | 3365 |
3348 void HCompareNumericAndBranch::InferRepresentation( | 3366 void HCompareNumericAndBranch::InferRepresentation( |
3349 HInferRepresentationPhase* h_infer) { | 3367 HInferRepresentationPhase* h_infer) { |
3350 Representation left_rep = left()->representation(); | 3368 Representation left_rep = left()->representation(); |
3351 Representation right_rep = right()->representation(); | 3369 Representation right_rep = right()->representation(); |
3352 Representation observed_left = observed_input_representation(0); | 3370 Representation observed_left = observed_input_representation(0); |
3353 Representation observed_right = observed_input_representation(1); | 3371 Representation observed_right = observed_input_representation(1); |
(...skipping 23 matching lines...) Expand all Loading... |
3377 // comparisons must cause a deopt when one of their arguments is undefined. | 3395 // comparisons must cause a deopt when one of their arguments is undefined. |
3378 // See also v8:1434 | 3396 // See also v8:1434 |
3379 if (Token::IsOrderedRelationalCompareOp(token_)) { | 3397 if (Token::IsOrderedRelationalCompareOp(token_)) { |
3380 SetFlag(kAllowUndefinedAsNaN); | 3398 SetFlag(kAllowUndefinedAsNaN); |
3381 } | 3399 } |
3382 } | 3400 } |
3383 ChangeRepresentation(rep); | 3401 ChangeRepresentation(rep); |
3384 } | 3402 } |
3385 | 3403 |
3386 | 3404 |
3387 OStream& HParameter::PrintDataTo(OStream& os) const { // NOLINT | 3405 std::ostream& HParameter::PrintDataTo(std::ostream& os) const { // NOLINT |
3388 return os << index(); | 3406 return os << index(); |
3389 } | 3407 } |
3390 | 3408 |
3391 | 3409 |
3392 OStream& HLoadNamedField::PrintDataTo(OStream& os) const { // NOLINT | 3410 std::ostream& HLoadNamedField::PrintDataTo(std::ostream& os) const { // NOLINT |
3393 os << NameOf(object()) << access_; | 3411 os << NameOf(object()) << access_; |
3394 | 3412 |
3395 if (maps() != NULL) { | 3413 if (maps() != NULL) { |
3396 os << " [" << *maps()->at(0).handle(); | 3414 os << " [" << *maps()->at(0).handle(); |
3397 for (int i = 1; i < maps()->size(); ++i) { | 3415 for (int i = 1; i < maps()->size(); ++i) { |
3398 os << "," << *maps()->at(i).handle(); | 3416 os << "," << *maps()->at(i).handle(); |
3399 } | 3417 } |
3400 os << "]"; | 3418 os << "]"; |
3401 } | 3419 } |
3402 | 3420 |
3403 if (HasDependency()) os << " " << NameOf(dependency()); | 3421 if (HasDependency()) os << " " << NameOf(dependency()); |
3404 return os; | 3422 return os; |
3405 } | 3423 } |
3406 | 3424 |
3407 | 3425 |
3408 OStream& HLoadNamedGeneric::PrintDataTo(OStream& os) const { // NOLINT | 3426 std::ostream& HLoadNamedGeneric::PrintDataTo( |
| 3427 std::ostream& os) const { // NOLINT |
3409 Handle<String> n = Handle<String>::cast(name()); | 3428 Handle<String> n = Handle<String>::cast(name()); |
3410 return os << NameOf(object()) << "." << n->ToCString().get(); | 3429 return os << NameOf(object()) << "." << n->ToCString().get(); |
3411 } | 3430 } |
3412 | 3431 |
3413 | 3432 |
3414 OStream& HLoadKeyed::PrintDataTo(OStream& os) const { // NOLINT | 3433 std::ostream& HLoadKeyed::PrintDataTo(std::ostream& os) const { // NOLINT |
3415 if (!is_external()) { | 3434 if (!is_external()) { |
3416 os << NameOf(elements()); | 3435 os << NameOf(elements()); |
3417 } else { | 3436 } else { |
3418 DCHECK(elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND && | 3437 DCHECK(elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND && |
3419 elements_kind() <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND); | 3438 elements_kind() <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND); |
3420 os << NameOf(elements()) << "." << ElementsKindToString(elements_kind()); | 3439 os << NameOf(elements()) << "." << ElementsKindToString(elements_kind()); |
3421 } | 3440 } |
3422 | 3441 |
3423 os << "[" << NameOf(key()); | 3442 os << "[" << NameOf(key()); |
3424 if (IsDehoisted()) os << " + " << base_offset(); | 3443 if (IsDehoisted()) os << " + " << base_offset(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3492 } | 3511 } |
3493 | 3512 |
3494 if (IsExternalArrayElementsKind(elements_kind())) { | 3513 if (IsExternalArrayElementsKind(elements_kind())) { |
3495 return false; | 3514 return false; |
3496 } | 3515 } |
3497 | 3516 |
3498 return !UsesMustHandleHole(); | 3517 return !UsesMustHandleHole(); |
3499 } | 3518 } |
3500 | 3519 |
3501 | 3520 |
3502 OStream& HLoadKeyedGeneric::PrintDataTo(OStream& os) const { // NOLINT | 3521 std::ostream& HLoadKeyedGeneric::PrintDataTo( |
| 3522 std::ostream& os) const { // NOLINT |
3503 return os << NameOf(object()) << "[" << NameOf(key()) << "]"; | 3523 return os << NameOf(object()) << "[" << NameOf(key()) << "]"; |
3504 } | 3524 } |
3505 | 3525 |
3506 | 3526 |
3507 HValue* HLoadKeyedGeneric::Canonicalize() { | 3527 HValue* HLoadKeyedGeneric::Canonicalize() { |
3508 // Recognize generic keyed loads that use property name generated | 3528 // Recognize generic keyed loads that use property name generated |
3509 // by for-in statement as a key and rewrite them into fast property load | 3529 // by for-in statement as a key and rewrite them into fast property load |
3510 // by index. | 3530 // by index. |
3511 if (key()->IsLoadKeyed()) { | 3531 if (key()->IsLoadKeyed()) { |
3512 HLoadKeyed* key_load = HLoadKeyed::cast(key()); | 3532 HLoadKeyed* key_load = HLoadKeyed::cast(key()); |
(...skipping 21 matching lines...) Expand all Loading... |
3534 return Prepend(new(block()->zone()) HLoadFieldByIndex( | 3554 return Prepend(new(block()->zone()) HLoadFieldByIndex( |
3535 object(), index)); | 3555 object(), index)); |
3536 } | 3556 } |
3537 } | 3557 } |
3538 } | 3558 } |
3539 | 3559 |
3540 return this; | 3560 return this; |
3541 } | 3561 } |
3542 | 3562 |
3543 | 3563 |
3544 OStream& HStoreNamedGeneric::PrintDataTo(OStream& os) const { // NOLINT | 3564 std::ostream& HStoreNamedGeneric::PrintDataTo( |
| 3565 std::ostream& os) const { // NOLINT |
3545 Handle<String> n = Handle<String>::cast(name()); | 3566 Handle<String> n = Handle<String>::cast(name()); |
3546 return os << NameOf(object()) << "." << n->ToCString().get() << " = " | 3567 return os << NameOf(object()) << "." << n->ToCString().get() << " = " |
3547 << NameOf(value()); | 3568 << NameOf(value()); |
3548 } | 3569 } |
3549 | 3570 |
3550 | 3571 |
3551 OStream& HStoreNamedField::PrintDataTo(OStream& os) const { // NOLINT | 3572 std::ostream& HStoreNamedField::PrintDataTo(std::ostream& os) const { // NOLINT |
3552 os << NameOf(object()) << access_ << " = " << NameOf(value()); | 3573 os << NameOf(object()) << access_ << " = " << NameOf(value()); |
3553 if (NeedsWriteBarrier()) os << " (write-barrier)"; | 3574 if (NeedsWriteBarrier()) os << " (write-barrier)"; |
3554 if (has_transition()) os << " (transition map " << *transition_map() << ")"; | 3575 if (has_transition()) os << " (transition map " << *transition_map() << ")"; |
3555 return os; | 3576 return os; |
3556 } | 3577 } |
3557 | 3578 |
3558 | 3579 |
3559 OStream& HStoreKeyed::PrintDataTo(OStream& os) const { // NOLINT | 3580 std::ostream& HStoreKeyed::PrintDataTo(std::ostream& os) const { // NOLINT |
3560 if (!is_external()) { | 3581 if (!is_external()) { |
3561 os << NameOf(elements()); | 3582 os << NameOf(elements()); |
3562 } else { | 3583 } else { |
3563 DCHECK(elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND && | 3584 DCHECK(elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND && |
3564 elements_kind() <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND); | 3585 elements_kind() <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND); |
3565 os << NameOf(elements()) << "." << ElementsKindToString(elements_kind()); | 3586 os << NameOf(elements()) << "." << ElementsKindToString(elements_kind()); |
3566 } | 3587 } |
3567 | 3588 |
3568 os << "[" << NameOf(key()); | 3589 os << "[" << NameOf(key()); |
3569 if (IsDehoisted()) os << " + " << base_offset(); | 3590 if (IsDehoisted()) os << " + " << base_offset(); |
3570 return os << "] = " << NameOf(value()); | 3591 return os << "] = " << NameOf(value()); |
3571 } | 3592 } |
3572 | 3593 |
3573 | 3594 |
3574 OStream& HStoreKeyedGeneric::PrintDataTo(OStream& os) const { // NOLINT | 3595 std::ostream& HStoreKeyedGeneric::PrintDataTo( |
| 3596 std::ostream& os) const { // NOLINT |
3575 return os << NameOf(object()) << "[" << NameOf(key()) | 3597 return os << NameOf(object()) << "[" << NameOf(key()) |
3576 << "] = " << NameOf(value()); | 3598 << "] = " << NameOf(value()); |
3577 } | 3599 } |
3578 | 3600 |
3579 | 3601 |
3580 OStream& HTransitionElementsKind::PrintDataTo(OStream& os) const { // NOLINT | 3602 std::ostream& HTransitionElementsKind::PrintDataTo( |
| 3603 std::ostream& os) const { // NOLINT |
3581 os << NameOf(object()); | 3604 os << NameOf(object()); |
3582 ElementsKind from_kind = original_map().handle()->elements_kind(); | 3605 ElementsKind from_kind = original_map().handle()->elements_kind(); |
3583 ElementsKind to_kind = transitioned_map().handle()->elements_kind(); | 3606 ElementsKind to_kind = transitioned_map().handle()->elements_kind(); |
3584 os << " " << *original_map().handle() << " [" | 3607 os << " " << *original_map().handle() << " [" |
3585 << ElementsAccessor::ForKind(from_kind)->name() << "] -> " | 3608 << ElementsAccessor::ForKind(from_kind)->name() << "] -> " |
3586 << *transitioned_map().handle() << " [" | 3609 << *transitioned_map().handle() << " [" |
3587 << ElementsAccessor::ForKind(to_kind)->name() << "]"; | 3610 << ElementsAccessor::ForKind(to_kind)->name() << "]"; |
3588 if (IsSimpleMapChangeTransition(from_kind, to_kind)) os << " (simple)"; | 3611 if (IsSimpleMapChangeTransition(from_kind, to_kind)) os << " (simple)"; |
3589 return os; | 3612 return os; |
3590 } | 3613 } |
3591 | 3614 |
3592 | 3615 |
3593 OStream& HLoadGlobalCell::PrintDataTo(OStream& os) const { // NOLINT | 3616 std::ostream& HLoadGlobalCell::PrintDataTo(std::ostream& os) const { // NOLINT |
3594 os << "[" << *cell().handle() << "]"; | 3617 os << "[" << *cell().handle() << "]"; |
3595 if (details_.IsConfigurable()) os << " (configurable)"; | 3618 if (details_.IsConfigurable()) os << " (configurable)"; |
3596 if (details_.IsReadOnly()) os << " (read-only)"; | 3619 if (details_.IsReadOnly()) os << " (read-only)"; |
3597 return os; | 3620 return os; |
3598 } | 3621 } |
3599 | 3622 |
3600 | 3623 |
3601 bool HLoadGlobalCell::RequiresHoleCheck() const { | 3624 bool HLoadGlobalCell::RequiresHoleCheck() const { |
3602 if (!details_.IsConfigurable()) return false; | 3625 if (!details_.IsConfigurable()) return false; |
3603 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { | 3626 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { |
3604 HValue* use = it.value(); | 3627 HValue* use = it.value(); |
3605 if (!use->IsChange()) return true; | 3628 if (!use->IsChange()) return true; |
3606 } | 3629 } |
3607 return false; | 3630 return false; |
3608 } | 3631 } |
3609 | 3632 |
3610 | 3633 |
3611 OStream& HLoadGlobalGeneric::PrintDataTo(OStream& os) const { // NOLINT | 3634 std::ostream& HLoadGlobalGeneric::PrintDataTo( |
| 3635 std::ostream& os) const { // NOLINT |
3612 return os << name()->ToCString().get() << " "; | 3636 return os << name()->ToCString().get() << " "; |
3613 } | 3637 } |
3614 | 3638 |
3615 | 3639 |
3616 OStream& HInnerAllocatedObject::PrintDataTo(OStream& os) const { // NOLINT | 3640 std::ostream& HInnerAllocatedObject::PrintDataTo( |
| 3641 std::ostream& os) const { // NOLINT |
3617 os << NameOf(base_object()) << " offset "; | 3642 os << NameOf(base_object()) << " offset "; |
3618 return offset()->PrintTo(os); | 3643 return offset()->PrintTo(os); |
3619 } | 3644 } |
3620 | 3645 |
3621 | 3646 |
3622 OStream& HStoreGlobalCell::PrintDataTo(OStream& os) const { // NOLINT | 3647 std::ostream& HStoreGlobalCell::PrintDataTo(std::ostream& os) const { // NOLINT |
3623 os << "[" << *cell().handle() << "] = " << NameOf(value()); | 3648 os << "[" << *cell().handle() << "] = " << NameOf(value()); |
3624 if (details_.IsConfigurable()) os << " (configurable)"; | 3649 if (details_.IsConfigurable()) os << " (configurable)"; |
3625 if (details_.IsReadOnly()) os << " (read-only)"; | 3650 if (details_.IsReadOnly()) os << " (read-only)"; |
3626 return os; | 3651 return os; |
3627 } | 3652 } |
3628 | 3653 |
3629 | 3654 |
3630 OStream& HLoadContextSlot::PrintDataTo(OStream& os) const { // NOLINT | 3655 std::ostream& HLoadContextSlot::PrintDataTo(std::ostream& os) const { // NOLINT |
3631 return os << NameOf(value()) << "[" << slot_index() << "]"; | 3656 return os << NameOf(value()) << "[" << slot_index() << "]"; |
3632 } | 3657 } |
3633 | 3658 |
3634 | 3659 |
3635 OStream& HStoreContextSlot::PrintDataTo(OStream& os) const { // NOLINT | 3660 std::ostream& HStoreContextSlot::PrintDataTo( |
| 3661 std::ostream& os) const { // NOLINT |
3636 return os << NameOf(context()) << "[" << slot_index() | 3662 return os << NameOf(context()) << "[" << slot_index() |
3637 << "] = " << NameOf(value()); | 3663 << "] = " << NameOf(value()); |
3638 } | 3664 } |
3639 | 3665 |
3640 | 3666 |
3641 // Implementation of type inference and type conversions. Calculates | 3667 // Implementation of type inference and type conversions. Calculates |
3642 // the inferred type of this instruction based on the input operands. | 3668 // the inferred type of this instruction based on the input operands. |
3643 | 3669 |
3644 HType HValue::CalculateInferredType() { | 3670 HType HValue::CalculateInferredType() { |
3645 return type_; | 3671 return type_; |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3980 HObjectAccess::ForObservableJSObjectOffset(offset); | 4006 HObjectAccess::ForObservableJSObjectOffset(offset); |
3981 HStoreNamedField* clear_next_map = | 4007 HStoreNamedField* clear_next_map = |
3982 HStoreNamedField::New(zone, context(), this, access, | 4008 HStoreNamedField::New(zone, context(), this, access, |
3983 block()->graph()->GetConstant0()); | 4009 block()->graph()->GetConstant0()); |
3984 clear_next_map->ClearAllSideEffects(); | 4010 clear_next_map->ClearAllSideEffects(); |
3985 clear_next_map->InsertAfter(this); | 4011 clear_next_map->InsertAfter(this); |
3986 } | 4012 } |
3987 } | 4013 } |
3988 | 4014 |
3989 | 4015 |
3990 OStream& HAllocate::PrintDataTo(OStream& os) const { // NOLINT | 4016 std::ostream& HAllocate::PrintDataTo(std::ostream& os) const { // NOLINT |
3991 os << NameOf(size()) << " ("; | 4017 os << NameOf(size()) << " ("; |
3992 if (IsNewSpaceAllocation()) os << "N"; | 4018 if (IsNewSpaceAllocation()) os << "N"; |
3993 if (IsOldPointerSpaceAllocation()) os << "P"; | 4019 if (IsOldPointerSpaceAllocation()) os << "P"; |
3994 if (IsOldDataSpaceAllocation()) os << "D"; | 4020 if (IsOldDataSpaceAllocation()) os << "D"; |
3995 if (MustAllocateDoubleAligned()) os << "A"; | 4021 if (MustAllocateDoubleAligned()) os << "A"; |
3996 if (MustPrefillWithFiller()) os << "F"; | 4022 if (MustPrefillWithFiller()) os << "F"; |
3997 return os << ")"; | 4023 return os << ")"; |
3998 } | 4024 } |
3999 | 4025 |
4000 | 4026 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4089 c_left->StringValue(), c_right->StringValue()); | 4115 c_left->StringValue(), c_right->StringValue()); |
4090 return HConstant::New(zone, context, concat.ToHandleChecked()); | 4116 return HConstant::New(zone, context, concat.ToHandleChecked()); |
4091 } | 4117 } |
4092 } | 4118 } |
4093 } | 4119 } |
4094 return new(zone) HStringAdd( | 4120 return new(zone) HStringAdd( |
4095 context, left, right, pretenure_flag, flags, allocation_site); | 4121 context, left, right, pretenure_flag, flags, allocation_site); |
4096 } | 4122 } |
4097 | 4123 |
4098 | 4124 |
4099 OStream& HStringAdd::PrintDataTo(OStream& os) const { // NOLINT | 4125 std::ostream& HStringAdd::PrintDataTo(std::ostream& os) const { // NOLINT |
4100 if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_BOTH) { | 4126 if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_BOTH) { |
4101 os << "_CheckBoth"; | 4127 os << "_CheckBoth"; |
4102 } else if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_LEFT) { | 4128 } else if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_LEFT) { |
4103 os << "_CheckLeft"; | 4129 os << "_CheckLeft"; |
4104 } else if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_RIGHT) { | 4130 } else if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_RIGHT) { |
4105 os << "_CheckRight"; | 4131 os << "_CheckRight"; |
4106 } | 4132 } |
4107 HBinaryOperation::PrintDataTo(os); | 4133 HBinaryOperation::PrintDataTo(os); |
4108 os << " ("; | 4134 os << " ("; |
4109 if (pretenure_flag() == NOT_TENURED) | 4135 if (pretenure_flag() == NOT_TENURED) |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4424 } | 4450 } |
4425 } | 4451 } |
4426 return new(zone) HSeqStringGetChar(encoding, string, index); | 4452 return new(zone) HSeqStringGetChar(encoding, string, index); |
4427 } | 4453 } |
4428 | 4454 |
4429 | 4455 |
4430 #undef H_CONSTANT_INT | 4456 #undef H_CONSTANT_INT |
4431 #undef H_CONSTANT_DOUBLE | 4457 #undef H_CONSTANT_DOUBLE |
4432 | 4458 |
4433 | 4459 |
4434 OStream& HBitwise::PrintDataTo(OStream& os) const { // NOLINT | 4460 std::ostream& HBitwise::PrintDataTo(std::ostream& os) const { // NOLINT |
4435 os << Token::Name(op_) << " "; | 4461 os << Token::Name(op_) << " "; |
4436 return HBitwiseBinaryOperation::PrintDataTo(os); | 4462 return HBitwiseBinaryOperation::PrintDataTo(os); |
4437 } | 4463 } |
4438 | 4464 |
4439 | 4465 |
4440 void HPhi::SimplifyConstantInputs() { | 4466 void HPhi::SimplifyConstantInputs() { |
4441 // Convert constant inputs to integers when all uses are truncating. | 4467 // Convert constant inputs to integers when all uses are truncating. |
4442 // This must happen before representation inference takes place. | 4468 // This must happen before representation inference takes place. |
4443 if (!CheckUsesForFlag(kTruncatingToInt32)) return; | 4469 if (!CheckUsesForFlag(kTruncatingToInt32)) return; |
4444 for (int i = 0; i < OperandCount(); ++i) { | 4470 for (int i = 0; i < OperandCount(); ++i) { |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4739 if (access_type == STORE) { | 4765 if (access_type == STORE) { |
4740 instr->SetChangesFlag(::v8::internal::kExternalMemory); | 4766 instr->SetChangesFlag(::v8::internal::kExternalMemory); |
4741 } else { | 4767 } else { |
4742 instr->SetDependsOnFlag(::v8::internal::kExternalMemory); | 4768 instr->SetDependsOnFlag(::v8::internal::kExternalMemory); |
4743 } | 4769 } |
4744 break; | 4770 break; |
4745 } | 4771 } |
4746 } | 4772 } |
4747 | 4773 |
4748 | 4774 |
4749 OStream& operator<<(OStream& os, const HObjectAccess& access) { | 4775 std::ostream& operator<<(std::ostream& os, const HObjectAccess& access) { |
4750 os << "."; | 4776 os << "."; |
4751 | 4777 |
4752 switch (access.portion()) { | 4778 switch (access.portion()) { |
4753 case HObjectAccess::kArrayLengths: | 4779 case HObjectAccess::kArrayLengths: |
4754 case HObjectAccess::kStringLengths: | 4780 case HObjectAccess::kStringLengths: |
4755 os << "%length"; | 4781 os << "%length"; |
4756 break; | 4782 break; |
4757 case HObjectAccess::kElementsPointer: | 4783 case HObjectAccess::kElementsPointer: |
4758 os << "%elements"; | 4784 os << "%elements"; |
4759 break; | 4785 break; |
(...skipping 15 matching lines...) Expand all Loading... |
4775 break; | 4801 break; |
4776 case HObjectAccess::kExternalMemory: | 4802 case HObjectAccess::kExternalMemory: |
4777 os << "[external-memory]"; | 4803 os << "[external-memory]"; |
4778 break; | 4804 break; |
4779 } | 4805 } |
4780 | 4806 |
4781 return os << "@" << access.offset(); | 4807 return os << "@" << access.offset(); |
4782 } | 4808 } |
4783 | 4809 |
4784 } } // namespace v8::internal | 4810 } } // namespace v8::internal |
OLD | NEW |