| OLD | NEW |
| 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 2626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2637 __ JumpIfSmi(r4, &extra_checks_or_miss); | 2637 __ JumpIfSmi(r4, &extra_checks_or_miss); |
| 2638 | 2638 |
| 2639 // Increment the call count for monomorphic function calls. | 2639 // Increment the call count for monomorphic function calls. |
| 2640 const int count_offset = FixedArray::kHeaderSize + kPointerSize; | 2640 const int count_offset = FixedArray::kHeaderSize + kPointerSize; |
| 2641 __ LoadP(r6, FieldMemOperand(r9, count_offset)); | 2641 __ LoadP(r6, FieldMemOperand(r9, count_offset)); |
| 2642 __ AddSmiLiteral(r6, r6, Smi::FromInt(CallICNexus::kCallCountIncrement), r0); | 2642 __ AddSmiLiteral(r6, r6, Smi::FromInt(CallICNexus::kCallCountIncrement), r0); |
| 2643 __ StoreP(r6, FieldMemOperand(r9, count_offset), r0); | 2643 __ StoreP(r6, FieldMemOperand(r9, count_offset), r0); |
| 2644 | 2644 |
| 2645 __ bind(&call_function); | 2645 __ bind(&call_function); |
| 2646 __ mov(r3, Operand(argc)); | 2646 __ mov(r3, Operand(argc)); |
| 2647 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode()), | 2647 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), |
| 2648 tail_call_mode()), |
| 2648 RelocInfo::CODE_TARGET); | 2649 RelocInfo::CODE_TARGET); |
| 2649 | 2650 |
| 2650 __ bind(&extra_checks_or_miss); | 2651 __ bind(&extra_checks_or_miss); |
| 2651 Label uninitialized, miss, not_allocation_site; | 2652 Label uninitialized, miss, not_allocation_site; |
| 2652 | 2653 |
| 2653 __ CompareRoot(r7, Heap::kmegamorphic_symbolRootIndex); | 2654 __ CompareRoot(r7, Heap::kmegamorphic_symbolRootIndex); |
| 2654 __ beq(&call); | 2655 __ beq(&call); |
| 2655 | 2656 |
| 2656 // Verify that r7 contains an AllocationSite | 2657 // Verify that r7 contains an AllocationSite |
| 2657 __ LoadP(r8, FieldMemOperand(r7, HeapObject::kMapOffset)); | 2658 __ LoadP(r8, FieldMemOperand(r7, HeapObject::kMapOffset)); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2675 // We are going megamorphic. If the feedback is a JSFunction, it is fine | 2676 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
| 2676 // to handle it here. More complex cases are dealt with in the runtime. | 2677 // to handle it here. More complex cases are dealt with in the runtime. |
| 2677 __ AssertNotSmi(r7); | 2678 __ AssertNotSmi(r7); |
| 2678 __ CompareObjectType(r7, r8, r8, JS_FUNCTION_TYPE); | 2679 __ CompareObjectType(r7, r8, r8, JS_FUNCTION_TYPE); |
| 2679 __ bne(&miss); | 2680 __ bne(&miss); |
| 2680 __ LoadRoot(ip, Heap::kmegamorphic_symbolRootIndex); | 2681 __ LoadRoot(ip, Heap::kmegamorphic_symbolRootIndex); |
| 2681 __ StoreP(ip, FieldMemOperand(r9, FixedArray::kHeaderSize), r0); | 2682 __ StoreP(ip, FieldMemOperand(r9, FixedArray::kHeaderSize), r0); |
| 2682 | 2683 |
| 2683 __ bind(&call); | 2684 __ bind(&call); |
| 2684 __ mov(r3, Operand(argc)); | 2685 __ mov(r3, Operand(argc)); |
| 2685 __ Jump(masm->isolate()->builtins()->Call(convert_mode()), | 2686 __ Jump(masm->isolate()->builtins()->Call(convert_mode(), tail_call_mode()), |
| 2686 RelocInfo::CODE_TARGET); | 2687 RelocInfo::CODE_TARGET); |
| 2687 | 2688 |
| 2688 __ bind(&uninitialized); | 2689 __ bind(&uninitialized); |
| 2689 | 2690 |
| 2690 // We are going monomorphic, provided we actually have a JSFunction. | 2691 // We are going monomorphic, provided we actually have a JSFunction. |
| 2691 __ JumpIfSmi(r4, &miss); | 2692 __ JumpIfSmi(r4, &miss); |
| 2692 | 2693 |
| 2693 // Goto miss case if we do not have a function. | 2694 // Goto miss case if we do not have a function. |
| 2694 __ CompareObjectType(r4, r7, r7, JS_FUNCTION_TYPE); | 2695 __ CompareObjectType(r4, r7, r7, JS_FUNCTION_TYPE); |
| 2695 __ bne(&miss); | 2696 __ bne(&miss); |
| (...skipping 2984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5680 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5681 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5681 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5682 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 5682 } | 5683 } |
| 5683 | 5684 |
| 5684 | 5685 |
| 5685 #undef __ | 5686 #undef __ |
| 5686 } // namespace internal | 5687 } // namespace internal |
| 5687 } // namespace v8 | 5688 } // namespace v8 |
| 5688 | 5689 |
| 5689 #endif // V8_TARGET_ARCH_PPC | 5690 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |