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

Side by Side Diff: src/ia32/full-codegen-ia32.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 | « src/arm/full-codegen-arm.cc ('k') | src/mips/full-codegen-mips.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 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 __ LoadInstanceDescriptors(ebx, ebx); 2663 __ LoadInstanceDescriptors(ebx, ebx);
2664 __ mov(ecx, FieldOperand(ebx, FixedArray::kLengthOffset)); 2664 __ mov(ecx, FieldOperand(ebx, FixedArray::kLengthOffset));
2665 // ebx: descriptor array 2665 // ebx: descriptor array
2666 // ecx: length of descriptor array 2666 // ecx: length of descriptor array
2667 // Calculate the end of the descriptor array. 2667 // Calculate the end of the descriptor array.
2668 STATIC_ASSERT(kSmiTag == 0); 2668 STATIC_ASSERT(kSmiTag == 0);
2669 STATIC_ASSERT(kSmiTagSize == 1); 2669 STATIC_ASSERT(kSmiTagSize == 1);
2670 STATIC_ASSERT(kPointerSize == 4); 2670 STATIC_ASSERT(kPointerSize == 4);
2671 __ lea(ecx, Operand(ebx, ecx, times_2, FixedArray::kHeaderSize)); 2671 __ lea(ecx, Operand(ebx, ecx, times_2, FixedArray::kHeaderSize));
2672 // Calculate location of the first key name. 2672 // Calculate location of the first key name.
2673 __ add(ebx, 2673 __ add(ebx, Immediate(DescriptorArray::kFirstOffset));
2674 Immediate(FixedArray::kHeaderSize +
2675 DescriptorArray::kFirstIndex * kPointerSize));
2676 // Loop through all the keys in the descriptor array. If one of these is the 2674 // Loop through all the keys in the descriptor array. If one of these is the
2677 // symbol valueOf the result is false. 2675 // symbol valueOf the result is false.
2678 Label entry, loop; 2676 Label entry, loop;
2679 __ jmp(&entry); 2677 __ jmp(&entry);
2680 __ bind(&loop); 2678 __ bind(&loop);
2681 __ mov(edx, FieldOperand(ebx, 0)); 2679 __ mov(edx, FieldOperand(ebx, 0));
2682 __ cmp(edx, FACTORY->value_of_symbol()); 2680 __ cmp(edx, FACTORY->value_of_symbol());
2683 __ j(equal, if_false); 2681 __ j(equal, if_false);
2684 __ add(ebx, Immediate(kPointerSize)); 2682 __ add(ebx, Immediate(DescriptorArray::kDescriptorSize * kPointerSize));
2685 __ bind(&entry); 2683 __ bind(&entry);
2686 __ cmp(ebx, ecx); 2684 __ cmp(ebx, ecx);
2687 __ j(not_equal, &loop); 2685 __ j(not_equal, &loop);
2688 2686
2689 // Reload map as register ebx was used as temporary above. 2687 // Reload map as register ebx was used as temporary above.
2690 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); 2688 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset));
2691 2689
2692 // If a valueOf property is not found on the object check that it's 2690 // If a valueOf property is not found on the object check that it's
2693 // prototype is the un-modified String prototype. If not result is false. 2691 // prototype is the un-modified String prototype. If not result is false.
2694 __ mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); 2692 __ mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset));
(...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after
4545 *stack_depth = 0; 4543 *stack_depth = 0;
4546 *context_length = 0; 4544 *context_length = 0;
4547 return previous_; 4545 return previous_;
4548 } 4546 }
4549 4547
4550 #undef __ 4548 #undef __
4551 4549
4552 } } // namespace v8::internal 4550 } } // namespace v8::internal
4553 4551
4554 #endif // V8_TARGET_ARCH_IA32 4552 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698