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

Side by Side Diff: src/ic/ia32/handler-compiler-ia32.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/arm64/handler-compiler-arm64.cc ('k') | src/ic/mips/handler-compiler-mips.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_IA32 7 #if V8_TARGET_ARCH_IA32
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 14 matching lines...) Expand all
25 if (accessor_index >= 0) { 25 if (accessor_index >= 0) {
26 // Call the JavaScript getter with the receiver on the stack. 26 // Call the JavaScript getter with the receiver on the stack.
27 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { 27 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
28 // Swap in the global receiver. 28 // Swap in the global receiver.
29 __ mov(receiver, 29 __ mov(receiver,
30 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); 30 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
31 } 31 }
32 __ push(receiver); 32 __ push(receiver);
33 ParameterCount actual(0); 33 ParameterCount actual(0);
34 ParameterCount expected(expected_arguments); 34 ParameterCount expected(expected_arguments);
35 Register scratch = holder; 35 __ LoadAccessor(edi, holder, accessor_index, ACCESSOR_GETTER);
36 __ mov(scratch, FieldOperand(holder, HeapObject::kMapOffset));
37 __ LoadInstanceDescriptors(scratch, scratch);
38 __ mov(scratch, FieldOperand(scratch, DescriptorArray::GetValueOffset(
39 accessor_index)));
40 __ mov(edi, FieldOperand(scratch, AccessorPair::kGetterOffset));
41 __ InvokeFunction(edi, expected, actual, CALL_FUNCTION, 36 __ InvokeFunction(edi, expected, actual, CALL_FUNCTION,
42 NullCallWrapper()); 37 NullCallWrapper());
43 } else { 38 } else {
44 // If we generate a global code snippet for deoptimization only, remember 39 // If we generate a global code snippet for deoptimization only, remember
45 // the place to continue after deoptimization. 40 // the place to continue after deoptimization.
46 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); 41 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
47 } 42 }
48 43
49 // Restore context register. 44 // Restore context register.
50 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 45 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 // Call the JavaScript setter with receiver and value on the stack. 245 // Call the JavaScript setter with receiver and value on the stack.
251 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { 246 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
252 // Swap in the global receiver. 247 // Swap in the global receiver.
253 __ mov(receiver, 248 __ mov(receiver,
254 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); 249 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
255 } 250 }
256 __ push(receiver); 251 __ push(receiver);
257 __ push(value()); 252 __ push(value());
258 ParameterCount actual(1); 253 ParameterCount actual(1);
259 ParameterCount expected(expected_arguments); 254 ParameterCount expected(expected_arguments);
260 Register scratch = holder; 255 __ LoadAccessor(edi, holder, accessor_index, ACCESSOR_SETTER);
261 __ mov(scratch, FieldOperand(holder, HeapObject::kMapOffset));
262 __ LoadInstanceDescriptors(scratch, scratch);
263 __ mov(scratch, FieldOperand(scratch, DescriptorArray::GetValueOffset(
264 accessor_index)));
265 __ mov(edi, FieldOperand(scratch, AccessorPair::kSetterOffset));
266 __ InvokeFunction(edi, expected, actual, CALL_FUNCTION, 256 __ InvokeFunction(edi, expected, actual, CALL_FUNCTION,
267 NullCallWrapper()); 257 NullCallWrapper());
268 } else { 258 } else {
269 // If we generate a global code snippet for deoptimization only, remember 259 // If we generate a global code snippet for deoptimization only, remember
270 // the place to continue after deoptimization. 260 // the place to continue after deoptimization.
271 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); 261 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
272 } 262 }
273 263
274 // We have to return the passed value, not the return value of the setter. 264 // We have to return the passed value, not the return value of the setter.
275 __ pop(eax); 265 __ pop(eax);
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 // Return the generated code. 756 // Return the generated code.
767 return GetCode(kind(), Code::NORMAL, name); 757 return GetCode(kind(), Code::NORMAL, name);
768 } 758 }
769 759
770 760
771 #undef __ 761 #undef __
772 } 762 }
773 } // namespace v8::internal 763 } // namespace v8::internal
774 764
775 #endif // V8_TARGET_ARCH_IA32 765 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ic/arm64/handler-compiler-arm64.cc ('k') | src/ic/mips/handler-compiler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698