| 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 Handle<JSFunction> setter) { | 224 Register holder, int accessor_index, int expected_arguments) { |
| 225 // ----------- S t a t e ------------- | 225 // ----------- S t a t e ------------- |
| 226 // -- lr : return address | 226 // -- lr : return address |
| 227 // ----------------------------------- | 227 // ----------------------------------- |
| 228 Label miss; | 228 Label miss; |
| 229 | 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 (!setter.is_null()) { | 236 if (accessor_index >= 0) { |
| 237 // Call the JavaScript setter with receiver and value on the stack. | 237 // Call the JavaScript setter with receiver and value on the stack. |
| 238 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { | 238 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
| 239 // Swap in the global receiver. | 239 // Swap in the global receiver. |
| 240 __ Ldr(receiver, | 240 __ Ldr(receiver, |
| 241 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); | 241 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
| 242 } | 242 } |
| 243 __ Push(receiver, value()); | 243 __ Push(receiver, value()); |
| 244 ParameterCount actual(1); | 244 ParameterCount actual(1); |
| 245 ParameterCount expected(setter); | 245 ParameterCount expected(expected_arguments); |
| 246 __ InvokeFunction(setter, expected, actual, CALL_FUNCTION, | 246 Register scratch = holder; |
| 247 NullCallWrapper()); | 247 __ Ldr(scratch, FieldMemOperand(holder, HeapObject::kMapOffset)); |
| 248 __ LoadInstanceDescriptors(scratch, scratch); |
| 249 __ Ldr(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset( |
| 250 accessor_index))); |
| 251 __ Ldr(x1, FieldMemOperand(scratch, AccessorPair::kSetterOffset)); |
| 252 __ InvokeFunction(x1, expected, actual, CALL_FUNCTION, NullCallWrapper()); |
| 248 } else { | 253 } else { |
| 249 // If we generate a global code snippet for deoptimization only, remember | 254 // If we generate a global code snippet for deoptimization only, remember |
| 250 // the place to continue after deoptimization. | 255 // the place to continue after deoptimization. |
| 251 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 256 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
| 252 } | 257 } |
| 253 | 258 |
| 254 // We have to return the passed value, not the return value of the setter. | 259 // We have to return the passed value, not the return value of the setter. |
| 255 __ Pop(x0); | 260 __ Pop(x0); |
| 256 | 261 |
| 257 // Restore context register. | 262 // Restore context register. |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 // Return the generated code. | 756 // Return the generated code. |
| 752 return GetCode(kind(), Code::FAST, name); | 757 return GetCode(kind(), Code::FAST, name); |
| 753 } | 758 } |
| 754 | 759 |
| 755 | 760 |
| 756 #undef __ | 761 #undef __ |
| 757 } | 762 } |
| 758 } // namespace v8::internal | 763 } // namespace v8::internal |
| 759 | 764 |
| 760 #endif // V8_TARGET_ARCH_IA32 | 765 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |