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

Side by Side Diff: src/ic/x64/handler-compiler-x64.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/mips64/handler-compiler-mips64.cc ('k') | src/ic/x87/handler-compiler-x87.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_X64 7 #if V8_TARGET_ARCH_X64
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 // Call the JavaScript setter with receiver and value on the stack. 228 // Call the JavaScript setter with receiver and value on the stack.
229 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { 229 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
230 // Swap in the global receiver. 230 // Swap in the global receiver.
231 __ movp(receiver, 231 __ movp(receiver,
232 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); 232 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
233 } 233 }
234 __ Push(receiver); 234 __ Push(receiver);
235 __ Push(value()); 235 __ Push(value());
236 ParameterCount actual(1); 236 ParameterCount actual(1);
237 ParameterCount expected(expected_arguments); 237 ParameterCount expected(expected_arguments);
238 Register scratch = holder; 238 __ LoadAccessor(rdi, holder, accessor_index, ACCESSOR_SETTER);
239 __ movp(scratch, FieldOperand(holder, HeapObject::kMapOffset));
240 __ LoadInstanceDescriptors(scratch, scratch);
241 __ movp(scratch, FieldOperand(scratch, DescriptorArray::GetValueOffset(
242 accessor_index)));
243 __ movp(rdi, FieldOperand(scratch, AccessorPair::kSetterOffset));
244 __ InvokeFunction(rdi, expected, actual, CALL_FUNCTION, 239 __ InvokeFunction(rdi, expected, actual, CALL_FUNCTION,
245 NullCallWrapper()); 240 NullCallWrapper());
246 } else { 241 } else {
247 // If we generate a global code snippet for deoptimization only, remember 242 // If we generate a global code snippet for deoptimization only, remember
248 // the place to continue after deoptimization. 243 // the place to continue after deoptimization.
249 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); 244 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
250 } 245 }
251 246
252 // We have to return the passed value, not the return value of the setter. 247 // We have to return the passed value, not the return value of the setter.
253 __ Pop(rax); 248 __ Pop(rax);
(...skipping 19 matching lines...) Expand all
273 if (accessor_index >= 0) { 268 if (accessor_index >= 0) {
274 // Call the JavaScript getter with the receiver on the stack. 269 // Call the JavaScript getter with the receiver on the stack.
275 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { 270 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
276 // Swap in the global receiver. 271 // Swap in the global receiver.
277 __ movp(receiver, 272 __ movp(receiver,
278 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); 273 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
279 } 274 }
280 __ Push(receiver); 275 __ Push(receiver);
281 ParameterCount actual(0); 276 ParameterCount actual(0);
282 ParameterCount expected(expected_arguments); 277 ParameterCount expected(expected_arguments);
283 Register scratch = holder; 278 __ LoadAccessor(rdi, holder, accessor_index, ACCESSOR_GETTER);
284 __ movp(scratch, FieldOperand(holder, HeapObject::kMapOffset));
285 __ LoadInstanceDescriptors(scratch, scratch);
286 __ movp(scratch, FieldOperand(scratch, DescriptorArray::GetValueOffset(
287 accessor_index)));
288 __ movp(rdi, FieldOperand(scratch, AccessorPair::kGetterOffset));
289 __ InvokeFunction(rdi, expected, actual, CALL_FUNCTION, 279 __ InvokeFunction(rdi, expected, actual, CALL_FUNCTION,
290 NullCallWrapper()); 280 NullCallWrapper());
291 } else { 281 } else {
292 // If we generate a global code snippet for deoptimization only, remember 282 // If we generate a global code snippet for deoptimization only, remember
293 // the place to continue after deoptimization. 283 // the place to continue after deoptimization.
294 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); 284 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
295 } 285 }
296 286
297 // Restore context register. 287 // Restore context register.
298 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 288 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 // Return the generated code. 743 // Return the generated code.
754 return GetCode(kind(), Code::NORMAL, name); 744 return GetCode(kind(), Code::NORMAL, name);
755 } 745 }
756 746
757 747
758 #undef __ 748 #undef __
759 } 749 }
760 } // namespace v8::internal 750 } // namespace v8::internal
761 751
762 #endif // V8_TARGET_ARCH_X64 752 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ic/mips64/handler-compiler-mips64.cc ('k') | src/ic/x87/handler-compiler-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698