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/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // -- sp[4 * argc] : receiver | 29 // -- sp[4 * argc] : receiver |
30 // ----------------------------------- | 30 // ----------------------------------- |
31 __ AssertFunction(r4); | 31 __ AssertFunction(r4); |
32 | 32 |
33 // Make sure we operate in the context of the called function (for example | 33 // Make sure we operate in the context of the called function (for example |
34 // ConstructStubs implemented in C++ will be run in the context of the caller | 34 // ConstructStubs implemented in C++ will be run in the context of the caller |
35 // instead of the callee, due to the way that [[Construct]] is defined for | 35 // instead of the callee, due to the way that [[Construct]] is defined for |
36 // ordinary functions). | 36 // ordinary functions). |
37 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); | 37 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); |
38 | 38 |
39 // Insert extra arguments. | |
40 const int num_extra_args = 2; | |
41 __ Push(r4, r6); | |
42 | |
43 // JumpToExternalReference expects r3 to contain the number of arguments | 39 // JumpToExternalReference expects r3 to contain the number of arguments |
44 // including the receiver and the extra arguments. | 40 // including the receiver and the extra arguments. |
| 41 const int num_extra_args = 3; |
45 __ addi(r3, r3, Operand(num_extra_args + 1)); | 42 __ addi(r3, r3, Operand(num_extra_args + 1)); |
46 | 43 |
| 44 // Insert extra arguments. |
| 45 __ SmiTag(r3); |
| 46 __ Push(r3, r4, r6); |
| 47 __ SmiUntag(r3); |
| 48 |
47 __ JumpToExternalReference(ExternalReference(id, masm->isolate()), | 49 __ JumpToExternalReference(ExternalReference(id, masm->isolate()), |
48 exit_frame_type == BUILTIN_EXIT); | 50 exit_frame_type == BUILTIN_EXIT); |
49 } | 51 } |
50 | 52 |
51 | 53 |
52 // Load the built-in InternalArray function from the current context. | 54 // Load the built-in InternalArray function from the current context. |
53 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm, | 55 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm, |
54 Register result) { | 56 Register result) { |
55 // Load the InternalArray function from the current native context. | 57 // Load the InternalArray function from the current native context. |
56 __ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result); | 58 __ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result); |
(...skipping 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2998 __ bkpt(0); | 3000 __ bkpt(0); |
2999 } | 3001 } |
3000 } | 3002 } |
3001 | 3003 |
3002 | 3004 |
3003 #undef __ | 3005 #undef __ |
3004 } // namespace internal | 3006 } // namespace internal |
3005 } // namespace v8 | 3007 } // namespace v8 |
3006 | 3008 |
3007 #endif // V8_TARGET_ARCH_PPC | 3009 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |