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_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 | 8 |
9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 DCHECK(!value().is(scratch)); | 250 DCHECK(!value().is(scratch)); |
251 // Call the JavaScript setter with receiver and value on the stack. | 251 // Call the JavaScript setter with receiver and value on the stack. |
252 if (map->IsJSGlobalObjectMap()) { | 252 if (map->IsJSGlobalObjectMap()) { |
253 // Swap in the global receiver. | 253 // Swap in the global receiver. |
254 __ movp(scratch, | 254 __ movp(scratch, |
255 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); | 255 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
256 receiver = scratch; | 256 receiver = scratch; |
257 } | 257 } |
258 __ Push(receiver); | 258 __ Push(receiver); |
259 __ Push(value()); | 259 __ Push(value()); |
260 ParameterCount actual(1); | |
261 ParameterCount expected(expected_arguments); | |
262 __ LoadAccessor(rdi, holder, accessor_index, ACCESSOR_SETTER); | 260 __ LoadAccessor(rdi, holder, accessor_index, ACCESSOR_SETTER); |
263 __ InvokeFunction(rdi, no_reg, expected, actual, CALL_FUNCTION, | 261 __ Set(rax, 1); |
264 CheckDebugStepCallWrapper()); | 262 __ Call(masm->isolate()->builtins()->CallFunction( |
| 263 ConvertReceiverMode::kNotNullOrUndefined), |
| 264 RelocInfo::CODE_TARGET); |
265 } else { | 265 } else { |
266 // If we generate a global code snippet for deoptimization only, remember | 266 // If we generate a global code snippet for deoptimization only, remember |
267 // the place to continue after deoptimization. | 267 // the place to continue after deoptimization. |
268 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 268 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
269 } | 269 } |
270 | 270 |
271 // We have to return the passed value, not the return value of the setter. | 271 // We have to return the passed value, not the return value of the setter. |
272 __ Pop(rax); | 272 __ Pop(rax); |
273 | 273 |
274 // Restore context register. | 274 // Restore context register. |
(...skipping 21 matching lines...) Expand all Loading... |
296 DCHECK(!holder.is(scratch)); | 296 DCHECK(!holder.is(scratch)); |
297 DCHECK(!receiver.is(scratch)); | 297 DCHECK(!receiver.is(scratch)); |
298 // Call the JavaScript getter with the receiver on the stack. | 298 // Call the JavaScript getter with the receiver on the stack. |
299 if (map->IsJSGlobalObjectMap()) { | 299 if (map->IsJSGlobalObjectMap()) { |
300 // Swap in the global receiver. | 300 // Swap in the global receiver. |
301 __ movp(scratch, | 301 __ movp(scratch, |
302 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); | 302 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
303 receiver = scratch; | 303 receiver = scratch; |
304 } | 304 } |
305 __ Push(receiver); | 305 __ Push(receiver); |
306 ParameterCount actual(0); | |
307 ParameterCount expected(expected_arguments); | |
308 __ LoadAccessor(rdi, holder, accessor_index, ACCESSOR_GETTER); | 306 __ LoadAccessor(rdi, holder, accessor_index, ACCESSOR_GETTER); |
309 __ InvokeFunction(rdi, no_reg, expected, actual, CALL_FUNCTION, | 307 __ Set(rax, 0); |
310 CheckDebugStepCallWrapper()); | 308 __ Call(masm->isolate()->builtins()->CallFunction( |
| 309 ConvertReceiverMode::kNotNullOrUndefined), |
| 310 RelocInfo::CODE_TARGET); |
311 } else { | 311 } else { |
312 // If we generate a global code snippet for deoptimization only, remember | 312 // If we generate a global code snippet for deoptimization only, remember |
313 // the place to continue after deoptimization. | 313 // the place to continue after deoptimization. |
314 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); | 314 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); |
315 } | 315 } |
316 | 316 |
317 // Restore context register. | 317 // Restore context register. |
318 __ popq(rsi); | 318 __ popq(rsi); |
319 } | 319 } |
320 __ ret(0); | 320 __ ret(0); |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 // Return the generated code. | 800 // Return the generated code. |
801 return GetCode(kind(), Code::NORMAL, name); | 801 return GetCode(kind(), Code::NORMAL, name); |
802 } | 802 } |
803 | 803 |
804 | 804 |
805 #undef __ | 805 #undef __ |
806 } // namespace internal | 806 } // namespace internal |
807 } // namespace v8 | 807 } // namespace v8 |
808 | 808 |
809 #endif // V8_TARGET_ARCH_X64 | 809 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |