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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { | 1700 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { |
1701 // r3 : number of arguments to the construct function | 1701 // r3 : number of arguments to the construct function |
1702 // r4 : the function to call | 1702 // r4 : the function to call |
1703 // r5 : feedback vector | 1703 // r5 : feedback vector |
1704 // r6 : slot in feedback vector (Smi) | 1704 // r6 : slot in feedback vector (Smi) |
1705 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1705 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
1706 | 1706 |
1707 // Number-of-arguments register must be smi-tagged to call out. | 1707 // Number-of-arguments register must be smi-tagged to call out. |
1708 __ SmiTag(r3); | 1708 __ SmiTag(r3); |
1709 __ Push(r6, r5, r4, r3); | 1709 __ Push(r6, r5, r4, r3); |
| 1710 __ Push(cp); |
1710 | 1711 |
1711 __ CallStub(stub); | 1712 __ CallStub(stub); |
1712 | 1713 |
| 1714 __ Pop(cp); |
1713 __ Pop(r6, r5, r4, r3); | 1715 __ Pop(r6, r5, r4, r3); |
1714 __ SmiUntag(r3); | 1716 __ SmiUntag(r3); |
1715 } | 1717 } |
1716 | 1718 |
1717 | 1719 |
1718 static void GenerateRecordCallTarget(MacroAssembler* masm) { | 1720 static void GenerateRecordCallTarget(MacroAssembler* masm) { |
1719 // Cache the called function in a feedback vector slot. Cache states | 1721 // Cache the called function in a feedback vector slot. Cache states |
1720 // are uninitialized, monomorphic (indicated by a JSFunction), and | 1722 // are uninitialized, monomorphic (indicated by a JSFunction), and |
1721 // megamorphic. | 1723 // megamorphic. |
1722 // r3 : number of arguments to the construct function | 1724 // r3 : number of arguments to the construct function |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 __ LoadSmiLiteral(r8, Smi::FromInt(1)); | 2017 __ LoadSmiLiteral(r8, Smi::FromInt(1)); |
2016 __ StoreP(r8, FieldMemOperand(r9, count_offset), r0); | 2018 __ StoreP(r8, FieldMemOperand(r9, count_offset), r0); |
2017 | 2019 |
2018 // Store the function. Use a stub since we need a frame for allocation. | 2020 // Store the function. Use a stub since we need a frame for allocation. |
2019 // r5 - vector | 2021 // r5 - vector |
2020 // r6 - slot | 2022 // r6 - slot |
2021 // r4 - function | 2023 // r4 - function |
2022 { | 2024 { |
2023 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 2025 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
2024 CreateWeakCellStub create_stub(masm->isolate()); | 2026 CreateWeakCellStub create_stub(masm->isolate()); |
2025 __ Push(r4); | 2027 __ Push(cp, r4); |
2026 __ CallStub(&create_stub); | 2028 __ CallStub(&create_stub); |
2027 __ Pop(r4); | 2029 __ Pop(cp, r4); |
2028 } | 2030 } |
2029 | 2031 |
2030 __ b(&call_function); | 2032 __ b(&call_function); |
2031 | 2033 |
2032 // We are here because tracing is on or we encountered a MISS case we can't | 2034 // We are here because tracing is on or we encountered a MISS case we can't |
2033 // handle here. | 2035 // handle here. |
2034 __ bind(&miss); | 2036 __ bind(&miss); |
2035 GenerateMiss(masm); | 2037 GenerateMiss(masm); |
2036 | 2038 |
2037 __ b(&call); | 2039 __ b(&call); |
(...skipping 3439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5477 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); | 5479 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); |
5478 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5480 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5479 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5481 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5480 } | 5482 } |
5481 | 5483 |
5482 #undef __ | 5484 #undef __ |
5483 } // namespace internal | 5485 } // namespace internal |
5484 } // namespace v8 | 5486 } // namespace v8 |
5485 | 5487 |
5486 #endif // V8_TARGET_ARCH_PPC | 5488 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |