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 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1559 | 1559 |
1560 | 1560 |
1561 void HCheckValue::PrintDataTo(StringStream* stream) { | 1561 void HCheckValue::PrintDataTo(StringStream* stream) { |
1562 value()->PrintNameTo(stream); | 1562 value()->PrintNameTo(stream); |
1563 stream->Add(" "); | 1563 stream->Add(" "); |
1564 object().handle()->ShortPrint(stream); | 1564 object().handle()->ShortPrint(stream); |
1565 } | 1565 } |
1566 | 1566 |
1567 | 1567 |
1568 HValue* HCheckValue::Canonicalize() { | 1568 HValue* HCheckValue::Canonicalize() { |
1569 return (value()->IsConstant() && | 1569 if (value()->IsConstant()) { |
1570 HConstant::cast(value())->GetUnique() == object_) | 1570 Unique<Object> unique = HConstant::cast(value())->GetUnique(); |
titzer
2014/03/03 12:42:38
Can you move this logic into a method on HConstant
| |
1571 ? NULL | 1571 if (unique.IsInitialized() && unique == object_) return NULL; |
1572 : this; | 1572 } |
1573 return this; | |
1573 } | 1574 } |
1574 | 1575 |
1575 | 1576 |
1576 const char* HCheckInstanceType::GetCheckName() { | 1577 const char* HCheckInstanceType::GetCheckName() { |
1577 switch (check_) { | 1578 switch (check_) { |
1578 case IS_SPEC_OBJECT: return "object"; | 1579 case IS_SPEC_OBJECT: return "object"; |
1579 case IS_JS_ARRAY: return "array"; | 1580 case IS_JS_ARRAY: return "array"; |
1580 case IS_STRING: return "string"; | 1581 case IS_STRING: return "string"; |
1581 case IS_INTERNALIZED_STRING: return "internalized_string"; | 1582 case IS_INTERNALIZED_STRING: return "internalized_string"; |
1582 } | 1583 } |
(...skipping 2940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4523 break; | 4524 break; |
4524 case kExternalMemory: | 4525 case kExternalMemory: |
4525 stream->Add("[external-memory]"); | 4526 stream->Add("[external-memory]"); |
4526 break; | 4527 break; |
4527 } | 4528 } |
4528 | 4529 |
4529 stream->Add("@%d", offset()); | 4530 stream->Add("@%d", offset()); |
4530 } | 4531 } |
4531 | 4532 |
4532 } } // namespace v8::internal | 4533 } } // namespace v8::internal |
OLD | NEW |