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 2741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2752 __ And(t0, t0, 1 << Map::kStringWrapperSafeForDefaultValueOf); | 2752 __ And(t0, t0, 1 << Map::kStringWrapperSafeForDefaultValueOf); |
2753 __ Branch(if_true, ne, t0, Operand(zero_reg)); | 2753 __ Branch(if_true, ne, t0, Operand(zero_reg)); |
2754 | 2754 |
2755 // Check for fast case object. Generate false result for slow case object. | 2755 // Check for fast case object. Generate false result for slow case object. |
2756 __ lw(a2, FieldMemOperand(v0, JSObject::kPropertiesOffset)); | 2756 __ lw(a2, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
2757 __ lw(a2, FieldMemOperand(a2, HeapObject::kMapOffset)); | 2757 __ lw(a2, FieldMemOperand(a2, HeapObject::kMapOffset)); |
2758 __ LoadRoot(t0, Heap::kHashTableMapRootIndex); | 2758 __ LoadRoot(t0, Heap::kHashTableMapRootIndex); |
2759 __ Branch(if_false, eq, a2, Operand(t0)); | 2759 __ Branch(if_false, eq, a2, Operand(t0)); |
2760 | 2760 |
2761 // Look for valueOf symbol in the descriptor array, and indicate false if | 2761 // Look for valueOf symbol in the descriptor array, and indicate false if |
2762 // found. The type is not checked, so if it is a transition it is a false | 2762 // found. Since we omit an enumeration index check, if it is added via a |
2763 // negative. | 2763 // transition that shares its descriptor array, this is a false positive. |
2764 __ LoadInstanceDescriptors(a1, t0, a3); | 2764 Label entry, loop, done; |
2765 __ lw(a3, FieldMemOperand(t0, FixedArray::kLengthOffset)); | 2765 |
2766 // t0: descriptor array | 2766 // Skip loop if no descriptors are valid. |
2767 // a3: length of descriptor array | 2767 __ NumberOfOwnDescriptors(a3, a1); |
2768 // Calculate the end of the descriptor array. | 2768 __ Branch(&done, eq, a3, Operand(zero_reg)); |
| 2769 |
| 2770 __ LoadInstanceDescriptors(a1, t0, a2); |
| 2771 // t0: descriptor array. |
| 2772 // a3: valid entries in the descriptor array. |
2769 STATIC_ASSERT(kSmiTag == 0); | 2773 STATIC_ASSERT(kSmiTag == 0); |
2770 STATIC_ASSERT(kSmiTagSize == 1); | 2774 STATIC_ASSERT(kSmiTagSize == 1); |
2771 STATIC_ASSERT(kPointerSize == 4); | 2775 STATIC_ASSERT(kPointerSize == 4); |
2772 __ Addu(a2, t0, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 2776 __ li(at, Operand(DescriptorArray::kDescriptorSize)); |
| 2777 __ Mult(a3, at); |
| 2778 // Calculate location of the first key name. |
| 2779 __ Addu(t0, t0, Operand(DescriptorArray::kFirstOffset - kHeapObjectTag)); |
| 2780 // Calculate the end of the descriptor array. |
| 2781 __ mov(a2, t0); |
2773 __ sll(t1, a3, kPointerSizeLog2 - kSmiTagSize); | 2782 __ sll(t1, a3, kPointerSizeLog2 - kSmiTagSize); |
2774 __ Addu(a2, a2, t1); | 2783 __ Addu(a2, a2, t1); |
2775 | 2784 |
2776 // Calculate location of the first key name. | |
2777 __ Addu(t0, | |
2778 t0, | |
2779 Operand(DescriptorArray::kFirstOffset - kHeapObjectTag)); | |
2780 // Loop through all the keys in the descriptor array. If one of these is the | 2785 // Loop through all the keys in the descriptor array. If one of these is the |
2781 // symbol valueOf the result is false. | 2786 // symbol valueOf the result is false. |
2782 Label entry, loop; | |
2783 // The use of t2 to store the valueOf symbol asumes that it is not otherwise | 2787 // The use of t2 to store the valueOf symbol asumes that it is not otherwise |
2784 // used in the loop below. | 2788 // used in the loop below. |
2785 __ LoadRoot(t2, Heap::kvalue_of_symbolRootIndex); | 2789 __ LoadRoot(t2, Heap::kvalue_of_symbolRootIndex); |
2786 __ jmp(&entry); | 2790 __ jmp(&entry); |
2787 __ bind(&loop); | 2791 __ bind(&loop); |
2788 __ lw(a3, MemOperand(t0, 0)); | 2792 __ lw(a3, MemOperand(t0, 0)); |
2789 __ Branch(if_false, eq, a3, Operand(t2)); | 2793 __ Branch(if_false, eq, a3, Operand(t2)); |
2790 __ Addu(t0, t0, Operand(DescriptorArray::kDescriptorSize * kPointerSize)); | 2794 __ Addu(t0, t0, Operand(DescriptorArray::kDescriptorSize * kPointerSize)); |
2791 __ bind(&entry); | 2795 __ bind(&entry); |
2792 __ Branch(&loop, ne, t0, Operand(a2)); | 2796 __ Branch(&loop, ne, t0, Operand(a2)); |
2793 | 2797 |
2794 // If a valueOf property is not found on the object check that it's | 2798 __ bind(&done); |
| 2799 // If a valueOf property is not found on the object check that its |
2795 // prototype is the un-modified String prototype. If not result is false. | 2800 // prototype is the un-modified String prototype. If not result is false. |
2796 __ lw(a2, FieldMemOperand(a1, Map::kPrototypeOffset)); | 2801 __ lw(a2, FieldMemOperand(a1, Map::kPrototypeOffset)); |
2797 __ JumpIfSmi(a2, if_false); | 2802 __ JumpIfSmi(a2, if_false); |
2798 __ lw(a2, FieldMemOperand(a2, HeapObject::kMapOffset)); | 2803 __ lw(a2, FieldMemOperand(a2, HeapObject::kMapOffset)); |
2799 __ lw(a3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 2804 __ lw(a3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
2800 __ lw(a3, FieldMemOperand(a3, GlobalObject::kNativeContextOffset)); | 2805 __ lw(a3, FieldMemOperand(a3, GlobalObject::kNativeContextOffset)); |
2801 __ lw(a3, ContextOperand(a3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); | 2806 __ lw(a3, ContextOperand(a3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); |
2802 __ Branch(if_false, ne, a2, Operand(a3)); | 2807 __ Branch(if_false, ne, a2, Operand(a3)); |
2803 | 2808 |
2804 // Set the bit in the map to indicate that it has been checked safe for | 2809 // Set the bit in the map to indicate that it has been checked safe for |
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4618 *context_length = 0; | 4623 *context_length = 0; |
4619 return previous_; | 4624 return previous_; |
4620 } | 4625 } |
4621 | 4626 |
4622 | 4627 |
4623 #undef __ | 4628 #undef __ |
4624 | 4629 |
4625 } } // namespace v8::internal | 4630 } } // namespace v8::internal |
4626 | 4631 |
4627 #endif // V8_TARGET_ARCH_MIPS | 4632 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |