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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 if (accessor_index >= 0) { | 30 if (accessor_index >= 0) { |
31 // Call the JavaScript getter with the receiver on the stack. | 31 // Call the JavaScript getter with the receiver on the stack. |
32 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { | 32 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
33 // Swap in the global receiver. | 33 // Swap in the global receiver. |
34 __ ldr(receiver, | 34 __ ldr(receiver, |
35 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); | 35 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
36 } | 36 } |
37 __ push(receiver); | 37 __ push(receiver); |
38 ParameterCount actual(0); | 38 ParameterCount actual(0); |
39 ParameterCount expected(expected_arguments); | 39 ParameterCount expected(expected_arguments); |
40 Register scratch = holder; | 40 __ LoadAccessor(r1, holder, accessor_index, ACCESSOR_GETTER); |
41 __ ldr(scratch, FieldMemOperand(holder, HeapObject::kMapOffset)); | |
42 __ LoadInstanceDescriptors(scratch, scratch); | |
43 __ ldr(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset( | |
44 accessor_index))); | |
45 __ ldr(r1, FieldMemOperand(scratch, AccessorPair::kGetterOffset)); | |
46 __ InvokeFunction(r1, expected, actual, CALL_FUNCTION, NullCallWrapper()); | 41 __ InvokeFunction(r1, expected, actual, CALL_FUNCTION, NullCallWrapper()); |
47 } else { | 42 } else { |
48 // If we generate a global code snippet for deoptimization only, remember | 43 // If we generate a global code snippet for deoptimization only, remember |
49 // the place to continue after deoptimization. | 44 // the place to continue after deoptimization. |
50 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); | 45 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); |
51 } | 46 } |
52 | 47 |
53 // Restore context register. | 48 // Restore context register. |
54 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 49 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
55 } | 50 } |
(...skipping 16 matching lines...) Expand all Loading... |
72 if (accessor_index >= 0) { | 67 if (accessor_index >= 0) { |
73 // Call the JavaScript setter with receiver and value on the stack. | 68 // Call the JavaScript setter with receiver and value on the stack. |
74 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { | 69 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
75 // Swap in the global receiver. | 70 // Swap in the global receiver. |
76 __ ldr(receiver, | 71 __ ldr(receiver, |
77 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); | 72 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
78 } | 73 } |
79 __ Push(receiver, value()); | 74 __ Push(receiver, value()); |
80 ParameterCount actual(1); | 75 ParameterCount actual(1); |
81 ParameterCount expected(expected_arguments); | 76 ParameterCount expected(expected_arguments); |
82 Register scratch = holder; | 77 __ LoadAccessor(r1, holder, accessor_index, ACCESSOR_SETTER); |
83 __ ldr(scratch, FieldMemOperand(holder, HeapObject::kMapOffset)); | |
84 __ LoadInstanceDescriptors(scratch, scratch); | |
85 __ ldr(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset( | |
86 accessor_index))); | |
87 __ ldr(r1, FieldMemOperand(scratch, AccessorPair::kSetterOffset)); | |
88 __ InvokeFunction(r1, expected, actual, CALL_FUNCTION, NullCallWrapper()); | 78 __ InvokeFunction(r1, expected, actual, CALL_FUNCTION, NullCallWrapper()); |
89 } else { | 79 } else { |
90 // If we generate a global code snippet for deoptimization only, remember | 80 // If we generate a global code snippet for deoptimization only, remember |
91 // the place to continue after deoptimization. | 81 // the place to continue after deoptimization. |
92 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 82 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
93 } | 83 } |
94 | 84 |
95 // We have to return the passed value, not the return value of the setter. | 85 // We have to return the passed value, not the return value of the setter. |
96 __ pop(r0); | 86 __ pop(r0); |
97 | 87 |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 // Return the generated code. | 730 // Return the generated code. |
741 return GetCode(kind(), Code::NORMAL, name); | 731 return GetCode(kind(), Code::NORMAL, name); |
742 } | 732 } |
743 | 733 |
744 | 734 |
745 #undef __ | 735 #undef __ |
746 } | 736 } |
747 } // namespace v8::internal | 737 } // namespace v8::internal |
748 | 738 |
749 #endif // V8_TARGET_ARCH_ARM | 739 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |