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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 __ Mov(api_function_address, ref); | 214 __ Mov(api_function_address, ref); |
215 | 215 |
216 // Jump to stub. | 216 // Jump to stub. |
217 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); | 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 Register holder, int accessor_index, int expected_arguments) { | 224 Register holder, int accessor_index, int expected_arguments, |
| 225 Register scratch) { |
225 // ----------- S t a t e ------------- | 226 // ----------- S t a t e ------------- |
226 // -- lr : return address | 227 // -- lr : return address |
227 // ----------------------------------- | 228 // ----------------------------------- |
228 Label miss; | 229 Label miss; |
229 | |
230 { | 230 { |
231 FrameScope scope(masm, StackFrame::INTERNAL); | 231 FrameScope scope(masm, StackFrame::INTERNAL); |
232 | 232 |
233 // Save value register, so we can restore it later. | 233 // Save value register, so we can restore it later. |
234 __ Push(value()); | 234 __ Push(value()); |
235 | 235 |
236 if (accessor_index >= 0) { | 236 if (accessor_index >= 0) { |
| 237 DCHECK(!AreAliased(holder, scratch)); |
| 238 DCHECK(!AreAliased(receiver, scratch)); |
| 239 DCHECK(!AreAliased(value(), scratch)); |
237 // Call the JavaScript setter with receiver and value on the stack. | 240 // Call the JavaScript setter with receiver and value on the stack. |
238 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { | 241 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
239 // Swap in the global receiver. | 242 // Swap in the global receiver. |
240 __ Ldr(receiver, | 243 __ Ldr(scratch, |
241 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); | 244 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
| 245 receiver = scratch; |
242 } | 246 } |
243 __ Push(receiver, value()); | 247 __ Push(receiver, value()); |
244 ParameterCount actual(1); | 248 ParameterCount actual(1); |
245 ParameterCount expected(expected_arguments); | 249 ParameterCount expected(expected_arguments); |
246 __ LoadAccessor(x1, holder, accessor_index, ACCESSOR_SETTER); | 250 __ LoadAccessor(x1, holder, accessor_index, ACCESSOR_SETTER); |
247 __ InvokeFunction(x1, expected, actual, CALL_FUNCTION, NullCallWrapper()); | 251 __ InvokeFunction(x1, expected, actual, CALL_FUNCTION, NullCallWrapper()); |
248 } else { | 252 } else { |
249 // If we generate a global code snippet for deoptimization only, remember | 253 // If we generate a global code snippet for deoptimization only, remember |
250 // the place to continue after deoptimization. | 254 // the place to continue after deoptimization. |
251 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 255 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
252 } | 256 } |
253 | 257 |
254 // We have to return the passed value, not the return value of the setter. | 258 // We have to return the passed value, not the return value of the setter. |
255 __ Pop(x0); | 259 __ Pop(x0); |
256 | 260 |
257 // Restore context register. | 261 // Restore context register. |
258 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 262 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
259 } | 263 } |
260 __ Ret(); | 264 __ Ret(); |
261 } | 265 } |
262 | 266 |
263 | 267 |
264 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( | 268 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( |
265 MacroAssembler* masm, Handle<HeapType> type, Register receiver, | 269 MacroAssembler* masm, Handle<HeapType> type, Register receiver, |
266 Register holder, int accessor_index, int expected_arguments) { | 270 Register holder, int accessor_index, int expected_arguments, |
| 271 Register scratch) { |
267 { | 272 { |
268 FrameScope scope(masm, StackFrame::INTERNAL); | 273 FrameScope scope(masm, StackFrame::INTERNAL); |
269 | 274 |
270 if (accessor_index >= 0) { | 275 if (accessor_index >= 0) { |
| 276 DCHECK(!AreAliased(holder, scratch)); |
| 277 DCHECK(!AreAliased(receiver, scratch)); |
271 // Call the JavaScript getter with the receiver on the stack. | 278 // Call the JavaScript getter with the receiver on the stack. |
272 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { | 279 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
273 // Swap in the global receiver. | 280 // Swap in the global receiver. |
274 __ Ldr(receiver, | 281 __ Ldr(scratch, |
275 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); | 282 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
| 283 receiver = scratch; |
276 } | 284 } |
277 __ Push(receiver); | 285 __ Push(receiver); |
278 ParameterCount actual(0); | 286 ParameterCount actual(0); |
279 ParameterCount expected(expected_arguments); | 287 ParameterCount expected(expected_arguments); |
280 __ LoadAccessor(x1, holder, accessor_index, ACCESSOR_GETTER); | 288 __ LoadAccessor(x1, holder, accessor_index, ACCESSOR_GETTER); |
281 __ InvokeFunction(x1, expected, actual, CALL_FUNCTION, NullCallWrapper()); | 289 __ InvokeFunction(x1, expected, actual, CALL_FUNCTION, NullCallWrapper()); |
282 } else { | 290 } else { |
283 // If we generate a global code snippet for deoptimization only, remember | 291 // If we generate a global code snippet for deoptimization only, remember |
284 // the place to continue after deoptimization. | 292 // the place to continue after deoptimization. |
285 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); | 293 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 // Return the generated code. | 754 // Return the generated code. |
747 return GetCode(kind(), Code::FAST, name); | 755 return GetCode(kind(), Code::FAST, name); |
748 } | 756 } |
749 | 757 |
750 | 758 |
751 #undef __ | 759 #undef __ |
752 } | 760 } |
753 } // namespace v8::internal | 761 } // namespace v8::internal |
754 | 762 |
755 #endif // V8_TARGET_ARCH_IA32 | 763 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |