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

Side by Side Diff: src/x64/ic-x64.cc

Issue 6716018: X64: Optimize access to external references. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 9 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 __ shr(rdi, Immediate(String::kHashShift)); 626 __ shr(rdi, Immediate(String::kHashShift));
627 __ xor_(rcx, rdi); 627 __ xor_(rcx, rdi);
628 __ and_(rcx, Immediate(KeyedLookupCache::kCapacityMask)); 628 __ and_(rcx, Immediate(KeyedLookupCache::kCapacityMask));
629 629
630 // Load the key (consisting of map and symbol) from the cache and 630 // Load the key (consisting of map and symbol) from the cache and
631 // check for match. 631 // check for match.
632 ExternalReference cache_keys 632 ExternalReference cache_keys
633 = ExternalReference::keyed_lookup_cache_keys(); 633 = ExternalReference::keyed_lookup_cache_keys();
634 __ movq(rdi, rcx); 634 __ movq(rdi, rcx);
635 __ shl(rdi, Immediate(kPointerSizeLog2 + 1)); 635 __ shl(rdi, Immediate(kPointerSizeLog2 + 1));
636 __ movq(kScratchRegister, cache_keys); 636 __ LoadAddress(kScratchRegister, cache_keys);
637 __ cmpq(rbx, Operand(kScratchRegister, rdi, times_1, 0)); 637 __ cmpq(rbx, Operand(kScratchRegister, rdi, times_1, 0));
638 __ j(not_equal, &slow); 638 __ j(not_equal, &slow);
639 __ cmpq(rax, Operand(kScratchRegister, rdi, times_1, kPointerSize)); 639 __ cmpq(rax, Operand(kScratchRegister, rdi, times_1, kPointerSize));
640 __ j(not_equal, &slow); 640 __ j(not_equal, &slow);
641 641
642 // Get field offset, which is a 32-bit integer. 642 // Get field offset, which is a 32-bit integer.
643 ExternalReference cache_field_offsets 643 ExternalReference cache_field_offsets
644 = ExternalReference::keyed_lookup_cache_field_offsets(); 644 = ExternalReference::keyed_lookup_cache_field_offsets();
645 __ movq(kScratchRegister, cache_field_offsets); 645 __ LoadAddress(kScratchRegister, cache_field_offsets);
646 __ movl(rdi, Operand(kScratchRegister, rcx, times_4, 0)); 646 __ movl(rdi, Operand(kScratchRegister, rcx, times_4, 0));
647 __ movzxbq(rcx, FieldOperand(rbx, Map::kInObjectPropertiesOffset)); 647 __ movzxbq(rcx, FieldOperand(rbx, Map::kInObjectPropertiesOffset));
648 __ subq(rdi, rcx); 648 __ subq(rdi, rcx);
649 __ j(above_equal, &property_array_property); 649 __ j(above_equal, &property_array_property);
650 650
651 // Load in-object property. 651 // Load in-object property.
652 __ movzxbq(rcx, FieldOperand(rbx, Map::kInstanceSizeOffset)); 652 __ movzxbq(rcx, FieldOperand(rbx, Map::kInstanceSizeOffset));
653 __ addq(rcx, rdi); 653 __ addq(rcx, rdi);
654 __ movq(rax, FieldOperand(rdx, rcx, times_pointer_size, 0)); 654 __ movq(rax, FieldOperand(rdx, rcx, times_pointer_size, 0));
655 __ IncrementCounter(COUNTERS->keyed_load_generic_lookup_cache(), 1); 655 __ IncrementCounter(COUNTERS->keyed_load_generic_lookup_cache(), 1);
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 // Enter an internal frame. 999 // Enter an internal frame.
1000 __ EnterInternalFrame(); 1000 __ EnterInternalFrame();
1001 1001
1002 // Push the receiver and the name of the function. 1002 // Push the receiver and the name of the function.
1003 __ push(rdx); 1003 __ push(rdx);
1004 __ push(rcx); 1004 __ push(rcx);
1005 1005
1006 // Call the entry. 1006 // Call the entry.
1007 CEntryStub stub(1); 1007 CEntryStub stub(1);
1008 __ movq(rax, Immediate(2)); 1008 __ movq(rax, Immediate(2));
1009 __ movq(rbx, ExternalReference(IC_Utility(id))); 1009 __ LoadAddress(rbx, ExternalReference(IC_Utility(id)));
1010 __ CallStub(&stub); 1010 __ CallStub(&stub);
1011 1011
1012 // Move result to rdi and exit the internal frame. 1012 // Move result to rdi and exit the internal frame.
1013 __ movq(rdi, rax); 1013 __ movq(rdi, rax);
1014 __ LeaveInternalFrame(); 1014 __ LeaveInternalFrame();
1015 1015
1016 // Check if the receiver is a global object of some sort. 1016 // Check if the receiver is a global object of some sort.
1017 // This can happen only for regular CallIC but not KeyedCallIC. 1017 // This can happen only for regular CallIC but not KeyedCallIC.
1018 if (id == IC::kCallIC_Miss) { 1018 if (id == IC::kCallIC_Miss) {
1019 Label invoke, global; 1019 Label invoke, global;
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
1729 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1729 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1730 ? not_zero 1730 ? not_zero
1731 : zero; 1731 : zero;
1732 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1732 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1733 } 1733 }
1734 1734
1735 1735
1736 } } // namespace v8::internal 1736 } } // namespace v8::internal
1737 1737
1738 #endif // V8_TARGET_ARCH_X64 1738 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698