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

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

Issue 10870012: While finding the valueOf descriptor, only look at the key entries. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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/ia32/full-codegen-ia32.cc » ('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 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after
2728 // Calculate the end of the descriptor array. 2728 // Calculate the end of the descriptor array.
2729 STATIC_ASSERT(kSmiTag == 0); 2729 STATIC_ASSERT(kSmiTag == 0);
2730 STATIC_ASSERT(kSmiTagSize == 1); 2730 STATIC_ASSERT(kSmiTagSize == 1);
2731 STATIC_ASSERT(kPointerSize == 4); 2731 STATIC_ASSERT(kPointerSize == 4);
2732 __ add(r2, r4, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 2732 __ add(r2, r4, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
2733 __ add(r2, r2, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); 2733 __ add(r2, r2, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize));
2734 2734
2735 // Calculate location of the first key name. 2735 // Calculate location of the first key name.
2736 __ add(r4, 2736 __ add(r4,
2737 r4, 2737 r4,
2738 Operand(FixedArray::kHeaderSize - kHeapObjectTag + 2738 Operand(DescriptorArray::kFirstOffset - kHeapObjectTag));
2739 DescriptorArray::kFirstIndex * kPointerSize));
2740 // Loop through all the keys in the descriptor array. If one of these is the 2739 // Loop through all the keys in the descriptor array. If one of these is the
2741 // symbol valueOf the result is false. 2740 // symbol valueOf the result is false.
2742 Label entry, loop; 2741 Label entry, loop;
2743 // The use of ip to store the valueOf symbol asumes that it is not otherwise 2742 // The use of ip to store the valueOf symbol asumes that it is not otherwise
2744 // used in the loop below. 2743 // used in the loop below.
2745 __ mov(ip, Operand(FACTORY->value_of_symbol())); 2744 __ mov(ip, Operand(FACTORY->value_of_symbol()));
2746 __ jmp(&entry); 2745 __ jmp(&entry);
2747 __ bind(&loop); 2746 __ bind(&loop);
2748 __ ldr(r3, MemOperand(r4, 0)); 2747 __ ldr(r3, MemOperand(r4, 0));
2749 __ cmp(r3, ip); 2748 __ cmp(r3, ip);
2750 __ b(eq, if_false); 2749 __ b(eq, if_false);
2751 __ add(r4, r4, Operand(kPointerSize)); 2750 __ add(r4, r4, Operand(DescriptorArray::kDescriptorSize * kPointerSize));
2752 __ bind(&entry); 2751 __ bind(&entry);
2753 __ cmp(r4, Operand(r2)); 2752 __ cmp(r4, Operand(r2));
2754 __ b(ne, &loop); 2753 __ b(ne, &loop);
2755 2754
2756 // If a valueOf property is not found on the object check that it's 2755 // If a valueOf property is not found on the object check that it's
2757 // prototype is the un-modified String prototype. If not result is false. 2756 // prototype is the un-modified String prototype. If not result is false.
2758 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); 2757 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset));
2759 __ JumpIfSmi(r2, if_false); 2758 __ JumpIfSmi(r2, if_false);
2760 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); 2759 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset));
2761 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); 2760 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
4567 *context_length = 0; 4566 *context_length = 0;
4568 return previous_; 4567 return previous_;
4569 } 4568 }
4570 4569
4571 4570
4572 #undef __ 4571 #undef __
4573 4572
4574 } } // namespace v8::internal 4573 } } // namespace v8::internal
4575 4574
4576 #endif // V8_TARGET_ARCH_ARM 4575 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698