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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback, rebase and "git cl format" Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/lithium-inl.h ('k') | src/mips/deoptimizer-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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
11 #include "src/codegen.h" 11 #include "src/codegen.h"
12 #include "src/regexp-macro-assembler.h" 12 #include "src/regexp-macro-assembler.h"
13 #include "src/stub-cache.h" 13 #include "src/stub-cache.h"
14 14
15 namespace v8 { 15 namespace v8 {
16 namespace internal { 16 namespace internal {
17 17
18 18
19 void FastNewClosureStub::InitializeInterfaceDescriptor( 19 void FastNewClosureStub::InitializeInterfaceDescriptor(
20 CodeStubInterfaceDescriptor* descriptor) { 20 CodeStubInterfaceDescriptor* descriptor) {
21 Register registers[] = { cp, a2 }; 21 Register registers[] = { cp, a2 };
22 descriptor->Initialize( 22 descriptor->Initialize(
23 ARRAY_SIZE(registers), registers, 23 MajorKey(), ARRAY_SIZE(registers), registers,
24 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry); 24 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry);
25 } 25 }
26 26
27 27
28 void FastNewContextStub::InitializeInterfaceDescriptor( 28 void FastNewContextStub::InitializeInterfaceDescriptor(
29 CodeStubInterfaceDescriptor* descriptor) { 29 CodeStubInterfaceDescriptor* descriptor) {
30 Register registers[] = { cp, a1 }; 30 Register registers[] = { cp, a1 };
31 descriptor->Initialize(ARRAY_SIZE(registers), registers); 31 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers);
32 } 32 }
33 33
34 34
35 void ToNumberStub::InitializeInterfaceDescriptor( 35 void ToNumberStub::InitializeInterfaceDescriptor(
36 CodeStubInterfaceDescriptor* descriptor) { 36 CodeStubInterfaceDescriptor* descriptor) {
37 Register registers[] = { cp, a0 }; 37 Register registers[] = { cp, a0 };
38 descriptor->Initialize(ARRAY_SIZE(registers), registers); 38 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers);
39 } 39 }
40 40
41 41
42 void NumberToStringStub::InitializeInterfaceDescriptor( 42 void NumberToStringStub::InitializeInterfaceDescriptor(
43 CodeStubInterfaceDescriptor* descriptor) { 43 CodeStubInterfaceDescriptor* descriptor) {
44 Register registers[] = { cp, a0 }; 44 Register registers[] = { cp, a0 };
45 descriptor->Initialize( 45 descriptor->Initialize(
46 ARRAY_SIZE(registers), registers, 46 MajorKey(), ARRAY_SIZE(registers), registers,
47 Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry); 47 Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry);
48 } 48 }
49 49
50 50
51 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 51 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
52 CodeStubInterfaceDescriptor* descriptor) { 52 CodeStubInterfaceDescriptor* descriptor) {
53 Register registers[] = { cp, a3, a2, a1 }; 53 Register registers[] = { cp, a3, a2, a1 };
54 Representation representations[] = { 54 Representation representations[] = {
55 Representation::Tagged(), 55 Representation::Tagged(),
56 Representation::Tagged(), 56 Representation::Tagged(),
57 Representation::Smi(), 57 Representation::Smi(),
58 Representation::Tagged() }; 58 Representation::Tagged() };
59 descriptor->Initialize( 59 descriptor->Initialize(
60 ARRAY_SIZE(registers), registers, 60 MajorKey(), ARRAY_SIZE(registers), registers,
61 Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry, 61 Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry,
62 representations); 62 representations);
63 } 63 }
64 64
65 65
66 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 66 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
67 CodeStubInterfaceDescriptor* descriptor) { 67 CodeStubInterfaceDescriptor* descriptor) {
68 Register registers[] = { cp, a3, a2, a1, a0 }; 68 Register registers[] = { cp, a3, a2, a1, a0 };
69 descriptor->Initialize( 69 descriptor->Initialize(
70 ARRAY_SIZE(registers), registers, 70 MajorKey(), ARRAY_SIZE(registers), registers,
71 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry); 71 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry);
72 } 72 }
73 73
74 74
75 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( 75 void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
76 CodeStubInterfaceDescriptor* descriptor) { 76 CodeStubInterfaceDescriptor* descriptor) {
77 Register registers[] = { cp, a2, a3 }; 77 Register registers[] = { cp, a2, a3 };
78 descriptor->Initialize(ARRAY_SIZE(registers), registers); 78 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers);
79 } 79 }
80 80
81 81
82 void InstanceofStub::InitializeInterfaceDescriptor(
83 Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) {
84 UNIMPLEMENTED();
85 }
86
87
88 void CallFunctionStub::InitializeInterfaceDescriptor(
89 Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) {
90 UNIMPLEMENTED();
91 }
92
93
94 void CallConstructStub::InitializeInterfaceDescriptor(
95 Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) {
96 UNIMPLEMENTED();
97 }
98
99
82 void RegExpConstructResultStub::InitializeInterfaceDescriptor( 100 void RegExpConstructResultStub::InitializeInterfaceDescriptor(
83 CodeStubInterfaceDescriptor* descriptor) { 101 CodeStubInterfaceDescriptor* descriptor) {
84 Register registers[] = { cp, a2, a1, a0 }; 102 Register registers[] = { cp, a2, a1, a0 };
85 descriptor->Initialize( 103 descriptor->Initialize(
86 ARRAY_SIZE(registers), registers, 104 MajorKey(), ARRAY_SIZE(registers), registers,
87 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry); 105 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry);
88 } 106 }
89 107
90 108
91 void TransitionElementsKindStub::InitializeInterfaceDescriptor( 109 void TransitionElementsKindStub::InitializeInterfaceDescriptor(
92 CodeStubInterfaceDescriptor* descriptor) { 110 CodeStubInterfaceDescriptor* descriptor) {
93 Register registers[] = { cp, a0, a1 }; 111 Register registers[] = { cp, a0, a1 };
94 Address entry = 112 Address entry =
95 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; 113 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry;
96 descriptor->Initialize(ARRAY_SIZE(registers), registers, 114 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
97 FUNCTION_ADDR(entry)); 115 FUNCTION_ADDR(entry));
98 } 116 }
99 117
100 118
101 void CompareNilICStub::InitializeInterfaceDescriptor( 119 void CompareNilICStub::InitializeInterfaceDescriptor(
102 CodeStubInterfaceDescriptor* descriptor) { 120 CodeStubInterfaceDescriptor* descriptor) {
103 Register registers[] = { cp, a0 }; 121 Register registers[] = { cp, a0 };
104 descriptor->Initialize(ARRAY_SIZE(registers), registers, 122 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
105 FUNCTION_ADDR(CompareNilIC_Miss)); 123 FUNCTION_ADDR(CompareNilIC_Miss));
106 descriptor->SetMissHandler( 124 descriptor->SetMissHandler(
107 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); 125 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
108 } 126 }
109 127
110 128
111 const Register InterfaceDescriptor::ContextRegister() { return cp; } 129 const Register InterfaceDescriptor::ContextRegister() { return cp; }
112 130
113 131
114 static void InitializeArrayConstructorDescriptor( 132 static void InitializeArrayConstructorDescriptor(
115 CodeStubInterfaceDescriptor* descriptor, 133 CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor,
116 int constant_stack_parameter_count) { 134 int constant_stack_parameter_count) {
117 // register state 135 // register state
118 // cp -- context 136 // cp -- context
119 // a0 -- number of arguments 137 // a0 -- number of arguments
120 // a1 -- function 138 // a1 -- function
121 // a2 -- allocation site with elements kind 139 // a2 -- allocation site with elements kind
122 Address deopt_handler = Runtime::FunctionForId( 140 Address deopt_handler = Runtime::FunctionForId(
123 Runtime::kArrayConstructor)->entry; 141 Runtime::kArrayConstructor)->entry;
124 142
125 if (constant_stack_parameter_count == 0) { 143 if (constant_stack_parameter_count == 0) {
126 Register registers[] = { cp, a1, a2 }; 144 Register registers[] = { cp, a1, a2 };
127 descriptor->Initialize(ARRAY_SIZE(registers), registers, 145 descriptor->Initialize(major, ARRAY_SIZE(registers), registers,
128 deopt_handler, 146 deopt_handler, NULL, constant_stack_parameter_count,
129 NULL,
130 constant_stack_parameter_count,
131 JS_FUNCTION_STUB_MODE); 147 JS_FUNCTION_STUB_MODE);
132 } else { 148 } else {
133 // stack param count needs (constructor pointer, and single argument) 149 // stack param count needs (constructor pointer, and single argument)
134 Register registers[] = { cp, a1, a2, a0 }; 150 Register registers[] = { cp, a1, a2, a0 };
135 Representation representations[] = { 151 Representation representations[] = {
136 Representation::Tagged(), 152 Representation::Tagged(),
137 Representation::Tagged(), 153 Representation::Tagged(),
138 Representation::Tagged(), 154 Representation::Tagged(),
139 Representation::Integer32() }; 155 Representation::Integer32() };
140 descriptor->Initialize(ARRAY_SIZE(registers), registers, 156 descriptor->Initialize(major, ARRAY_SIZE(registers), registers, a0,
141 a0, 157 deopt_handler, representations,
142 deopt_handler,
143 representations,
144 constant_stack_parameter_count, 158 constant_stack_parameter_count,
145 JS_FUNCTION_STUB_MODE, 159 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
146 PASS_ARGUMENTS);
147 } 160 }
148 } 161 }
149 162
150 163
151 static void InitializeInternalArrayConstructorDescriptor( 164 static void InitializeInternalArrayConstructorDescriptor(
152 CodeStubInterfaceDescriptor* descriptor, 165 CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor,
153 int constant_stack_parameter_count) { 166 int constant_stack_parameter_count) {
154 // register state 167 // register state
155 // cp -- context 168 // cp -- context
156 // a0 -- number of arguments 169 // a0 -- number of arguments
157 // a1 -- constructor function 170 // a1 -- constructor function
158 Address deopt_handler = Runtime::FunctionForId( 171 Address deopt_handler = Runtime::FunctionForId(
159 Runtime::kInternalArrayConstructor)->entry; 172 Runtime::kInternalArrayConstructor)->entry;
160 173
161 if (constant_stack_parameter_count == 0) { 174 if (constant_stack_parameter_count == 0) {
162 Register registers[] = { cp, a1 }; 175 Register registers[] = { cp, a1 };
163 descriptor->Initialize(ARRAY_SIZE(registers), registers, 176 descriptor->Initialize(major, ARRAY_SIZE(registers), registers,
164 deopt_handler, 177 deopt_handler, NULL, constant_stack_parameter_count,
165 NULL,
166 constant_stack_parameter_count,
167 JS_FUNCTION_STUB_MODE); 178 JS_FUNCTION_STUB_MODE);
168 } else { 179 } else {
169 // stack param count needs (constructor pointer, and single argument) 180 // stack param count needs (constructor pointer, and single argument)
170 Register registers[] = { cp, a1, a0 }; 181 Register registers[] = { cp, a1, a0 };
171 Representation representations[] = { 182 Representation representations[] = {
172 Representation::Tagged(), 183 Representation::Tagged(),
173 Representation::Tagged(), 184 Representation::Tagged(),
174 Representation::Integer32() }; 185 Representation::Integer32() };
175 descriptor->Initialize(ARRAY_SIZE(registers), registers, 186 descriptor->Initialize(major, ARRAY_SIZE(registers), registers, a0,
176 a0, 187 deopt_handler, representations,
177 deopt_handler,
178 representations,
179 constant_stack_parameter_count, 188 constant_stack_parameter_count,
180 JS_FUNCTION_STUB_MODE, 189 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
181 PASS_ARGUMENTS);
182 } 190 }
183 } 191 }
184 192
185 193
186 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 194 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
187 CodeStubInterfaceDescriptor* descriptor) { 195 CodeStubInterfaceDescriptor* descriptor) {
188 InitializeArrayConstructorDescriptor(descriptor, 0); 196 InitializeArrayConstructorDescriptor(MajorKey(), descriptor, 0);
189 } 197 }
190 198
191 199
192 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( 200 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
193 CodeStubInterfaceDescriptor* descriptor) { 201 CodeStubInterfaceDescriptor* descriptor) {
194 InitializeArrayConstructorDescriptor(descriptor, 1); 202 InitializeArrayConstructorDescriptor(MajorKey(), descriptor, 1);
195 } 203 }
196 204
197 205
198 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( 206 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
199 CodeStubInterfaceDescriptor* descriptor) { 207 CodeStubInterfaceDescriptor* descriptor) {
200 InitializeArrayConstructorDescriptor(descriptor, -1); 208 InitializeArrayConstructorDescriptor(MajorKey(), descriptor, -1);
201 } 209 }
202 210
203 211
204 void ToBooleanStub::InitializeInterfaceDescriptor( 212 void ToBooleanStub::InitializeInterfaceDescriptor(
205 CodeStubInterfaceDescriptor* descriptor) { 213 CodeStubInterfaceDescriptor* descriptor) {
206 Register registers[] = { cp, a0 }; 214 Register registers[] = { cp, a0 };
207 descriptor->Initialize(ARRAY_SIZE(registers), registers, 215 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
208 FUNCTION_ADDR(ToBooleanIC_Miss)); 216 FUNCTION_ADDR(ToBooleanIC_Miss));
209 descriptor->SetMissHandler( 217 descriptor->SetMissHandler(
210 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); 218 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate()));
211 } 219 }
212 220
213 221
214 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 222 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
215 CodeStubInterfaceDescriptor* descriptor) { 223 CodeStubInterfaceDescriptor* descriptor) {
216 InitializeInternalArrayConstructorDescriptor(descriptor, 0); 224 InitializeInternalArrayConstructorDescriptor(MajorKey(), descriptor, 0);
217 } 225 }
218 226
219 227
220 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( 228 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
221 CodeStubInterfaceDescriptor* descriptor) { 229 CodeStubInterfaceDescriptor* descriptor) {
222 InitializeInternalArrayConstructorDescriptor(descriptor, 1); 230 InitializeInternalArrayConstructorDescriptor(MajorKey(), descriptor, 1);
223 } 231 }
224 232
225 233
226 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( 234 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
227 CodeStubInterfaceDescriptor* descriptor) { 235 CodeStubInterfaceDescriptor* descriptor) {
228 InitializeInternalArrayConstructorDescriptor(descriptor, -1); 236 InitializeInternalArrayConstructorDescriptor(MajorKey(), descriptor, -1);
229 } 237 }
230 238
231 239
232 void BinaryOpICStub::InitializeInterfaceDescriptor( 240 void BinaryOpICStub::InitializeInterfaceDescriptor(
233 CodeStubInterfaceDescriptor* descriptor) { 241 CodeStubInterfaceDescriptor* descriptor) {
234 Register registers[] = { cp, a1, a0 }; 242 Register registers[] = { cp, a1, a0 };
235 descriptor->Initialize(ARRAY_SIZE(registers), registers, 243 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
236 FUNCTION_ADDR(BinaryOpIC_Miss)); 244 FUNCTION_ADDR(BinaryOpIC_Miss));
237 descriptor->SetMissHandler( 245 descriptor->SetMissHandler(
238 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); 246 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate()));
239 } 247 }
240 248
241 249
242 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( 250 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
243 CodeStubInterfaceDescriptor* descriptor) { 251 CodeStubInterfaceDescriptor* descriptor) {
244 Register registers[] = { cp, a2, a1, a0 }; 252 Register registers[] = { cp, a2, a1, a0 };
245 descriptor->Initialize(ARRAY_SIZE(registers), registers, 253 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
246 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); 254 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite));
247 } 255 }
248 256
249 257
250 void StringAddStub::InitializeInterfaceDescriptor( 258 void StringAddStub::InitializeInterfaceDescriptor(
251 CodeStubInterfaceDescriptor* descriptor) { 259 CodeStubInterfaceDescriptor* descriptor) {
252 Register registers[] = { cp, a1, a0 }; 260 Register registers[] = { cp, a1, a0 };
253 descriptor->Initialize( 261 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
254 ARRAY_SIZE(registers), registers, 262 Runtime::FunctionForId(Runtime::kStringAdd)->entry);
255 Runtime::FunctionForId(Runtime::kStringAdd)->entry);
256 } 263 }
257 264
258 265
259 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { 266 void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
260 { 267 {
261 CallInterfaceDescriptor* descriptor = 268 CallInterfaceDescriptor* descriptor =
262 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); 269 isolate->call_descriptor(Isolate::ArgumentAdaptorCall);
263 Register registers[] = { cp, // context, 270 Register registers[] = { cp, // context,
264 a1, // JSFunction 271 a1, // JSFunction
265 a0, // actual number of arguments 272 a0, // actual number of arguments
(...skipping 5004 matching lines...) Expand 10 before | Expand all | Expand 10 after
5270 MemOperand(fp, 6 * kPointerSize), 5277 MemOperand(fp, 6 * kPointerSize),
5271 NULL); 5278 NULL);
5272 } 5279 }
5273 5280
5274 5281
5275 #undef __ 5282 #undef __
5276 5283
5277 } } // namespace v8::internal 5284 } } // namespace v8::internal
5278 5285
5279 #endif // V8_TARGET_ARCH_MIPS 5286 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/lithium-inl.h ('k') | src/mips/deoptimizer-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698