| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 switch (opcode()) { | 504 switch (opcode()) { |
| 505 #define MAKE_CASE(type) case k##type: return #type; | 505 #define MAKE_CASE(type) case k##type: return #type; |
| 506 HYDROGEN_CONCRETE_INSTRUCTION_LIST(MAKE_CASE) | 506 HYDROGEN_CONCRETE_INSTRUCTION_LIST(MAKE_CASE) |
| 507 #undef MAKE_CASE | 507 #undef MAKE_CASE |
| 508 case kPhi: return "Phi"; | 508 case kPhi: return "Phi"; |
| 509 default: return ""; | 509 default: return ""; |
| 510 } | 510 } |
| 511 } | 511 } |
| 512 | 512 |
| 513 | 513 |
| 514 bool HValue::CanReplaceWithDummyUses() { |
| 515 return FLAG_unreachable_code_elimination && |
| 516 !(block()->IsReachable() || |
| 517 IsBlockEntry() || |
| 518 IsControlInstruction() || |
| 519 IsSimulate() || |
| 520 IsEnterInlined() || |
| 521 IsLeaveInlined()); |
| 522 } |
| 523 |
| 524 |
| 514 bool HValue::IsInteger32Constant() { | 525 bool HValue::IsInteger32Constant() { |
| 515 return IsConstant() && HConstant::cast(this)->HasInteger32Value(); | 526 return IsConstant() && HConstant::cast(this)->HasInteger32Value(); |
| 516 } | 527 } |
| 517 | 528 |
| 518 | 529 |
| 519 int32_t HValue::GetInteger32Constant() { | 530 int32_t HValue::GetInteger32Constant() { |
| 520 return HConstant::cast(this)->Integer32Value(); | 531 return HConstant::cast(this)->Integer32Value(); |
| 521 } | 532 } |
| 522 | 533 |
| 523 | 534 |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 | 979 |
| 969 void HCallNewArray::PrintDataTo(StringStream* stream) { | 980 void HCallNewArray::PrintDataTo(StringStream* stream) { |
| 970 stream->Add(ElementsKindToString(elements_kind())); | 981 stream->Add(ElementsKindToString(elements_kind())); |
| 971 stream->Add(" "); | 982 stream->Add(" "); |
| 972 HBinaryCall::PrintDataTo(stream); | 983 HBinaryCall::PrintDataTo(stream); |
| 973 } | 984 } |
| 974 | 985 |
| 975 | 986 |
| 976 void HCallRuntime::PrintDataTo(StringStream* stream) { | 987 void HCallRuntime::PrintDataTo(StringStream* stream) { |
| 977 stream->Add("%o ", *name()); | 988 stream->Add("%o ", *name()); |
| 989 if (save_doubles() == kSaveFPRegs) { |
| 990 stream->Add("[save doubles] "); |
| 991 } |
| 978 stream->Add("#%d", argument_count()); | 992 stream->Add("#%d", argument_count()); |
| 979 } | 993 } |
| 980 | 994 |
| 981 | 995 |
| 982 void HClassOfTestAndBranch::PrintDataTo(StringStream* stream) { | 996 void HClassOfTestAndBranch::PrintDataTo(StringStream* stream) { |
| 983 stream->Add("class_of_test("); | 997 stream->Add("class_of_test("); |
| 984 value()->PrintNameTo(stream); | 998 value()->PrintNameTo(stream); |
| 985 stream->Add(", \"%o\")", *class_name()); | 999 stream->Add(", \"%o\")", *class_name()); |
| 986 } | 1000 } |
| 987 | 1001 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 if (expected_input_types_.Contains(ToBooleanStub::HEAP_NUMBER)) { | 1059 if (expected_input_types_.Contains(ToBooleanStub::HEAP_NUMBER)) { |
| 1046 return Representation::Double(); | 1060 return Representation::Double(); |
| 1047 } | 1061 } |
| 1048 if (expected_input_types_.Contains(ToBooleanStub::SMI)) { | 1062 if (expected_input_types_.Contains(ToBooleanStub::SMI)) { |
| 1049 return Representation::Smi(); | 1063 return Representation::Smi(); |
| 1050 } | 1064 } |
| 1051 return Representation::None(); | 1065 return Representation::None(); |
| 1052 } | 1066 } |
| 1053 | 1067 |
| 1054 | 1068 |
| 1069 bool HBranch::KnownSuccessorBlock(HBasicBlock** block) { |
| 1070 HValue* value = this->value(); |
| 1071 if (value->EmitAtUses()) { |
| 1072 ASSERT(value->IsConstant()); |
| 1073 ASSERT(!value->representation().IsDouble()); |
| 1074 *block = HConstant::cast(value)->BooleanValue() |
| 1075 ? FirstSuccessor() |
| 1076 : SecondSuccessor(); |
| 1077 return true; |
| 1078 } |
| 1079 *block = NULL; |
| 1080 return false; |
| 1081 } |
| 1082 |
| 1083 |
| 1055 void HCompareMap::PrintDataTo(StringStream* stream) { | 1084 void HCompareMap::PrintDataTo(StringStream* stream) { |
| 1056 value()->PrintNameTo(stream); | 1085 value()->PrintNameTo(stream); |
| 1057 stream->Add(" (%p)", *map().handle()); | 1086 stream->Add(" (%p)", *map().handle()); |
| 1058 HControlInstruction::PrintDataTo(stream); | 1087 HControlInstruction::PrintDataTo(stream); |
| 1059 } | 1088 } |
| 1060 | 1089 |
| 1061 | 1090 |
| 1062 const char* HUnaryMathOperation::OpName() const { | 1091 const char* HUnaryMathOperation::OpName() const { |
| 1063 switch (op()) { | 1092 switch (op()) { |
| 1064 case kMathFloor: return "floor"; | 1093 case kMathFloor: return "floor"; |
| (...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2795 : new(zone) Range(); | 2824 : new(zone) Range(); |
| 2796 result->Shl(c->Integer32Value()); | 2825 result->Shl(c->Integer32Value()); |
| 2797 return result; | 2826 return result; |
| 2798 } | 2827 } |
| 2799 } | 2828 } |
| 2800 return HValue::InferRange(zone); | 2829 return HValue::InferRange(zone); |
| 2801 } | 2830 } |
| 2802 | 2831 |
| 2803 | 2832 |
| 2804 Range* HLoadNamedField::InferRange(Zone* zone) { | 2833 Range* HLoadNamedField::InferRange(Zone* zone) { |
| 2834 if (access().representation().IsByte()) { |
| 2835 return new(zone) Range(0, 255); |
| 2836 } |
| 2805 if (access().IsStringLength()) { | 2837 if (access().IsStringLength()) { |
| 2806 return new(zone) Range(0, String::kMaxLength); | 2838 return new(zone) Range(0, String::kMaxLength); |
| 2807 } | 2839 } |
| 2808 return HValue::InferRange(zone); | 2840 return HValue::InferRange(zone); |
| 2809 } | 2841 } |
| 2810 | 2842 |
| 2811 | 2843 |
| 2812 Range* HLoadKeyed::InferRange(Zone* zone) { | 2844 Range* HLoadKeyed::InferRange(Zone* zone) { |
| 2813 switch (elements_kind()) { | 2845 switch (elements_kind()) { |
| 2814 case EXTERNAL_PIXEL_ELEMENTS: | 2846 case EXTERNAL_PIXEL_ELEMENTS: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2852 | 2884 |
| 2853 | 2885 |
| 2854 void HCompareObjectEqAndBranch::PrintDataTo(StringStream* stream) { | 2886 void HCompareObjectEqAndBranch::PrintDataTo(StringStream* stream) { |
| 2855 left()->PrintNameTo(stream); | 2887 left()->PrintNameTo(stream); |
| 2856 stream->Add(" "); | 2888 stream->Add(" "); |
| 2857 right()->PrintNameTo(stream); | 2889 right()->PrintNameTo(stream); |
| 2858 HControlInstruction::PrintDataTo(stream); | 2890 HControlInstruction::PrintDataTo(stream); |
| 2859 } | 2891 } |
| 2860 | 2892 |
| 2861 | 2893 |
| 2894 bool HCompareObjectEqAndBranch::KnownSuccessorBlock(HBasicBlock** block) { |
| 2895 if (left()->IsConstant() && right()->IsConstant()) { |
| 2896 bool comparison_result = |
| 2897 HConstant::cast(left())->Equals(HConstant::cast(right())); |
| 2898 *block = comparison_result |
| 2899 ? FirstSuccessor() |
| 2900 : SecondSuccessor(); |
| 2901 return true; |
| 2902 } |
| 2903 *block = NULL; |
| 2904 return false; |
| 2905 } |
| 2906 |
| 2907 |
| 2862 void HCompareHoleAndBranch::InferRepresentation( | 2908 void HCompareHoleAndBranch::InferRepresentation( |
| 2863 HInferRepresentationPhase* h_infer) { | 2909 HInferRepresentationPhase* h_infer) { |
| 2864 ChangeRepresentation(value()->representation()); | 2910 ChangeRepresentation(value()->representation()); |
| 2865 } | 2911 } |
| 2866 | 2912 |
| 2867 | 2913 |
| 2868 void HGoto::PrintDataTo(StringStream* stream) { | 2914 void HGoto::PrintDataTo(StringStream* stream) { |
| 2869 stream->Add("B%d", SuccessorAt(0)->block_id()); | 2915 stream->Add("B%d", SuccessorAt(0)->block_id()); |
| 2870 } | 2916 } |
| 2871 | 2917 |
| (...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4227 break; | 4273 break; |
| 4228 case kExternalMemory: | 4274 case kExternalMemory: |
| 4229 stream->Add("[external-memory]"); | 4275 stream->Add("[external-memory]"); |
| 4230 break; | 4276 break; |
| 4231 } | 4277 } |
| 4232 | 4278 |
| 4233 stream->Add("@%d", offset()); | 4279 stream->Add("@%d", offset()); |
| 4234 } | 4280 } |
| 4235 | 4281 |
| 4236 } } // namespace v8::internal | 4282 } } // namespace v8::internal |
| OLD | NEW |