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

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

Issue 3053042: Modify polymorphic keyed load IC stub to load cached properties from the prop... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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/ic-arm.cc ('k') | src/x64/ic-x64.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 __ mov(key, hash); 538 __ mov(key, hash);
539 } 539 }
540 540
541 541
542 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { 542 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
543 // ----------- S t a t e ------------- 543 // ----------- S t a t e -------------
544 // -- eax : key 544 // -- eax : key
545 // -- edx : receiver 545 // -- edx : receiver
546 // -- esp[0] : return address 546 // -- esp[0] : return address
547 // ----------------------------------- 547 // -----------------------------------
548 Label slow, check_string, index_smi, index_string; 548 Label slow, check_string, index_smi, index_string, property_array_property;
549 Label check_pixel_array, probe_dictionary, check_number_dictionary; 549 Label check_pixel_array, probe_dictionary, check_number_dictionary;
550 550
551 // Check that the key is a smi. 551 // Check that the key is a smi.
552 __ test(eax, Immediate(kSmiTagMask)); 552 __ test(eax, Immediate(kSmiTagMask));
553 __ j(not_zero, &check_string, not_taken); 553 __ j(not_zero, &check_string, not_taken);
554 __ bind(&index_smi); 554 __ bind(&index_smi);
555 // Now the key is known to be a smi. This place is also jumped to from 555 // Now the key is known to be a smi. This place is also jumped to from
556 // where a numeric string is converted to a smi. 556 // where a numeric string is converted to a smi.
557 557
558 GenerateKeyedLoadReceiverCheck( 558 GenerateKeyedLoadReceiverCheck(
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 ExternalReference cache_keys 645 ExternalReference cache_keys
646 = ExternalReference::keyed_lookup_cache_keys(); 646 = ExternalReference::keyed_lookup_cache_keys();
647 __ mov(edi, ecx); 647 __ mov(edi, ecx);
648 __ shl(edi, kPointerSizeLog2 + 1); 648 __ shl(edi, kPointerSizeLog2 + 1);
649 __ cmp(ebx, Operand::StaticArray(edi, times_1, cache_keys)); 649 __ cmp(ebx, Operand::StaticArray(edi, times_1, cache_keys));
650 __ j(not_equal, &slow); 650 __ j(not_equal, &slow);
651 __ add(Operand(edi), Immediate(kPointerSize)); 651 __ add(Operand(edi), Immediate(kPointerSize));
652 __ cmp(eax, Operand::StaticArray(edi, times_1, cache_keys)); 652 __ cmp(eax, Operand::StaticArray(edi, times_1, cache_keys));
653 __ j(not_equal, &slow); 653 __ j(not_equal, &slow);
654 654
655 // Get field offset and check that it is an in-object property. 655 // Get field offset.
656 // edx : receiver 656 // edx : receiver
657 // ebx : receiver's map 657 // ebx : receiver's map
658 // eax : key 658 // eax : key
659 // ecx : lookup cache index 659 // ecx : lookup cache index
660 ExternalReference cache_field_offsets 660 ExternalReference cache_field_offsets
661 = ExternalReference::keyed_lookup_cache_field_offsets(); 661 = ExternalReference::keyed_lookup_cache_field_offsets();
662 __ mov(edi, 662 __ mov(edi,
663 Operand::StaticArray(ecx, times_pointer_size, cache_field_offsets)); 663 Operand::StaticArray(ecx, times_pointer_size, cache_field_offsets));
664 __ movzx_b(ecx, FieldOperand(ebx, Map::kInObjectPropertiesOffset)); 664 __ movzx_b(ecx, FieldOperand(ebx, Map::kInObjectPropertiesOffset));
665 __ sub(edi, Operand(ecx)); 665 __ sub(edi, Operand(ecx));
666 __ j(above_equal, &slow); 666 __ j(above_equal, &property_array_property);
667 667
668 // Load in-object property. 668 // Load in-object property.
669 __ movzx_b(ecx, FieldOperand(ebx, Map::kInstanceSizeOffset)); 669 __ movzx_b(ecx, FieldOperand(ebx, Map::kInstanceSizeOffset));
670 __ add(ecx, Operand(edi)); 670 __ add(ecx, Operand(edi));
671 __ mov(eax, FieldOperand(edx, ecx, times_pointer_size, 0)); 671 __ mov(eax, FieldOperand(edx, ecx, times_pointer_size, 0));
672 __ IncrementCounter(&Counters::keyed_load_generic_lookup_cache, 1); 672 __ IncrementCounter(&Counters::keyed_load_generic_lookup_cache, 1);
673 __ ret(0); 673 __ ret(0);
674 674
675 // Load property array property.
676 __ bind(&property_array_property);
677 __ mov(eax, FieldOperand(edx, JSObject::kPropertiesOffset));
678 __ mov(eax, FieldOperand(eax, edi, times_pointer_size,
679 FixedArray::kHeaderSize));
680 __ IncrementCounter(&Counters::keyed_load_generic_lookup_cache, 1);
681 __ ret(0);
682
675 // Do a quick inline probe of the receiver's dictionary, if it 683 // Do a quick inline probe of the receiver's dictionary, if it
676 // exists. 684 // exists.
677 __ bind(&probe_dictionary); 685 __ bind(&probe_dictionary);
678 686
679 __ mov(ecx, FieldOperand(edx, JSObject::kMapOffset)); 687 __ mov(ecx, FieldOperand(edx, JSObject::kMapOffset));
680 __ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset)); 688 __ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset));
681 GenerateGlobalInstanceTypeCheck(masm, ecx, &slow); 689 GenerateGlobalInstanceTypeCheck(masm, ecx, &slow);
682 690
683 GenerateDictionaryLoad(masm, &slow, ebx, eax, ecx, edi, eax); 691 GenerateDictionaryLoad(masm, &slow, ebx, eax, ecx, edi, eax);
684 __ IncrementCounter(&Counters::keyed_load_generic_symbol, 1); 692 __ IncrementCounter(&Counters::keyed_load_generic_symbol, 1);
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1957 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); 1965 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss));
1958 __ TailCallExternalReference(ref, 3, 1); 1966 __ TailCallExternalReference(ref, 3, 1);
1959 } 1967 }
1960 1968
1961 #undef __ 1969 #undef __
1962 1970
1963 1971
1964 } } // namespace v8::internal 1972 } } // namespace v8::internal
1965 1973
1966 #endif // V8_TARGET_ARCH_IA32 1974 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/x64/ic-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698