OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1989 // String value -> false iff empty. | 1989 // String value -> false iff empty. |
1990 Label not_string; | 1990 Label not_string; |
1991 __ CmpInstanceType(map, FIRST_NONSTRING_TYPE); | 1991 __ CmpInstanceType(map, FIRST_NONSTRING_TYPE); |
1992 __ j(above_equal, ¬_string, Label::kNear); | 1992 __ j(above_equal, ¬_string, Label::kNear); |
1993 __ cmpq(FieldOperand(reg, String::kLengthOffset), Immediate(0)); | 1993 __ cmpq(FieldOperand(reg, String::kLengthOffset), Immediate(0)); |
1994 __ j(not_zero, instr->TrueLabel(chunk_)); | 1994 __ j(not_zero, instr->TrueLabel(chunk_)); |
1995 __ jmp(instr->FalseLabel(chunk_)); | 1995 __ jmp(instr->FalseLabel(chunk_)); |
1996 __ bind(¬_string); | 1996 __ bind(¬_string); |
1997 } | 1997 } |
1998 | 1998 |
| 1999 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
| 2000 // Symbol value -> true. |
| 2001 __ CmpInstanceType(map, SYMBOL_TYPE); |
| 2002 __ j(equal, instr->TrueLabel(chunk_)); |
| 2003 } |
| 2004 |
1999 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2005 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2000 // heap number -> false iff +0, -0, or NaN. | 2006 // heap number -> false iff +0, -0, or NaN. |
2001 Label not_heap_number; | 2007 Label not_heap_number; |
2002 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2008 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
2003 __ j(not_equal, ¬_heap_number, Label::kNear); | 2009 __ j(not_equal, ¬_heap_number, Label::kNear); |
2004 __ xorps(xmm0, xmm0); | 2010 __ xorps(xmm0, xmm0); |
2005 __ ucomisd(xmm0, FieldOperand(reg, HeapNumber::kValueOffset)); | 2011 __ ucomisd(xmm0, FieldOperand(reg, HeapNumber::kValueOffset)); |
2006 __ j(zero, instr->FalseLabel(chunk_)); | 2012 __ j(zero, instr->FalseLabel(chunk_)); |
2007 __ jmp(instr->TrueLabel(chunk_)); | 2013 __ jmp(instr->TrueLabel(chunk_)); |
2008 __ bind(¬_heap_number); | 2014 __ bind(¬_heap_number); |
(...skipping 3582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5591 FixedArray::kHeaderSize - kPointerSize)); | 5597 FixedArray::kHeaderSize - kPointerSize)); |
5592 __ bind(&done); | 5598 __ bind(&done); |
5593 } | 5599 } |
5594 | 5600 |
5595 | 5601 |
5596 #undef __ | 5602 #undef __ |
5597 | 5603 |
5598 } } // namespace v8::internal | 5604 } } // namespace v8::internal |
5599 | 5605 |
5600 #endif // V8_TARGET_ARCH_X64 | 5606 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |