Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index 3b77c73c0d0357e4e6d660ba03a3735326f284ad..a2aaa27e854e8e492f7c2b51131adcd8bc6fc643 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -1677,26 +1677,32 @@ HValue* HGraphBuilder::BuildNumberToString(HValue* object, Type* type) { |
| static_cast<HValue*>(NULL), |
| FAST_ELEMENTS, ALLOW_RETURN_HOLE); |
| - // Check if key is a heap number (the number string cache contains only |
| - // SMIs and heap number, so it is sufficient to do a SMI check here). |
|
Jakob Kummerow
2014/05/30 16:56:52
This comment is a lie! Unused entries in the cache
|
| + // Check if the key is a heap number and compare it with the object. |
| IfBuilder if_keyisnotsmi(this); |
| HValue* keyisnotsmi = if_keyisnotsmi.IfNot<HIsSmiAndBranch>(key); |
| if_keyisnotsmi.Then(); |
| { |
| - // Check if values of key and object match. |
|
Jakob Kummerow
2014/05/30 16:56:52
This entire block is actually unchanged, just inde
|
| - IfBuilder if_keyeqobject(this); |
| - if_keyeqobject.If<HCompareNumericAndBranch>( |
| - Add<HLoadNamedField>(key, keyisnotsmi, |
| - HObjectAccess::ForHeapNumberValue()), |
| - Add<HLoadNamedField>(object, objectisnumber, |
| - HObjectAccess::ForHeapNumberValue()), |
| - Token::EQ); |
| - if_keyeqobject.Then(); |
| + IfBuilder if_keyisheapnumber(this); |
| + if_keyisheapnumber.If<HCompareMap>( |
| + key, isolate()->factory()->heap_number_map()); |
| + if_keyisheapnumber.Then(); |
| { |
| - // Make the key_index available. |
| - Push(key_index); |
| + // Check if values of key and object match. |
| + IfBuilder if_keyeqobject(this); |
| + if_keyeqobject.If<HCompareNumericAndBranch>( |
| + Add<HLoadNamedField>(key, keyisnotsmi, |
| + HObjectAccess::ForHeapNumberValue()), |
| + Add<HLoadNamedField>(object, objectisnumber, |
| + HObjectAccess::ForHeapNumberValue()), |
| + Token::EQ); |
| + if_keyeqobject.Then(); |
| + { |
| + // Make the key_index available. |
| + Push(key_index); |
| + } |
| + if_keyeqobject.JoinContinuation(&found); |
| } |
| - if_keyeqobject.JoinContinuation(&found); |
| + if_keyisheapnumber.JoinContinuation(&found); |
| } |
| if_keyisnotsmi.JoinContinuation(&found); |
| } |