Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 10909007: Sharing of descriptor arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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. The type is not checked, so if it is a transition it is a false 2732 // found. Since we omit an enumeration index check, if it is added via a
2733 // negative. 2733 // transition that shares its descriptor array, this is a false positive.
2734 __ LoadInstanceDescriptors(r1, r4, r3); 2734 Label entry, loop, done;
2735 __ ldr(r3, FieldMemOperand(r4, FixedArray::kLengthOffset)); 2735
2736 // r4: descriptor array 2736 // Skip loop if no descriptors are valid.
2737 // r3: length of descriptor array 2737 __ NumberOfOwnDescriptors(r3, r1);
2738 // Calculate the end of the descriptor array. 2738 __ cmp(r3, Operand(0));
2739 __ b(eq, &done);
2740
2741 __ LoadInstanceDescriptors(r1, r4, r2);
2742 // r4: descriptor array.
2743 // r3: valid entries in the descriptor array.
2739 STATIC_ASSERT(kSmiTag == 0); 2744 STATIC_ASSERT(kSmiTag == 0);
2740 STATIC_ASSERT(kSmiTagSize == 1); 2745 STATIC_ASSERT(kSmiTagSize == 1);
2741 STATIC_ASSERT(kPointerSize == 4); 2746 STATIC_ASSERT(kPointerSize == 4);
2742 __ add(r2, r4, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 2747 __ mov(ip, Operand(DescriptorArray::kDescriptorSize));
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);
2743 __ add(r2, r2, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); 2753 __ add(r2, r2, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize));
2744 2754
2745 // Calculate location of the first key name.
2746 __ add(r4,
2747 r4,
2748 Operand(DescriptorArray::kFirstOffset - kHeapObjectTag));
2749 // Loop through all the keys in the descriptor array. If one of these is the 2755 // Loop through all the keys in the descriptor array. If one of these is the
2750 // symbol valueOf the result is false. 2756 // symbol valueOf the result is false.
2751 Label entry, loop;
2752 // The use of ip to store the valueOf symbol asumes that it is not otherwise 2757 // The use of ip to store the valueOf symbol asumes that it is not otherwise
2753 // used in the loop below. 2758 // used in the loop below.
2754 __ mov(ip, Operand(FACTORY->value_of_symbol())); 2759 __ mov(ip, Operand(FACTORY->value_of_symbol()));
2755 __ jmp(&entry); 2760 __ jmp(&entry);
2756 __ bind(&loop); 2761 __ bind(&loop);
2757 __ ldr(r3, MemOperand(r4, 0)); 2762 __ ldr(r3, MemOperand(r4, 0));
2758 __ cmp(r3, ip); 2763 __ cmp(r3, ip);
2759 __ b(eq, if_false); 2764 __ b(eq, if_false);
2760 __ add(r4, r4, Operand(DescriptorArray::kDescriptorSize * kPointerSize)); 2765 __ add(r4, r4, Operand(DescriptorArray::kDescriptorSize * kPointerSize));
2761 __ bind(&entry); 2766 __ bind(&entry);
2762 __ cmp(r4, Operand(r2)); 2767 __ cmp(r4, Operand(r2));
2763 __ b(ne, &loop); 2768 __ b(ne, &loop);
2764 2769
2765 // If a valueOf property is not found on the object check that it's 2770 __ bind(&done);
2771 // If a valueOf property is not found on the object check that its
2766 // prototype is the un-modified String prototype. If not result is false. 2772 // prototype is the un-modified String prototype. If not result is false.
2767 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); 2773 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset));
2768 __ JumpIfSmi(r2, if_false); 2774 __ JumpIfSmi(r2, if_false);
2769 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); 2775 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset));
2770 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); 2776 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
2771 __ ldr(r3, FieldMemOperand(r3, GlobalObject::kNativeContextOffset)); 2777 __ ldr(r3, FieldMemOperand(r3, GlobalObject::kNativeContextOffset));
2772 __ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); 2778 __ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX));
2773 __ cmp(r2, r3); 2779 __ cmp(r2, r3);
2774 __ b(ne, if_false); 2780 __ b(ne, if_false);
2775 2781
(...skipping 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after
4576 *context_length = 0; 4582 *context_length = 0;
4577 return previous_; 4583 return previous_;
4578 } 4584 }
4579 4585
4580 4586
4581 #undef __ 4587 #undef __
4582 4588
4583 } } // namespace v8::internal 4589 } } // namespace v8::internal
4584 4590
4585 #endif // V8_TARGET_ARCH_ARM 4591 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698