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 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2483 if (x->IsSmi() && y->IsSmi()) return SMIS; | 2483 if (x->IsSmi() && y->IsSmi()) return SMIS; |
2484 if (x->IsNumber() && y->IsNumber()) return HEAP_NUMBERS; | 2484 if (x->IsNumber() && y->IsNumber()) return HEAP_NUMBERS; |
2485 if (Token::IsOrderedRelationalCompareOp(op_)) { | 2485 if (Token::IsOrderedRelationalCompareOp(op_)) { |
2486 // Ordered comparisons treat undefined as NaN, so the | 2486 // Ordered comparisons treat undefined as NaN, so the |
2487 // HEAP_NUMBER stub will do the right thing. | 2487 // HEAP_NUMBER stub will do the right thing. |
2488 if ((x->IsNumber() && y->IsUndefined()) || | 2488 if ((x->IsNumber() && y->IsUndefined()) || |
2489 (y->IsNumber() && x->IsUndefined())) { | 2489 (y->IsNumber() && x->IsUndefined())) { |
2490 return HEAP_NUMBERS; | 2490 return HEAP_NUMBERS; |
2491 } | 2491 } |
2492 } | 2492 } |
| 2493 if (x->IsSymbol() && y->IsSymbol()) { |
| 2494 // We compare symbols as strings if we need to determine |
| 2495 // the order in a non-equality compare. |
| 2496 return Token::IsEqualityOp(op_) ? SYMBOLS : STRINGS; |
| 2497 } |
| 2498 if (x->IsString() && y->IsString()) return STRINGS; |
2493 if (!Token::IsEqualityOp(op_)) return GENERIC; | 2499 if (!Token::IsEqualityOp(op_)) return GENERIC; |
2494 if (x->IsSymbol() && y->IsSymbol()) return SYMBOLS; | |
2495 if (x->IsString() && y->IsString()) return STRINGS; | |
2496 if (x->IsJSObject() && y->IsJSObject()) { | 2500 if (x->IsJSObject() && y->IsJSObject()) { |
2497 if (Handle<JSObject>::cast(x)->map() == | 2501 if (Handle<JSObject>::cast(x)->map() == |
2498 Handle<JSObject>::cast(y)->map() && | 2502 Handle<JSObject>::cast(y)->map() && |
2499 Token::IsEqualityOp(op_)) { | 2503 Token::IsEqualityOp(op_)) { |
2500 return KNOWN_OBJECTS; | 2504 return KNOWN_OBJECTS; |
2501 } else { | 2505 } else { |
2502 return OBJECTS; | 2506 return OBJECTS; |
2503 } | 2507 } |
2504 } | 2508 } |
2505 return GENERIC; | 2509 return GENERIC; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2564 #undef ADDR | 2568 #undef ADDR |
2565 }; | 2569 }; |
2566 | 2570 |
2567 | 2571 |
2568 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2572 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2569 return IC_utilities[id]; | 2573 return IC_utilities[id]; |
2570 } | 2574 } |
2571 | 2575 |
2572 | 2576 |
2573 } } // namespace v8::internal | 2577 } } // namespace v8::internal |
OLD | NEW |