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

Side by Side Diff: src/x64/full-codegen-x64.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, 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 | « src/mips/full-codegen-mips.cc ('k') | no next file » | 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 2624 matching lines...) Expand 10 before | Expand all | Expand 10 after
2635 __ LoadInstanceDescriptors(rbx, rbx); 2635 __ LoadInstanceDescriptors(rbx, rbx);
2636 __ movq(rcx, FieldOperand(rbx, FixedArray::kLengthOffset)); 2636 __ movq(rcx, FieldOperand(rbx, FixedArray::kLengthOffset));
2637 // rbx: descriptor array 2637 // rbx: descriptor array
2638 // rcx: length of descriptor array 2638 // rcx: length of descriptor array
2639 // Calculate the end of the descriptor array. 2639 // Calculate the end of the descriptor array.
2640 SmiIndex index = masm_->SmiToIndex(rdx, rcx, kPointerSizeLog2); 2640 SmiIndex index = masm_->SmiToIndex(rdx, rcx, kPointerSizeLog2);
2641 __ lea(rcx, 2641 __ lea(rcx,
2642 Operand( 2642 Operand(
2643 rbx, index.reg, index.scale, FixedArray::kHeaderSize)); 2643 rbx, index.reg, index.scale, FixedArray::kHeaderSize));
2644 // Calculate location of the first key name. 2644 // Calculate location of the first key name.
2645 __ addq(rbx, 2645 __ addq(rbx, Immediate(DescriptorArray::kFirstOffset));
2646 Immediate(FixedArray::kHeaderSize +
2647 DescriptorArray::kFirstIndex * kPointerSize));
2648 // Loop through all the keys in the descriptor array. If one of these is the 2646 // Loop through all the keys in the descriptor array. If one of these is the
2649 // symbol valueOf the result is false. 2647 // symbol valueOf the result is false.
2650 Label entry, loop; 2648 Label entry, loop;
2651 __ jmp(&entry); 2649 __ jmp(&entry);
2652 __ bind(&loop); 2650 __ bind(&loop);
2653 __ movq(rdx, FieldOperand(rbx, 0)); 2651 __ movq(rdx, FieldOperand(rbx, 0));
2654 __ Cmp(rdx, FACTORY->value_of_symbol()); 2652 __ Cmp(rdx, FACTORY->value_of_symbol());
2655 __ j(equal, if_false); 2653 __ j(equal, if_false);
2656 __ addq(rbx, Immediate(kPointerSize)); 2654 __ addq(rbx, Immediate(DescriptorArray::kDescriptorSize * kPointerSize));
2657 __ bind(&entry); 2655 __ bind(&entry);
2658 __ cmpq(rbx, rcx); 2656 __ cmpq(rbx, rcx);
2659 __ j(not_equal, &loop); 2657 __ j(not_equal, &loop);
2660 2658
2661 // Reload map as register rbx was used as temporary above. 2659 // Reload map as register rbx was used as temporary above.
2662 __ movq(rbx, FieldOperand(rax, HeapObject::kMapOffset)); 2660 __ movq(rbx, FieldOperand(rax, HeapObject::kMapOffset));
2663 2661
2664 // If a valueOf property is not found on the object check that it's 2662 // If a valueOf property is not found on the object check that it's
2665 // prototype is the un-modified String prototype. If not result is false. 2663 // prototype is the un-modified String prototype. If not result is false.
2666 __ movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); 2664 __ movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset));
(...skipping 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after
4542 *context_length = 0; 4540 *context_length = 0;
4543 return previous_; 4541 return previous_;
4544 } 4542 }
4545 4543
4546 4544
4547 #undef __ 4545 #undef __
4548 4546
4549 } } // namespace v8::internal 4547 } } // namespace v8::internal
4550 4548
4551 #endif // V8_TARGET_ARCH_X64 4549 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698