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

Side by Side Diff: src/ppc/code-stubs-ppc.cc

Issue 1207323002: PPC64: Fix "[ic] Record call counts for monomorphic calls made with an IC." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 7 #if V8_TARGET_ARCH_PPC
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2890 2890
2891 // Verify that r7 contains an AllocationSite 2891 // Verify that r7 contains an AllocationSite
2892 __ LoadP(r8, FieldMemOperand(r7, HeapObject::kMapOffset)); 2892 __ LoadP(r8, FieldMemOperand(r7, HeapObject::kMapOffset));
2893 __ CompareRoot(r8, Heap::kAllocationSiteMapRootIndex); 2893 __ CompareRoot(r8, Heap::kAllocationSiteMapRootIndex);
2894 __ bne(&miss); 2894 __ bne(&miss);
2895 2895
2896 // Increment the call count for monomorphic function calls. 2896 // Increment the call count for monomorphic function calls.
2897 const int count_offset = FixedArray::kHeaderSize + kPointerSize; 2897 const int count_offset = FixedArray::kHeaderSize + kPointerSize;
2898 __ LoadP(r6, FieldMemOperand(r9, count_offset)); 2898 __ LoadP(r6, FieldMemOperand(r9, count_offset));
2899 __ AddSmiLiteral(r6, r6, Smi::FromInt(CallICNexus::kCallCountIncrement), r0); 2899 __ AddSmiLiteral(r6, r6, Smi::FromInt(CallICNexus::kCallCountIncrement), r0);
2900 __ StoreP(r6, FieldMemOperand(r9, count_offset)); 2900 __ StoreP(r6, FieldMemOperand(r9, count_offset), r0);
2901 2901
2902 __ mr(r5, r7); 2902 __ mr(r5, r7);
2903 __ mr(r6, r4); 2903 __ mr(r6, r4);
2904 ArrayConstructorStub stub(masm->isolate(), arg_count()); 2904 ArrayConstructorStub stub(masm->isolate(), arg_count());
2905 __ TailCallStub(&stub); 2905 __ TailCallStub(&stub);
2906 2906
2907 __ bind(&miss); 2907 __ bind(&miss);
2908 GenerateMiss(masm); 2908 GenerateMiss(masm);
2909 2909
2910 // The slow case, we need this no matter what to complete a call after a miss. 2910 // The slow case, we need this no matter what to complete a call after a miss.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2953 __ bne(&extra_checks_or_miss); 2953 __ bne(&extra_checks_or_miss);
2954 2954
2955 // The compare above could have been a SMI/SMI comparison. Guard against this 2955 // The compare above could have been a SMI/SMI comparison. Guard against this
2956 // convincing us that we have a monomorphic JSFunction. 2956 // convincing us that we have a monomorphic JSFunction.
2957 __ JumpIfSmi(r4, &extra_checks_or_miss); 2957 __ JumpIfSmi(r4, &extra_checks_or_miss);
2958 2958
2959 // Increment the call count for monomorphic function calls. 2959 // Increment the call count for monomorphic function calls.
2960 const int count_offset = FixedArray::kHeaderSize + kPointerSize; 2960 const int count_offset = FixedArray::kHeaderSize + kPointerSize;
2961 __ LoadP(r6, FieldMemOperand(r9, count_offset)); 2961 __ LoadP(r6, FieldMemOperand(r9, count_offset));
2962 __ AddSmiLiteral(r6, r6, Smi::FromInt(CallICNexus::kCallCountIncrement), r0); 2962 __ AddSmiLiteral(r6, r6, Smi::FromInt(CallICNexus::kCallCountIncrement), r0);
2963 __ StoreP(r6, FieldMemOperand(r9, count_offset)); 2963 __ StoreP(r6, FieldMemOperand(r9, count_offset), r0);
2964 2964
2965 __ bind(&have_js_function); 2965 __ bind(&have_js_function);
2966 if (CallAsMethod()) { 2966 if (CallAsMethod()) {
2967 EmitContinueIfStrictOrNative(masm, &cont); 2967 EmitContinueIfStrictOrNative(masm, &cont);
2968 // Compute the receiver in sloppy mode. 2968 // Compute the receiver in sloppy mode.
2969 __ LoadP(r6, MemOperand(sp, argc * kPointerSize), r0); 2969 __ LoadP(r6, MemOperand(sp, argc * kPointerSize), r0);
2970 2970
2971 __ JumpIfSmi(r6, &wrap); 2971 __ JumpIfSmi(r6, &wrap);
2972 __ CompareObjectType(r6, r7, r7, FIRST_SPEC_OBJECT_TYPE); 2972 __ CompareObjectType(r6, r7, r7, FIRST_SPEC_OBJECT_TYPE);
2973 __ blt(&wrap); 2973 __ blt(&wrap);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
3030 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r7); 3030 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r7);
3031 __ cmp(r4, r7); 3031 __ cmp(r4, r7);
3032 __ beq(&miss); 3032 __ beq(&miss);
3033 3033
3034 // Update stats. 3034 // Update stats.
3035 __ LoadP(r7, FieldMemOperand(r5, with_types_offset)); 3035 __ LoadP(r7, FieldMemOperand(r5, with_types_offset));
3036 __ AddSmiLiteral(r7, r7, Smi::FromInt(1), r0); 3036 __ AddSmiLiteral(r7, r7, Smi::FromInt(1), r0);
3037 __ StoreP(r7, FieldMemOperand(r5, with_types_offset), r0); 3037 __ StoreP(r7, FieldMemOperand(r5, with_types_offset), r0);
3038 3038
3039 // Initialize the call counter. 3039 // Initialize the call counter.
3040 __ LoadSmiLiteral(r0, Smi::FromInt(CallICNexus::kCallCountIncrement)); 3040 __ LoadSmiLiteral(r8, Smi::FromInt(CallICNexus::kCallCountIncrement));
3041 __ StoreP(r0, FieldMemOperand(r9, count_offset)); 3041 __ StoreP(r8, FieldMemOperand(r9, count_offset), r0);
3042 3042
3043 // Store the function. Use a stub since we need a frame for allocation. 3043 // Store the function. Use a stub since we need a frame for allocation.
3044 // r5 - vector 3044 // r5 - vector
3045 // r6 - slot 3045 // r6 - slot
3046 // r4 - function 3046 // r4 - function
3047 { 3047 {
3048 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 3048 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
3049 CreateWeakCellStub create_stub(masm->isolate()); 3049 CreateWeakCellStub create_stub(masm->isolate());
3050 __ Push(r4); 3050 __ Push(r4);
3051 __ CallStub(&create_stub); 3051 __ CallStub(&create_stub);
(...skipping 2614 matching lines...) Expand 10 before | Expand all | Expand 10 after
5666 kStackUnwindSpace, NULL, 5666 kStackUnwindSpace, NULL,
5667 MemOperand(fp, 6 * kPointerSize), NULL); 5667 MemOperand(fp, 6 * kPointerSize), NULL);
5668 } 5668 }
5669 5669
5670 5670
5671 #undef __ 5671 #undef __
5672 } // namespace internal 5672 } // namespace internal
5673 } // namespace v8 5673 } // namespace v8
5674 5674
5675 #endif // V8_TARGET_ARCH_PPC 5675 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698