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

Side by Side Diff: src/ic/mips/handler-compiler-mips.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/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips64/handler-compiler-mips64.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_MIPS 7 #if V8_TARGET_ARCH_MIPS
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 19 matching lines...) Expand all
30 if (accessor_index >= 0) { 30 if (accessor_index >= 0) {
31 // Call the JavaScript getter with the receiver on the stack. 31 // Call the JavaScript getter with the receiver on the stack.
32 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { 32 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
33 // Swap in the global receiver. 33 // Swap in the global receiver.
34 __ lw(receiver, 34 __ lw(receiver,
35 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); 35 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
36 } 36 }
37 __ push(receiver); 37 __ push(receiver);
38 ParameterCount actual(0); 38 ParameterCount actual(0);
39 ParameterCount expected(expected_arguments); 39 ParameterCount expected(expected_arguments);
40 Register scratch = holder; 40 __ LoadAccessor(a1, holder, accessor_index, ACCESSOR_GETTER);
41 __ lw(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
42 __ LoadInstanceDescriptors(scratch, scratch);
43 __ lw(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
44 accessor_index)));
45 __ lw(a1, FieldMemOperand(scratch, AccessorPair::kGetterOffset));
46 __ InvokeFunction(a1, expected, actual, CALL_FUNCTION, NullCallWrapper()); 41 __ InvokeFunction(a1, expected, actual, CALL_FUNCTION, NullCallWrapper());
47 } else { 42 } else {
48 // If we generate a global code snippet for deoptimization only, remember 43 // If we generate a global code snippet for deoptimization only, remember
49 // the place to continue after deoptimization. 44 // the place to continue after deoptimization.
50 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); 45 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
51 } 46 }
52 47
53 // Restore context register. 48 // Restore context register.
54 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 49 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
55 } 50 }
(...skipping 16 matching lines...) Expand all
72 if (accessor_index >= 0) { 67 if (accessor_index >= 0) {
73 // Call the JavaScript setter with receiver and value on the stack. 68 // Call the JavaScript setter with receiver and value on the stack.
74 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { 69 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
75 // Swap in the global receiver. 70 // Swap in the global receiver.
76 __ lw(receiver, 71 __ lw(receiver,
77 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); 72 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
78 } 73 }
79 __ Push(receiver, value()); 74 __ Push(receiver, value());
80 ParameterCount actual(1); 75 ParameterCount actual(1);
81 ParameterCount expected(expected_arguments); 76 ParameterCount expected(expected_arguments);
82 Register scratch = holder; 77 __ LoadAccessor(a1, holder, accessor_index, ACCESSOR_SETTER);
83 __ lw(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
84 __ LoadInstanceDescriptors(scratch, scratch);
85 __ lw(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
86 accessor_index)));
87 __ lw(a1, FieldMemOperand(scratch, AccessorPair::kSetterOffset));
88 __ InvokeFunction(a1, expected, actual, CALL_FUNCTION, NullCallWrapper()); 78 __ InvokeFunction(a1, expected, actual, CALL_FUNCTION, NullCallWrapper());
89 } else { 79 } else {
90 // If we generate a global code snippet for deoptimization only, remember 80 // If we generate a global code snippet for deoptimization only, remember
91 // the place to continue after deoptimization. 81 // the place to continue after deoptimization.
92 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); 82 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
93 } 83 }
94 84
95 // We have to return the passed value, not the return value of the setter. 85 // We have to return the passed value, not the return value of the setter.
96 __ pop(v0); 86 __ pop(v0);
97 87
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 // Return the generated code. 724 // Return the generated code.
735 return GetCode(kind(), Code::NORMAL, name); 725 return GetCode(kind(), Code::NORMAL, name);
736 } 726 }
737 727
738 728
739 #undef __ 729 #undef __
740 } 730 }
741 } // namespace v8::internal 731 } // namespace v8::internal
742 732
743 #endif // V8_TARGET_ARCH_MIPS 733 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips64/handler-compiler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698