Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/ic/arm64/handler-compiler-arm64.cc

Issue 886503002: Extract LoadAccessor into a masm function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix whitespace Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic/arm/handler-compiler-arm.cc ('k') | src/ic/ia32/handler-compiler-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 if (accessor_index >= 0) { 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(expected_arguments); 245 ParameterCount expected(expected_arguments);
246 Register scratch = holder; 246 __ LoadAccessor(x1, holder, accessor_index, ACCESSOR_SETTER);
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()); 247 __ InvokeFunction(x1, expected, actual, CALL_FUNCTION, NullCallWrapper());
253 } else { 248 } else {
254 // If we generate a global code snippet for deoptimization only, remember 249 // If we generate a global code snippet for deoptimization only, remember
255 // the place to continue after deoptimization. 250 // the place to continue after deoptimization.
256 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); 251 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
257 } 252 }
258 253
259 // We have to return the passed value, not the return value of the setter. 254 // We have to return the passed value, not the return value of the setter.
260 __ Pop(x0); 255 __ Pop(x0);
261 256
(...skipping 13 matching lines...) Expand all
275 if (accessor_index >= 0) { 270 if (accessor_index >= 0) {
276 // Call the JavaScript getter with the receiver on the stack. 271 // Call the JavaScript getter with the receiver on the stack.
277 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { 272 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
278 // Swap in the global receiver. 273 // Swap in the global receiver.
279 __ Ldr(receiver, 274 __ Ldr(receiver,
280 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); 275 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
281 } 276 }
282 __ Push(receiver); 277 __ Push(receiver);
283 ParameterCount actual(0); 278 ParameterCount actual(0);
284 ParameterCount expected(expected_arguments); 279 ParameterCount expected(expected_arguments);
285 Register scratch = holder; 280 __ LoadAccessor(x1, holder, accessor_index, ACCESSOR_GETTER);
286 __ Ldr(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
287 __ LoadInstanceDescriptors(scratch, scratch);
288 __ Ldr(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
289 accessor_index)));
290 __ Ldr(x1, FieldMemOperand(scratch, AccessorPair::kGetterOffset));
291 __ InvokeFunction(x1, expected, actual, CALL_FUNCTION, NullCallWrapper()); 281 __ InvokeFunction(x1, expected, actual, CALL_FUNCTION, NullCallWrapper());
292 } else { 282 } else {
293 // If we generate a global code snippet for deoptimization only, remember 283 // If we generate a global code snippet for deoptimization only, remember
294 // the place to continue after deoptimization. 284 // the place to continue after deoptimization.
295 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); 285 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
296 } 286 }
297 287
298 // Restore context register. 288 // Restore context register.
299 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 289 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
300 } 290 }
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 // Return the generated code. 746 // Return the generated code.
757 return GetCode(kind(), Code::FAST, name); 747 return GetCode(kind(), Code::FAST, name);
758 } 748 }
759 749
760 750
761 #undef __ 751 #undef __
762 } 752 }
763 } // namespace v8::internal 753 } // namespace v8::internal
764 754
765 #endif // V8_TARGET_ARCH_IA32 755 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ic/arm/handler-compiler-arm.cc ('k') | src/ic/ia32/handler-compiler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698