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/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 | 8 |
9 #include "src/field-type.h" | 9 #include "src/field-type.h" |
10 #include "src/ic/call-optimization.h" | 10 #include "src/ic/call-optimization.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, | 21 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, |
22 int accessor_index, int expected_arguments, Register scratch) { | 22 int accessor_index, int expected_arguments, Register scratch) { |
23 // ----------- S t a t e ------------- | 23 // ----------- S t a t e ------------- |
24 // -- r3 : receiver | 24 // -- r3 : receiver |
25 // -- r5 : name | 25 // -- r5 : name |
26 // -- lr : return address | 26 // -- lr : return address |
27 // ----------------------------------- | 27 // ----------------------------------- |
28 { | 28 { |
29 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 29 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
30 | 30 |
| 31 // Save context register |
| 32 __ push(cp); |
| 33 |
31 if (accessor_index >= 0) { | 34 if (accessor_index >= 0) { |
32 DCHECK(!holder.is(scratch)); | 35 DCHECK(!holder.is(scratch)); |
33 DCHECK(!receiver.is(scratch)); | 36 DCHECK(!receiver.is(scratch)); |
34 // Call the JavaScript getter with the receiver on the stack. | 37 // Call the JavaScript getter with the receiver on the stack. |
35 if (map->IsJSGlobalObjectMap()) { | 38 if (map->IsJSGlobalObjectMap()) { |
36 // Swap in the global receiver. | 39 // Swap in the global receiver. |
37 __ LoadP(scratch, | 40 __ LoadP(scratch, |
38 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); | 41 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
39 receiver = scratch; | 42 receiver = scratch; |
40 } | 43 } |
41 __ push(receiver); | 44 __ push(receiver); |
42 ParameterCount actual(0); | 45 ParameterCount actual(0); |
43 ParameterCount expected(expected_arguments); | 46 ParameterCount expected(expected_arguments); |
44 __ LoadAccessor(r4, holder, accessor_index, ACCESSOR_GETTER); | 47 __ LoadAccessor(r4, holder, accessor_index, ACCESSOR_GETTER); |
45 __ InvokeFunction(r4, expected, actual, CALL_FUNCTION, | 48 __ InvokeFunction(r4, expected, actual, CALL_FUNCTION, |
46 CheckDebugStepCallWrapper()); | 49 CheckDebugStepCallWrapper()); |
47 } else { | 50 } else { |
48 // If we generate a global code snippet for deoptimization only, remember | 51 // If we generate a global code snippet for deoptimization only, remember |
49 // the place to continue after deoptimization. | 52 // the place to continue after deoptimization. |
50 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); | 53 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); |
51 } | 54 } |
52 | 55 |
53 // Restore context register. | 56 // Restore context register. |
54 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 57 __ pop(cp); |
55 } | 58 } |
56 __ Ret(); | 59 __ Ret(); |
57 } | 60 } |
58 | 61 |
59 | 62 |
60 void NamedStoreHandlerCompiler::GenerateStoreViaSetter( | 63 void NamedStoreHandlerCompiler::GenerateStoreViaSetter( |
61 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, | 64 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, |
62 int accessor_index, int expected_arguments, Register scratch) { | 65 int accessor_index, int expected_arguments, Register scratch) { |
63 // ----------- S t a t e ------------- | 66 // ----------- S t a t e ------------- |
64 // -- lr : return address | 67 // -- lr : return address |
65 // ----------------------------------- | 68 // ----------------------------------- |
66 { | 69 { |
67 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 70 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
68 | 71 |
| 72 // Save context register |
69 // Save value register, so we can restore it later. | 73 // Save value register, so we can restore it later. |
70 __ push(value()); | 74 __ Push(cp, value()); |
71 | 75 |
72 if (accessor_index >= 0) { | 76 if (accessor_index >= 0) { |
73 DCHECK(!holder.is(scratch)); | 77 DCHECK(!holder.is(scratch)); |
74 DCHECK(!receiver.is(scratch)); | 78 DCHECK(!receiver.is(scratch)); |
75 DCHECK(!value().is(scratch)); | 79 DCHECK(!value().is(scratch)); |
76 // Call the JavaScript setter with receiver and value on the stack. | 80 // Call the JavaScript setter with receiver and value on the stack. |
77 if (map->IsJSGlobalObjectMap()) { | 81 if (map->IsJSGlobalObjectMap()) { |
78 // Swap in the global receiver. | 82 // Swap in the global receiver. |
79 __ LoadP(scratch, | 83 __ LoadP(scratch, |
80 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); | 84 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
81 receiver = scratch; | 85 receiver = scratch; |
82 } | 86 } |
83 __ Push(receiver, value()); | 87 __ Push(receiver, value()); |
84 ParameterCount actual(1); | 88 ParameterCount actual(1); |
85 ParameterCount expected(expected_arguments); | 89 ParameterCount expected(expected_arguments); |
86 __ LoadAccessor(r4, holder, accessor_index, ACCESSOR_SETTER); | 90 __ LoadAccessor(r4, holder, accessor_index, ACCESSOR_SETTER); |
87 __ InvokeFunction(r4, expected, actual, CALL_FUNCTION, | 91 __ InvokeFunction(r4, expected, actual, CALL_FUNCTION, |
88 CheckDebugStepCallWrapper()); | 92 CheckDebugStepCallWrapper()); |
89 } else { | 93 } else { |
90 // If we generate a global code snippet for deoptimization only, remember | 94 // If we generate a global code snippet for deoptimization only, remember |
91 // the place to continue after deoptimization. | 95 // the place to continue after deoptimization. |
92 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 96 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
93 } | 97 } |
94 | 98 |
95 // We have to return the passed value, not the return value of the setter. | 99 // We have to return the passed value, not the return value of the setter. |
96 __ pop(r3); | |
97 | |
98 // Restore context register. | 100 // Restore context register. |
99 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 101 __ Pop(cp, r3); |
100 } | 102 } |
101 __ Ret(); | 103 __ Ret(); |
102 } | 104 } |
103 | 105 |
104 | 106 |
105 void PropertyHandlerCompiler::PushVectorAndSlot(Register vector, | 107 void PropertyHandlerCompiler::PushVectorAndSlot(Register vector, |
106 Register slot) { | 108 Register slot) { |
107 MacroAssembler* masm = this->masm(); | 109 MacroAssembler* masm = this->masm(); |
108 __ Push(vector, slot); | 110 __ Push(vector, slot); |
109 } | 111 } |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 // Return the generated code. | 790 // Return the generated code. |
789 return GetCode(kind(), Code::NORMAL, name); | 791 return GetCode(kind(), Code::NORMAL, name); |
790 } | 792 } |
791 | 793 |
792 | 794 |
793 #undef __ | 795 #undef __ |
794 } // namespace internal | 796 } // namespace internal |
795 } // namespace v8 | 797 } // namespace v8 |
796 | 798 |
797 #endif // V8_TARGET_ARCH_ARM | 799 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |