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

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

Issue 575373004: Convert KeyedLoad indexed interceptor case to a Handler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE and ports. Created 6 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/ia32/code-stubs-ia32.cc ('k') | src/ic/arm64/ic-arm64.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/ic.h" 10 #include "src/ic/ic.h"
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 __ Ret(); 632 __ Ret();
633 633
634 StubRuntimeCallHelper call_helper; 634 StubRuntimeCallHelper call_helper;
635 char_at_generator.GenerateSlow(masm, call_helper); 635 char_at_generator.GenerateSlow(masm, call_helper);
636 636
637 __ bind(&miss); 637 __ bind(&miss);
638 GenerateMiss(masm); 638 GenerateMiss(masm);
639 } 639 }
640 640
641 641
642 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
643 // Return address is in lr.
644 Label slow;
645
646 Register receiver = LoadDescriptor::ReceiverRegister();
647 Register key = LoadDescriptor::NameRegister();
648 Register scratch1 = r3;
649 Register scratch2 = r4;
650 DCHECK(!scratch1.is(receiver) && !scratch1.is(key));
651 DCHECK(!scratch2.is(receiver) && !scratch2.is(key));
652
653 // Check that the receiver isn't a smi.
654 __ JumpIfSmi(receiver, &slow);
655
656 // Check that the key is an array index, that is Uint32.
657 __ NonNegativeSmiTst(key);
658 __ b(ne, &slow);
659
660 // Get the map of the receiver.
661 __ ldr(scratch1, FieldMemOperand(receiver, HeapObject::kMapOffset));
662
663 // Check that it has indexed interceptor and access checks
664 // are not enabled for this object.
665 __ ldrb(scratch2, FieldMemOperand(scratch1, Map::kBitFieldOffset));
666 __ and_(scratch2, scratch2, Operand(kSlowCaseBitFieldMask));
667 __ cmp(scratch2, Operand(1 << Map::kHasIndexedInterceptor));
668 __ b(ne, &slow);
669
670 // Everything is fine, call runtime.
671 __ Push(receiver, key); // Receiver, key.
672
673 // Perform tail call to the entry.
674 __ TailCallExternalReference(
675 ExternalReference(IC_Utility(kLoadElementWithInterceptor),
676 masm->isolate()),
677 2, 1);
678
679 __ bind(&slow);
680 GenerateMiss(masm);
681 }
682
683
684 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 642 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
685 // Push receiver, key and value for runtime call. 643 // Push receiver, key and value for runtime call.
686 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), 644 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
687 StoreDescriptor::ValueRegister()); 645 StoreDescriptor::ValueRegister());
688 646
689 ExternalReference ref = 647 ExternalReference ref =
690 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); 648 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
691 __ TailCallExternalReference(ref, 3, 1); 649 __ TailCallExternalReference(ref, 3, 1);
692 } 650 }
693 651
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 patcher.EmitCondition(ne); 1036 patcher.EmitCondition(ne);
1079 } else { 1037 } else {
1080 DCHECK(Assembler::GetCondition(branch_instr) == ne); 1038 DCHECK(Assembler::GetCondition(branch_instr) == ne);
1081 patcher.EmitCondition(eq); 1039 patcher.EmitCondition(eq);
1082 } 1040 }
1083 } 1041 }
1084 } 1042 }
1085 } // namespace v8::internal 1043 } // namespace v8::internal
1086 1044
1087 #endif // V8_TARGET_ARCH_ARM 1045 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ic/arm64/ic-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698