From: chunyang.dai Date: Wed, 1 Jul 2015 11:39:06 +0000 (-0700) Subject: X87: [ic] Record call counts for monomorphic calls made with an IC. X-Git-Tag: upstream/4.7.83~1631 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f80fd3726030b431e95e05bff6a2ee5aef4e8740;p=platform%2Fupstream%2Fv8.git X87: [ic] Record call counts for monomorphic calls made with an IC. port c1a4f7477f03ebb0c6889bbf8ea6a4c928e0d413 (r29281). original commit message: The idea is that TurboFan can use this information for more intelligent inlining. BUG= Review URL: https://codereview.chromium.org/1213723005 Cr-Commit-Position: refs/heads/master@{#29409} --- diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc index bd332020b..affa69fd4 100644 --- a/src/x87/code-stubs-x87.cc +++ b/src/x87/code-stubs-x87.cc @@ -1934,6 +1934,11 @@ void CallIC_ArrayStub::Generate(MacroAssembler* masm) { factory->allocation_site_map()); __ j(not_equal, &miss); + // Increment the call count for monomorphic function calls. + __ add(FieldOperand(ebx, edx, times_half_pointer_size, + FixedArray::kHeaderSize + kPointerSize), + Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); + __ mov(ebx, ecx); __ mov(edx, edi); ArrayConstructorStub stub(masm->isolate(), arg_count()); @@ -1993,6 +1998,11 @@ void CallICStub::Generate(MacroAssembler* masm) { // convincing us that we have a monomorphic JSFunction. __ JumpIfSmi(edi, &extra_checks_or_miss); + // Increment the call count for monomorphic function calls. + __ add(FieldOperand(ebx, edx, times_half_pointer_size, + FixedArray::kHeaderSize + kPointerSize), + Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); + __ bind(&have_js_function); if (CallAsMethod()) { EmitContinueIfStrictOrNative(masm, &cont); @@ -2064,6 +2074,11 @@ void CallICStub::Generate(MacroAssembler* masm) { // Update stats. __ add(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1))); + // Initialize the call counter. + __ mov(FieldOperand(ebx, edx, times_half_pointer_size, + FixedArray::kHeaderSize + kPointerSize), + Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); + // Store the function. Use a stub since we need a frame for allocation. // ebx - vector // edx - slot