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

Unified Diff: src/hydrogen-instructions.cc

Issue 17082003: Let NaN flow as double into HBranch (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 8a6ccbc9e2cbe364fb7e973372e478437c45a73d..7075e80faa1740676c07d84c3cefa908286e0fca 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -1276,20 +1276,29 @@ void HReturn::PrintDataTo(StringStream* stream) {
Representation HBranch::observed_input_representation(int index) {
static const ToBooleanStub::Types tagged_types(
- ToBooleanStub::UNDEFINED |
ToBooleanStub::NULL_TYPE |
ToBooleanStub::SPEC_OBJECT |
ToBooleanStub::STRING |
ToBooleanStub::SYMBOL);
+ static const ToBooleanStub::Types number_types(
+ ToBooleanStub::HEAP_NUMBER |
+ ToBooleanStub::SMI);
if (expected_input_types_.ContainsAnyOf(tagged_types)) {
return Representation::Tagged();
- } else if (expected_input_types_.Contains(ToBooleanStub::HEAP_NUMBER)) {
+ }
+ if (expected_input_types_.Contains(ToBooleanStub::UNDEFINED)) {
+ if (expected_input_types_.ContainsAnyOf(number_types)) {
Toon Verwaest 2013/06/18 17:01:52 Are you sure you want to make smi+undefined double
+ return Representation::Double();
+ }
+ return Representation::Tagged();
+ }
+ if (expected_input_types_.Contains(ToBooleanStub::HEAP_NUMBER)) {
return Representation::Double();
- } else if (expected_input_types_.Contains(ToBooleanStub::SMI)) {
+ }
+ if (expected_input_types_.Contains(ToBooleanStub::SMI)) {
return Representation::Smi();
- } else {
- return Representation::None();
}
+ return Representation::None();
}

Powered by Google App Engine
This is Rietveld 408576698