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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 MacroAssembler* masm, Register receiver, Register holder, Register name, | 139 MacroAssembler* masm, Register receiver, Register holder, Register name, |
140 Handle<JSObject> holder_obj, IC::UtilityId id) { | 140 Handle<JSObject> holder_obj, IC::UtilityId id) { |
141 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 141 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
142 | 142 |
143 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), | 143 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), |
144 NamedLoadHandlerCompiler::kInterceptorArgsLength); | 144 NamedLoadHandlerCompiler::kInterceptorArgsLength); |
145 } | 145 } |
146 | 146 |
147 | 147 |
148 // Generate call to api function. | 148 // Generate call to api function. |
149 void PropertyHandlerCompiler::GenerateFastApiCall( | 149 void PropertyHandlerCompiler::GenerateApiAccessorCall( |
150 MacroAssembler* masm, const CallOptimization& optimization, | 150 MacroAssembler* masm, const CallOptimization& optimization, |
151 Handle<Map> receiver_map, Register receiver, Register scratch, | 151 Handle<Map> receiver_map, Register receiver, Register scratch, |
152 bool is_store, int argc, Register* values) { | 152 bool is_store, Register store_parameter) { |
153 DCHECK(!AreAliased(receiver, scratch)); | 153 DCHECK(!AreAliased(receiver, scratch)); |
154 | 154 |
155 MacroAssembler::PushPopQueue queue(masm); | 155 MacroAssembler::PushPopQueue queue(masm); |
156 queue.Queue(receiver); | 156 queue.Queue(receiver); |
157 // Write the arguments to the stack frame. | 157 // Write the arguments to the stack frame. |
158 for (int i = 0; i < argc; i++) { | 158 if (is_store) { |
159 Register arg = values[argc - 1 - i]; | 159 DCHECK(!receiver.is(store_parameter)); |
160 DCHECK(!AreAliased(receiver, scratch, arg)); | 160 DCHECK(!scratch.is(store_parameter)); |
161 queue.Queue(arg); | 161 queue.Queue(store_parameter); |
162 } | 162 } |
163 queue.PushQueued(); | 163 queue.PushQueued(); |
164 | 164 |
165 DCHECK(optimization.is_simple_api_call()); | 165 DCHECK(optimization.is_simple_api_call()); |
166 | 166 |
167 // Abi for CallApiFunctionStub. | 167 // Abi for CallApiFunctionStub. |
168 Register callee = x0; | 168 Register callee = x0; |
169 Register call_data = x4; | 169 Register call_data = x4; |
170 Register holder = x2; | 170 Register holder = x2; |
171 Register api_function_address = x1; | 171 Register api_function_address = x1; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 207 } |
208 | 208 |
209 // Put api_function_address in place. | 209 // Put api_function_address in place. |
210 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 210 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
211 ApiFunction fun(function_address); | 211 ApiFunction fun(function_address); |
212 ExternalReference ref = ExternalReference( | 212 ExternalReference ref = ExternalReference( |
213 &fun, ExternalReference::DIRECT_API_CALL, masm->isolate()); | 213 &fun, ExternalReference::DIRECT_API_CALL, masm->isolate()); |
214 __ Mov(api_function_address, ref); | 214 __ Mov(api_function_address, ref); |
215 | 215 |
216 // Jump to stub. | 216 // Jump to stub. |
217 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc); | 217 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); |
218 __ TailCallStub(&stub); | 218 __ TailCallStub(&stub); |
219 } | 219 } |
220 | 220 |
221 | 221 |
222 void NamedStoreHandlerCompiler::GenerateStoreViaSetter( | 222 void NamedStoreHandlerCompiler::GenerateStoreViaSetter( |
223 MacroAssembler* masm, Handle<HeapType> type, Register receiver, | 223 MacroAssembler* masm, Handle<HeapType> type, Register receiver, |
224 Handle<JSFunction> setter) { | 224 Handle<JSFunction> setter) { |
225 // ----------- S t a t e ------------- | 225 // ----------- S t a t e ------------- |
226 // -- lr : return address | 226 // -- lr : return address |
227 // ----------------------------------- | 227 // ----------------------------------- |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 // Return the generated code. | 746 // Return the generated code. |
747 return GetCode(kind(), Code::FAST, name); | 747 return GetCode(kind(), Code::FAST, name); |
748 } | 748 } |
749 | 749 |
750 | 750 |
751 #undef __ | 751 #undef __ |
752 } | 752 } |
753 } // namespace v8::internal | 753 } // namespace v8::internal |
754 | 754 |
755 #endif // V8_TARGET_ARCH_IA32 | 755 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |