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 2711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2722 __ b(ne, if_true); | 2722 __ b(ne, if_true); |
2723 | 2723 |
2724 // Check for fast case object. Generate false result for slow case object. | 2724 // Check for fast case object. Generate false result for slow case object. |
2725 __ ldr(r2, FieldMemOperand(r0, JSObject::kPropertiesOffset)); | 2725 __ ldr(r2, FieldMemOperand(r0, JSObject::kPropertiesOffset)); |
2726 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); | 2726 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); |
2727 __ LoadRoot(ip, Heap::kHashTableMapRootIndex); | 2727 __ LoadRoot(ip, Heap::kHashTableMapRootIndex); |
2728 __ cmp(r2, ip); | 2728 __ cmp(r2, ip); |
2729 __ b(eq, if_false); | 2729 __ b(eq, if_false); |
2730 | 2730 |
2731 // Look for valueOf symbol in the descriptor array, and indicate false if | 2731 // Look for valueOf symbol in the descriptor array, and indicate false if |
2732 // found. Since we omit an enumeration index check, if it is added via a | 2732 // found. The type is not checked, so if it is a transition it is a false |
2733 // transition that shares its descriptor array, this is a false positive. | 2733 // negative. |
2734 Label entry, loop, done; | 2734 __ LoadInstanceDescriptors(r1, r4, r3); |
2735 | 2735 __ ldr(r3, FieldMemOperand(r4, FixedArray::kLengthOffset)); |
2736 // Skip loop if no descriptors are valid. | 2736 // r4: descriptor array |
2737 __ NumberOfOwnDescriptors(r3, r1); | 2737 // r3: length of descriptor array |
2738 __ cmp(r3, Operand(0)); | 2738 // Calculate the end of the descriptor array. |
2739 __ b(eq, &done); | |
2740 | |
2741 __ LoadInstanceDescriptors(r1, r4, r2); | |
2742 // r4: descriptor array. | |
2743 // r3: valid entries in the descriptor array. | |
2744 STATIC_ASSERT(kSmiTag == 0); | 2739 STATIC_ASSERT(kSmiTag == 0); |
2745 STATIC_ASSERT(kSmiTagSize == 1); | 2740 STATIC_ASSERT(kSmiTagSize == 1); |
2746 STATIC_ASSERT(kPointerSize == 4); | 2741 STATIC_ASSERT(kPointerSize == 4); |
2747 __ mov(ip, Operand(DescriptorArray::kDescriptorSize)); | 2742 __ add(r2, r4, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
2748 __ mul(r3, r3, ip); | |
2749 // Calculate location of the first key name. | |
2750 __ add(r4, r4, Operand(DescriptorArray::kFirstOffset - kHeapObjectTag)); | |
2751 // Calculate the end of the descriptor array. | |
2752 __ mov(r2, r4); | |
2753 __ add(r2, r2, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); | 2743 __ add(r2, r2, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); |
2754 | 2744 |
| 2745 // Calculate location of the first key name. |
| 2746 __ add(r4, |
| 2747 r4, |
| 2748 Operand(DescriptorArray::kFirstOffset - kHeapObjectTag)); |
2755 // Loop through all the keys in the descriptor array. If one of these is the | 2749 // Loop through all the keys in the descriptor array. If one of these is the |
2756 // symbol valueOf the result is false. | 2750 // symbol valueOf the result is false. |
| 2751 Label entry, loop; |
2757 // The use of ip to store the valueOf symbol asumes that it is not otherwise | 2752 // The use of ip to store the valueOf symbol asumes that it is not otherwise |
2758 // used in the loop below. | 2753 // used in the loop below. |
2759 __ mov(ip, Operand(FACTORY->value_of_symbol())); | 2754 __ mov(ip, Operand(FACTORY->value_of_symbol())); |
2760 __ jmp(&entry); | 2755 __ jmp(&entry); |
2761 __ bind(&loop); | 2756 __ bind(&loop); |
2762 __ ldr(r3, MemOperand(r4, 0)); | 2757 __ ldr(r3, MemOperand(r4, 0)); |
2763 __ cmp(r3, ip); | 2758 __ cmp(r3, ip); |
2764 __ b(eq, if_false); | 2759 __ b(eq, if_false); |
2765 __ add(r4, r4, Operand(DescriptorArray::kDescriptorSize * kPointerSize)); | 2760 __ add(r4, r4, Operand(DescriptorArray::kDescriptorSize * kPointerSize)); |
2766 __ bind(&entry); | 2761 __ bind(&entry); |
2767 __ cmp(r4, Operand(r2)); | 2762 __ cmp(r4, Operand(r2)); |
2768 __ b(ne, &loop); | 2763 __ b(ne, &loop); |
2769 | 2764 |
2770 __ bind(&done); | 2765 // If a valueOf property is not found on the object check that it's |
2771 // If a valueOf property is not found on the object check that its | |
2772 // prototype is the un-modified String prototype. If not result is false. | 2766 // prototype is the un-modified String prototype. If not result is false. |
2773 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); | 2767 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); |
2774 __ JumpIfSmi(r2, if_false); | 2768 __ JumpIfSmi(r2, if_false); |
2775 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); | 2769 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); |
2776 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 2770 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
2777 __ ldr(r3, FieldMemOperand(r3, GlobalObject::kNativeContextOffset)); | 2771 __ ldr(r3, FieldMemOperand(r3, GlobalObject::kNativeContextOffset)); |
2778 __ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); | 2772 __ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); |
2779 __ cmp(r2, r3); | 2773 __ cmp(r2, r3); |
2780 __ b(ne, if_false); | 2774 __ b(ne, if_false); |
2781 | 2775 |
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4584 *context_length = 0; | 4578 *context_length = 0; |
4585 return previous_; | 4579 return previous_; |
4586 } | 4580 } |
4587 | 4581 |
4588 | 4582 |
4589 #undef __ | 4583 #undef __ |
4590 | 4584 |
4591 } } // namespace v8::internal | 4585 } } // namespace v8::internal |
4592 | 4586 |
4593 #endif // V8_TARGET_ARCH_ARM | 4587 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |