Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: src/hydrogen-instructions.cc

Issue 183383006: Fix HCheckValue::Canonicalize wrt uninitialized HConstant unique. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-348280.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-348280.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698