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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 if (types_.Contains(STRING)) { | 625 if (types_.Contains(STRING)) { |
626 // String value -> false iff empty. | 626 // String value -> false iff empty. |
627 Label not_string; | 627 Label not_string; |
628 __ CmpInstanceType(map, FIRST_NONSTRING_TYPE); | 628 __ CmpInstanceType(map, FIRST_NONSTRING_TYPE); |
629 __ j(above_equal, ¬_string, Label::kNear); | 629 __ j(above_equal, ¬_string, Label::kNear); |
630 __ mov(tos_, FieldOperand(argument, String::kLengthOffset)); | 630 __ mov(tos_, FieldOperand(argument, String::kLengthOffset)); |
631 __ ret(1 * kPointerSize); // the string length is OK as the return value | 631 __ ret(1 * kPointerSize); // the string length is OK as the return value |
632 __ bind(¬_string); | 632 __ bind(¬_string); |
633 } | 633 } |
634 | 634 |
| 635 if (types_.Contains(SYMBOL)) { |
| 636 // Symbol value -> true. |
| 637 Label not_symbol; |
| 638 __ CmpInstanceType(map, SYMBOL_TYPE); |
| 639 __ j(not_equal, ¬_symbol, Label::kNear); |
| 640 __ bind(¬_symbol); |
| 641 } |
| 642 |
635 if (types_.Contains(HEAP_NUMBER)) { | 643 if (types_.Contains(HEAP_NUMBER)) { |
636 // heap number -> false iff +0, -0, or NaN. | 644 // heap number -> false iff +0, -0, or NaN. |
637 Label not_heap_number, false_result; | 645 Label not_heap_number, false_result; |
638 __ cmp(map, factory->heap_number_map()); | 646 __ cmp(map, factory->heap_number_map()); |
639 __ j(not_equal, ¬_heap_number, Label::kNear); | 647 __ j(not_equal, ¬_heap_number, Label::kNear); |
640 __ fldz(); | 648 __ fldz(); |
641 __ fld_d(FieldOperand(argument, HeapNumber::kValueOffset)); | 649 __ fld_d(FieldOperand(argument, HeapNumber::kValueOffset)); |
642 __ FCmp(); | 650 __ FCmp(); |
643 __ j(zero, &false_result, Label::kNear); | 651 __ j(zero, &false_result, Label::kNear); |
644 // argument contains the correct return value already. | 652 // argument contains the correct return value already. |
(...skipping 7226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7871 // Restore ecx. | 7879 // Restore ecx. |
7872 __ pop(ecx); | 7880 __ pop(ecx); |
7873 __ ret(0); | 7881 __ ret(0); |
7874 } | 7882 } |
7875 | 7883 |
7876 #undef __ | 7884 #undef __ |
7877 | 7885 |
7878 } } // namespace v8::internal | 7886 } } // namespace v8::internal |
7879 | 7887 |
7880 #endif // V8_TARGET_ARCH_IA32 | 7888 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |