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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 20 matching lines...) Expand all Loading... |
31 DCHECK(!holder.is(scratch)); | 31 DCHECK(!holder.is(scratch)); |
32 DCHECK(!receiver.is(scratch)); | 32 DCHECK(!receiver.is(scratch)); |
33 // Call the JavaScript getter with the receiver on the stack. | 33 // Call the JavaScript getter with the receiver on the stack. |
34 if (map->IsJSGlobalObjectMap()) { | 34 if (map->IsJSGlobalObjectMap()) { |
35 // Swap in the global receiver. | 35 // Swap in the global receiver. |
36 __ mov(scratch, | 36 __ mov(scratch, |
37 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); | 37 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
38 receiver = scratch; | 38 receiver = scratch; |
39 } | 39 } |
40 __ push(receiver); | 40 __ push(receiver); |
41 ParameterCount actual(0); | |
42 ParameterCount expected(expected_arguments); | |
43 __ LoadAccessor(edi, holder, accessor_index, ACCESSOR_GETTER); | 41 __ LoadAccessor(edi, holder, accessor_index, ACCESSOR_GETTER); |
44 __ InvokeFunction(edi, expected, actual, CALL_FUNCTION, | 42 __ Set(eax, 0); |
45 CheckDebugStepCallWrapper()); | 43 __ Call(masm->isolate()->builtins()->CallFunction( |
| 44 ConvertReceiverMode::kNotNullOrUndefined), |
| 45 RelocInfo::CODE_TARGET); |
46 } else { | 46 } else { |
47 // If we generate a global code snippet for deoptimization only, remember | 47 // If we generate a global code snippet for deoptimization only, remember |
48 // the place to continue after deoptimization. | 48 // the place to continue after deoptimization. |
49 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); | 49 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); |
50 } | 50 } |
51 | 51 |
52 // Restore context register. | 52 // Restore context register. |
53 __ pop(esi); | 53 __ pop(esi); |
54 } | 54 } |
55 __ ret(0); | 55 __ ret(0); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 DCHECK(!receiver.is(scratch)); | 266 DCHECK(!receiver.is(scratch)); |
267 DCHECK(!value().is(scratch)); | 267 DCHECK(!value().is(scratch)); |
268 // Call the JavaScript setter with receiver and value on the stack. | 268 // Call the JavaScript setter with receiver and value on the stack. |
269 if (map->IsJSGlobalObjectMap()) { | 269 if (map->IsJSGlobalObjectMap()) { |
270 __ mov(scratch, | 270 __ mov(scratch, |
271 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); | 271 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
272 receiver = scratch; | 272 receiver = scratch; |
273 } | 273 } |
274 __ push(receiver); | 274 __ push(receiver); |
275 __ push(value()); | 275 __ push(value()); |
276 ParameterCount actual(1); | |
277 ParameterCount expected(expected_arguments); | |
278 __ LoadAccessor(edi, holder, accessor_index, ACCESSOR_SETTER); | 276 __ LoadAccessor(edi, holder, accessor_index, ACCESSOR_SETTER); |
279 __ InvokeFunction(edi, expected, actual, CALL_FUNCTION, | 277 __ Set(eax, 1); |
280 CheckDebugStepCallWrapper()); | 278 __ Call(masm->isolate()->builtins()->CallFunction( |
| 279 ConvertReceiverMode::kNotNullOrUndefined), |
| 280 RelocInfo::CODE_TARGET); |
281 } else { | 281 } else { |
282 // If we generate a global code snippet for deoptimization only, remember | 282 // If we generate a global code snippet for deoptimization only, remember |
283 // the place to continue after deoptimization. | 283 // the place to continue after deoptimization. |
284 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 284 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
285 } | 285 } |
286 | 286 |
287 // We have to return the passed value, not the return value of the setter. | 287 // We have to return the passed value, not the return value of the setter. |
288 __ pop(eax); | 288 __ pop(eax); |
289 // Restore context register. | 289 // Restore context register. |
290 __ pop(esi); | 290 __ pop(esi); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 // Return the generated code. | 803 // Return the generated code. |
804 return GetCode(kind(), Code::NORMAL, name); | 804 return GetCode(kind(), Code::NORMAL, name); |
805 } | 805 } |
806 | 806 |
807 | 807 |
808 #undef __ | 808 #undef __ |
809 } // namespace internal | 809 } // namespace internal |
810 } // namespace v8 | 810 } // namespace v8 |
811 | 811 |
812 #endif // V8_TARGET_ARCH_IA32 | 812 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |