OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 9828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9839 HCompareObjectEqAndBranch* result = | 9839 HCompareObjectEqAndBranch* result = |
9840 New<HCompareObjectEqAndBranch>(left, right); | 9840 New<HCompareObjectEqAndBranch>(left, right); |
9841 return result; | 9841 return result; |
9842 } | 9842 } |
9843 } else { | 9843 } else { |
9844 Bailout(kUnsupportedNonPrimitiveCompare); | 9844 Bailout(kUnsupportedNonPrimitiveCompare); |
9845 return NULL; | 9845 return NULL; |
9846 } | 9846 } |
9847 } else if (combined_type->Is(Type::InternalizedString()) && | 9847 } else if (combined_type->Is(Type::InternalizedString()) && |
9848 Token::IsEqualityOp(op)) { | 9848 Token::IsEqualityOp(op)) { |
| 9849 // If we have a constant argument, it should be consistent with the type |
| 9850 // feedback (otherwise we fail assertions in HCompareObjectEqAndBranch). |
| 9851 if ((left->IsConstant() && |
| 9852 !HConstant::cast(left)->HasInternalizedStringValue()) || |
| 9853 (right->IsConstant() && |
| 9854 !HConstant::cast(right)->HasInternalizedStringValue())) { |
| 9855 Add<HDeoptimize>("Type mismatch between feedback and constant", |
| 9856 Deoptimizer::SOFT); |
| 9857 // The caller expects a branch instruction, so make it happy. |
| 9858 return New<HBranch>(graph()->GetConstantTrue()); |
| 9859 } |
9849 BuildCheckHeapObject(left); | 9860 BuildCheckHeapObject(left); |
9850 Add<HCheckInstanceType>(left, HCheckInstanceType::IS_INTERNALIZED_STRING); | 9861 Add<HCheckInstanceType>(left, HCheckInstanceType::IS_INTERNALIZED_STRING); |
9851 BuildCheckHeapObject(right); | 9862 BuildCheckHeapObject(right); |
9852 Add<HCheckInstanceType>(right, HCheckInstanceType::IS_INTERNALIZED_STRING); | 9863 Add<HCheckInstanceType>(right, HCheckInstanceType::IS_INTERNALIZED_STRING); |
9853 HCompareObjectEqAndBranch* result = | 9864 HCompareObjectEqAndBranch* result = |
9854 New<HCompareObjectEqAndBranch>(left, right); | 9865 New<HCompareObjectEqAndBranch>(left, right); |
9855 return result; | 9866 return result; |
9856 } else if (combined_type->Is(Type::String())) { | 9867 } else if (combined_type->Is(Type::String())) { |
| 9868 // If we have a constant argument, it should be consistent with the type |
| 9869 // feedback (otherwise we fail assertions in HCompareObjectEqAndBranch). |
| 9870 if ((left->IsConstant() && |
| 9871 !HConstant::cast(left)->HasStringValue()) || |
| 9872 (right->IsConstant() && |
| 9873 !HConstant::cast(right)->HasStringValue())) { |
| 9874 Add<HDeoptimize>("Type mismatch between feedback and constant", |
| 9875 Deoptimizer::SOFT); |
| 9876 // The caller expects a branch instruction, so make it happy. |
| 9877 return New<HBranch>(graph()->GetConstantTrue()); |
| 9878 } |
9857 BuildCheckHeapObject(left); | 9879 BuildCheckHeapObject(left); |
9858 Add<HCheckInstanceType>(left, HCheckInstanceType::IS_STRING); | 9880 Add<HCheckInstanceType>(left, HCheckInstanceType::IS_STRING); |
9859 BuildCheckHeapObject(right); | 9881 BuildCheckHeapObject(right); |
9860 Add<HCheckInstanceType>(right, HCheckInstanceType::IS_STRING); | 9882 Add<HCheckInstanceType>(right, HCheckInstanceType::IS_STRING); |
9861 HStringCompareAndBranch* result = | 9883 HStringCompareAndBranch* result = |
9862 New<HStringCompareAndBranch>(left, right, op); | 9884 New<HStringCompareAndBranch>(left, right, op); |
9863 return result; | 9885 return result; |
9864 } else { | 9886 } else { |
9865 if (combined_rep.IsTagged() || combined_rep.IsNone()) { | 9887 if (combined_rep.IsTagged() || combined_rep.IsNone()) { |
9866 HCompareGeneric* result = Add<HCompareGeneric>(left, right, op); | 9888 HCompareGeneric* result = Add<HCompareGeneric>(left, right, op); |
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11502 if (ShouldProduceTraceOutput()) { | 11524 if (ShouldProduceTraceOutput()) { |
11503 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11525 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11504 } | 11526 } |
11505 | 11527 |
11506 #ifdef DEBUG | 11528 #ifdef DEBUG |
11507 graph_->Verify(false); // No full verify. | 11529 graph_->Verify(false); // No full verify. |
11508 #endif | 11530 #endif |
11509 } | 11531 } |
11510 | 11532 |
11511 } } // namespace v8::internal | 11533 } } // namespace v8::internal |
OLD | NEW |