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 2689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2700 Register jmp_reg = r7; | 2700 Register jmp_reg = r7; |
2701 __ LoadP(jmp_reg, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); | 2701 __ LoadP(jmp_reg, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
2702 __ LoadP(jmp_reg, | 2702 __ LoadP(jmp_reg, |
2703 FieldMemOperand(jmp_reg, SharedFunctionInfo::kConstructStubOffset)); | 2703 FieldMemOperand(jmp_reg, SharedFunctionInfo::kConstructStubOffset)); |
2704 __ addi(ip, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); | 2704 __ addi(ip, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); |
2705 __ JumpToJSEntry(ip); | 2705 __ JumpToJSEntry(ip); |
2706 | 2706 |
2707 // r3: number of arguments | 2707 // r3: number of arguments |
2708 // r4: called object | 2708 // r4: called object |
2709 // r8: object type | 2709 // r8: object type |
2710 Label do_call; | |
2711 __ bind(&slow); | 2710 __ bind(&slow); |
2712 STATIC_ASSERT(JS_FUNCTION_PROXY_TYPE < 0xffffu); | 2711 { |
2713 __ cmpi(r8, Operand(JS_FUNCTION_PROXY_TYPE)); | 2712 STATIC_ASSERT(JS_FUNCTION_PROXY_TYPE < 0xffffu); |
2714 __ bne(&non_function_call); | 2713 __ cmpi(r8, Operand(JS_FUNCTION_PROXY_TYPE)); |
2715 __ GetBuiltinFunction( | 2714 __ bne(&non_function_call); |
2716 r4, Context::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR_BUILTIN_INDEX); | 2715 // TODO(neis): This doesn't match the ES6 spec for [[Construct]] on proxies. |
2717 __ b(&do_call); | 2716 __ LoadP(r4, FieldMemOperand(r4, JSFunctionProxy::kConstructTrapOffset)); |
| 2717 __ Jump(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
2718 | 2718 |
2719 __ bind(&non_function_call); | 2719 __ bind(&non_function_call); |
2720 __ GetBuiltinFunction( | 2720 { |
2721 r4, Context::CALL_NON_FUNCTION_AS_CONSTRUCTOR_BUILTIN_INDEX); | 2721 // Determine the delegate for the target (if any). |
2722 __ bind(&do_call); | 2722 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
2723 // Set expected number of arguments to zero (not changing r3). | 2723 __ SmiTag(r3); |
2724 __ li(r5, Operand::Zero()); | 2724 __ Push(r3, r4); |
2725 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 2725 __ CallRuntime(Runtime::kGetConstructorDelegate, 1); |
2726 RelocInfo::CODE_TARGET); | 2726 __ mr(r4, r3); |
| 2727 __ pop(r3); |
| 2728 __ SmiUntag(r3); |
| 2729 } |
| 2730 // The delegate is always a regular function. |
| 2731 __ AssertFunction(r4); |
| 2732 __ Jump(masm->isolate()->builtins()->CallFunction(), |
| 2733 RelocInfo::CODE_TARGET); |
| 2734 } |
2727 } | 2735 } |
2728 | 2736 |
2729 | 2737 |
2730 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { | 2738 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { |
2731 __ LoadP(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 2739 __ LoadP(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
2732 __ LoadP(vector, | 2740 __ LoadP(vector, |
2733 FieldMemOperand(vector, JSFunction::kSharedFunctionInfoOffset)); | 2741 FieldMemOperand(vector, JSFunction::kSharedFunctionInfoOffset)); |
2734 __ LoadP(vector, | 2742 __ LoadP(vector, |
2735 FieldMemOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset)); | 2743 FieldMemOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset)); |
2736 } | 2744 } |
(...skipping 3111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5848 kStackUnwindSpace, NULL, | 5856 kStackUnwindSpace, NULL, |
5849 MemOperand(fp, 6 * kPointerSize), NULL); | 5857 MemOperand(fp, 6 * kPointerSize), NULL); |
5850 } | 5858 } |
5851 | 5859 |
5852 | 5860 |
5853 #undef __ | 5861 #undef __ |
5854 } // namespace internal | 5862 } // namespace internal |
5855 } // namespace v8 | 5863 } // namespace v8 |
5856 | 5864 |
5857 #endif // V8_TARGET_ARCH_PPC | 5865 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |