OLD | NEW |
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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
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[] = { a2 }; | 21 Register registers[] = { cp, a2 }; |
22 descriptor->Initialize( | 22 descriptor->Initialize( |
23 ARRAY_SIZE(registers), registers, | 23 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[] = { a1 }; | 30 Register registers[] = { cp, a1 }; |
31 descriptor->Initialize(ARRAY_SIZE(registers), registers); | 31 descriptor->Initialize(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[] = { a0 }; | 37 Register registers[] = { cp, a0 }; |
38 descriptor->Initialize(ARRAY_SIZE(registers), registers); | 38 descriptor->Initialize(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[] = { a0 }; | 44 Register registers[] = { cp, a0 }; |
45 descriptor->Initialize( | 45 descriptor->Initialize( |
46 ARRAY_SIZE(registers), registers, | 46 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[] = { 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::Smi(), | 57 Representation::Smi(), |
57 Representation::Tagged() }; | 58 Representation::Tagged() }; |
58 descriptor->Initialize( | 59 descriptor->Initialize( |
59 ARRAY_SIZE(registers), registers, | 60 ARRAY_SIZE(registers), registers, |
60 Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry, | 61 Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry, |
61 representations); | 62 representations); |
62 } | 63 } |
63 | 64 |
64 | 65 |
65 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 66 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
66 CodeStubInterfaceDescriptor* descriptor) { | 67 CodeStubInterfaceDescriptor* descriptor) { |
67 Register registers[] = { a3, a2, a1, a0 }; | 68 Register registers[] = { cp, a3, a2, a1, a0 }; |
68 descriptor->Initialize( | 69 descriptor->Initialize( |
69 ARRAY_SIZE(registers), registers, | 70 ARRAY_SIZE(registers), registers, |
70 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry); | 71 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry); |
71 } | 72 } |
72 | 73 |
73 | 74 |
74 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 75 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
75 CodeStubInterfaceDescriptor* descriptor) { | 76 CodeStubInterfaceDescriptor* descriptor) { |
76 Register registers[] = { a2, a3 }; | 77 Register registers[] = { cp, a2, a3 }; |
77 descriptor->Initialize(ARRAY_SIZE(registers), registers); | 78 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
78 } | 79 } |
79 | 80 |
80 | 81 |
81 void RegExpConstructResultStub::InitializeInterfaceDescriptor( | 82 void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
82 CodeStubInterfaceDescriptor* descriptor) { | 83 CodeStubInterfaceDescriptor* descriptor) { |
83 Register registers[] = { a2, a1, a0 }; | 84 Register registers[] = { cp, a2, a1, a0 }; |
84 descriptor->Initialize( | 85 descriptor->Initialize( |
85 ARRAY_SIZE(registers), registers, | 86 ARRAY_SIZE(registers), registers, |
86 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry); | 87 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry); |
87 } | 88 } |
88 | 89 |
89 | 90 |
90 void TransitionElementsKindStub::InitializeInterfaceDescriptor( | 91 void TransitionElementsKindStub::InitializeInterfaceDescriptor( |
91 CodeStubInterfaceDescriptor* descriptor) { | 92 CodeStubInterfaceDescriptor* descriptor) { |
92 Register registers[] = { a0, a1 }; | 93 Register registers[] = { cp, a0, a1 }; |
93 Address entry = | 94 Address entry = |
94 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; | 95 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; |
95 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 96 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
96 FUNCTION_ADDR(entry)); | 97 FUNCTION_ADDR(entry)); |
97 } | 98 } |
98 | 99 |
99 | 100 |
100 void CompareNilICStub::InitializeInterfaceDescriptor( | 101 void CompareNilICStub::InitializeInterfaceDescriptor( |
101 CodeStubInterfaceDescriptor* descriptor) { | 102 CodeStubInterfaceDescriptor* descriptor) { |
102 Register registers[] = { a0 }; | 103 Register registers[] = { cp, a0 }; |
103 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 104 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
104 FUNCTION_ADDR(CompareNilIC_Miss)); | 105 FUNCTION_ADDR(CompareNilIC_Miss)); |
105 descriptor->SetMissHandler( | 106 descriptor->SetMissHandler( |
106 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); | 107 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); |
107 } | 108 } |
108 | 109 |
109 | 110 |
| 111 const Register InterfaceDescriptor::ContextRegister() { return cp; } |
| 112 |
| 113 |
110 static void InitializeArrayConstructorDescriptor( | 114 static void InitializeArrayConstructorDescriptor( |
111 CodeStubInterfaceDescriptor* descriptor, | 115 CodeStubInterfaceDescriptor* descriptor, |
112 int constant_stack_parameter_count) { | 116 int constant_stack_parameter_count) { |
113 // register state | 117 // register state |
| 118 // cp -- context |
114 // a0 -- number of arguments | 119 // a0 -- number of arguments |
115 // a1 -- function | 120 // a1 -- function |
116 // a2 -- allocation site with elements kind | 121 // a2 -- allocation site with elements kind |
117 Address deopt_handler = Runtime::FunctionForId( | 122 Address deopt_handler = Runtime::FunctionForId( |
118 Runtime::kArrayConstructor)->entry; | 123 Runtime::kArrayConstructor)->entry; |
119 | 124 |
120 if (constant_stack_parameter_count == 0) { | 125 if (constant_stack_parameter_count == 0) { |
121 Register registers[] = { a1, a2 }; | 126 Register registers[] = { cp, a1, a2 }; |
122 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 127 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
123 deopt_handler, | 128 deopt_handler, |
124 NULL, | 129 NULL, |
125 constant_stack_parameter_count, | 130 constant_stack_parameter_count, |
126 JS_FUNCTION_STUB_MODE); | 131 JS_FUNCTION_STUB_MODE); |
127 } else { | 132 } else { |
128 // stack param count needs (constructor pointer, and single argument) | 133 // stack param count needs (constructor pointer, and single argument) |
129 Register registers[] = { a1, a2, a0 }; | 134 Register registers[] = { cp, a1, a2, a0 }; |
130 Representation representations[] = { | 135 Representation representations[] = { |
131 Representation::Tagged(), | 136 Representation::Tagged(), |
132 Representation::Tagged(), | 137 Representation::Tagged(), |
| 138 Representation::Tagged(), |
133 Representation::Integer32() }; | 139 Representation::Integer32() }; |
134 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 140 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
135 a0, | 141 a0, |
136 deopt_handler, | 142 deopt_handler, |
137 representations, | 143 representations, |
138 constant_stack_parameter_count, | 144 constant_stack_parameter_count, |
139 JS_FUNCTION_STUB_MODE, | 145 JS_FUNCTION_STUB_MODE, |
140 PASS_ARGUMENTS); | 146 PASS_ARGUMENTS); |
141 } | 147 } |
142 } | 148 } |
143 | 149 |
144 | 150 |
145 static void InitializeInternalArrayConstructorDescriptor( | 151 static void InitializeInternalArrayConstructorDescriptor( |
146 CodeStubInterfaceDescriptor* descriptor, | 152 CodeStubInterfaceDescriptor* descriptor, |
147 int constant_stack_parameter_count) { | 153 int constant_stack_parameter_count) { |
148 // register state | 154 // register state |
| 155 // cp -- context |
149 // a0 -- number of arguments | 156 // a0 -- number of arguments |
150 // a1 -- constructor function | 157 // a1 -- constructor function |
151 Address deopt_handler = Runtime::FunctionForId( | 158 Address deopt_handler = Runtime::FunctionForId( |
152 Runtime::kInternalArrayConstructor)->entry; | 159 Runtime::kInternalArrayConstructor)->entry; |
153 | 160 |
154 if (constant_stack_parameter_count == 0) { | 161 if (constant_stack_parameter_count == 0) { |
155 Register registers[] = { a1 }; | 162 Register registers[] = { cp, a1 }; |
156 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 163 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
157 deopt_handler, | 164 deopt_handler, |
158 NULL, | 165 NULL, |
159 constant_stack_parameter_count, | 166 constant_stack_parameter_count, |
160 JS_FUNCTION_STUB_MODE); | 167 JS_FUNCTION_STUB_MODE); |
161 } else { | 168 } else { |
162 // stack param count needs (constructor pointer, and single argument) | 169 // stack param count needs (constructor pointer, and single argument) |
163 Register registers[] = { a1, a0 }; | 170 Register registers[] = { cp, a1, a0 }; |
164 Representation representations[] = { | 171 Representation representations[] = { |
165 Representation::Tagged(), | 172 Representation::Tagged(), |
| 173 Representation::Tagged(), |
166 Representation::Integer32() }; | 174 Representation::Integer32() }; |
167 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 175 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
168 a0, | 176 a0, |
169 deopt_handler, | 177 deopt_handler, |
170 representations, | 178 representations, |
171 constant_stack_parameter_count, | 179 constant_stack_parameter_count, |
172 JS_FUNCTION_STUB_MODE, | 180 JS_FUNCTION_STUB_MODE, |
173 PASS_ARGUMENTS); | 181 PASS_ARGUMENTS); |
174 } | 182 } |
175 } | 183 } |
(...skipping 12 matching lines...) Expand all Loading... |
188 | 196 |
189 | 197 |
190 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 198 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
191 CodeStubInterfaceDescriptor* descriptor) { | 199 CodeStubInterfaceDescriptor* descriptor) { |
192 InitializeArrayConstructorDescriptor(descriptor, -1); | 200 InitializeArrayConstructorDescriptor(descriptor, -1); |
193 } | 201 } |
194 | 202 |
195 | 203 |
196 void ToBooleanStub::InitializeInterfaceDescriptor( | 204 void ToBooleanStub::InitializeInterfaceDescriptor( |
197 CodeStubInterfaceDescriptor* descriptor) { | 205 CodeStubInterfaceDescriptor* descriptor) { |
198 Register registers[] = { a0 }; | 206 Register registers[] = { cp, a0 }; |
199 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 207 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
200 FUNCTION_ADDR(ToBooleanIC_Miss)); | 208 FUNCTION_ADDR(ToBooleanIC_Miss)); |
201 descriptor->SetMissHandler( | 209 descriptor->SetMissHandler( |
202 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); | 210 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); |
203 } | 211 } |
204 | 212 |
205 | 213 |
206 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 214 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
207 CodeStubInterfaceDescriptor* descriptor) { | 215 CodeStubInterfaceDescriptor* descriptor) { |
208 InitializeInternalArrayConstructorDescriptor(descriptor, 0); | 216 InitializeInternalArrayConstructorDescriptor(descriptor, 0); |
209 } | 217 } |
210 | 218 |
211 | 219 |
212 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 220 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
213 CodeStubInterfaceDescriptor* descriptor) { | 221 CodeStubInterfaceDescriptor* descriptor) { |
214 InitializeInternalArrayConstructorDescriptor(descriptor, 1); | 222 InitializeInternalArrayConstructorDescriptor(descriptor, 1); |
215 } | 223 } |
216 | 224 |
217 | 225 |
218 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 226 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
219 CodeStubInterfaceDescriptor* descriptor) { | 227 CodeStubInterfaceDescriptor* descriptor) { |
220 InitializeInternalArrayConstructorDescriptor(descriptor, -1); | 228 InitializeInternalArrayConstructorDescriptor(descriptor, -1); |
221 } | 229 } |
222 | 230 |
223 | 231 |
224 void BinaryOpICStub::InitializeInterfaceDescriptor( | 232 void BinaryOpICStub::InitializeInterfaceDescriptor( |
225 CodeStubInterfaceDescriptor* descriptor) { | 233 CodeStubInterfaceDescriptor* descriptor) { |
226 Register registers[] = { a1, a0 }; | 234 Register registers[] = { cp, a1, a0 }; |
227 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 235 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
228 FUNCTION_ADDR(BinaryOpIC_Miss)); | 236 FUNCTION_ADDR(BinaryOpIC_Miss)); |
229 descriptor->SetMissHandler( | 237 descriptor->SetMissHandler( |
230 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); | 238 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); |
231 } | 239 } |
232 | 240 |
233 | 241 |
234 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( | 242 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( |
235 CodeStubInterfaceDescriptor* descriptor) { | 243 CodeStubInterfaceDescriptor* descriptor) { |
236 Register registers[] = { a2, a1, a0 }; | 244 Register registers[] = { cp, a2, a1, a0 }; |
237 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 245 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
238 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); | 246 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); |
239 } | 247 } |
240 | 248 |
241 | 249 |
242 void StringAddStub::InitializeInterfaceDescriptor( | 250 void StringAddStub::InitializeInterfaceDescriptor( |
243 CodeStubInterfaceDescriptor* descriptor) { | 251 CodeStubInterfaceDescriptor* descriptor) { |
244 Register registers[] = { a1, a0 }; | 252 Register registers[] = { cp, a1, a0 }; |
245 descriptor->Initialize( | 253 descriptor->Initialize( |
246 ARRAY_SIZE(registers), registers, | 254 ARRAY_SIZE(registers), registers, |
247 Runtime::FunctionForId(Runtime::kStringAdd)->entry); | 255 Runtime::FunctionForId(Runtime::kStringAdd)->entry); |
248 } | 256 } |
249 | 257 |
250 | 258 |
251 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 259 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
252 { | 260 { |
253 CallInterfaceDescriptor* descriptor = | 261 CallInterfaceDescriptor* descriptor = |
254 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); | 262 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); |
255 Register registers[] = { a1, // JSFunction | 263 Register registers[] = { cp, // context |
256 cp, // context | 264 a1, // JSFunction |
257 a0, // actual number of arguments | 265 a0, // actual number of arguments |
258 a2, // expected number of arguments | 266 a2, // expected number of arguments |
259 }; | 267 }; |
260 Representation representations[] = { | 268 Representation representations[] = { |
| 269 Representation::Tagged(), // context |
261 Representation::Tagged(), // JSFunction | 270 Representation::Tagged(), // JSFunction |
262 Representation::Tagged(), // context | |
263 Representation::Integer32(), // actual number of arguments | 271 Representation::Integer32(), // actual number of arguments |
264 Representation::Integer32(), // expected number of arguments | 272 Representation::Integer32(), // expected number of arguments |
265 }; | 273 }; |
266 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 274 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); |
267 } | 275 } |
268 { | 276 { |
269 CallInterfaceDescriptor* descriptor = | 277 CallInterfaceDescriptor* descriptor = |
270 isolate->call_descriptor(Isolate::KeyedCall); | 278 isolate->call_descriptor(Isolate::KeyedCall); |
271 Register registers[] = { cp, // context | 279 Register registers[] = { cp, // context |
272 a2, // key | 280 a2, // key |
(...skipping 24 matching lines...) Expand all Loading... |
297 }; | 305 }; |
298 Representation representations[] = { | 306 Representation representations[] = { |
299 Representation::Tagged(), // context | 307 Representation::Tagged(), // context |
300 Representation::Tagged(), // receiver | 308 Representation::Tagged(), // receiver |
301 }; | 309 }; |
302 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 310 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); |
303 } | 311 } |
304 { | 312 { |
305 CallInterfaceDescriptor* descriptor = | 313 CallInterfaceDescriptor* descriptor = |
306 isolate->call_descriptor(Isolate::ApiFunctionCall); | 314 isolate->call_descriptor(Isolate::ApiFunctionCall); |
307 Register registers[] = { a0, // callee | 315 Register registers[] = { cp, // context |
| 316 a0, // callee |
308 a4, // call_data | 317 a4, // call_data |
309 a2, // holder | 318 a2, // holder |
310 a1, // api_function_address | 319 a1, // api_function_address |
311 cp, // context | |
312 }; | 320 }; |
313 Representation representations[] = { | 321 Representation representations[] = { |
| 322 Representation::Tagged(), // context |
314 Representation::Tagged(), // callee | 323 Representation::Tagged(), // callee |
315 Representation::Tagged(), // call_data | 324 Representation::Tagged(), // call_data |
316 Representation::Tagged(), // holder | 325 Representation::Tagged(), // holder |
317 Representation::External(), // api_function_address | 326 Representation::External(), // api_function_address |
318 Representation::Tagged(), // context | |
319 }; | 327 }; |
320 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 328 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); |
321 } | 329 } |
322 } | 330 } |
323 | 331 |
324 | 332 |
325 #define __ ACCESS_MASM(masm) | 333 #define __ ACCESS_MASM(masm) |
326 | 334 |
327 | 335 |
328 static void EmitIdenticalObjectComparison(MacroAssembler* masm, | 336 static void EmitIdenticalObjectComparison(MacroAssembler* masm, |
329 Label* slow, | 337 Label* slow, |
330 Condition cc); | 338 Condition cc); |
331 static void EmitSmiNonsmiComparison(MacroAssembler* masm, | 339 static void EmitSmiNonsmiComparison(MacroAssembler* masm, |
332 Register lhs, | 340 Register lhs, |
333 Register rhs, | 341 Register rhs, |
334 Label* rhs_not_nan, | 342 Label* rhs_not_nan, |
335 Label* slow, | 343 Label* slow, |
336 bool strict); | 344 bool strict); |
337 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, | 345 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, |
338 Register lhs, | 346 Register lhs, |
339 Register rhs); | 347 Register rhs); |
340 | 348 |
341 | 349 |
342 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 350 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
343 // Update the static counter each time a new code stub is generated. | 351 // Update the static counter each time a new code stub is generated. |
344 isolate()->counters()->code_stubs()->Increment(); | 352 isolate()->counters()->code_stubs()->Increment(); |
345 | 353 |
346 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); | 354 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); |
347 int param_count = descriptor->register_param_count(); | 355 int param_count = descriptor->GetEnvironmentParameterCount(); |
348 { | 356 { |
349 // Call the runtime system in a fresh internal frame. | 357 // Call the runtime system in a fresh internal frame. |
350 FrameScope scope(masm, StackFrame::INTERNAL); | 358 FrameScope scope(masm, StackFrame::INTERNAL); |
351 ASSERT(descriptor->register_param_count() == 0 || | 359 ASSERT((param_count == 0) || |
352 a0.is(descriptor->GetParameterRegister(param_count - 1))); | 360 a0.is(descriptor->GetEnvironmentParameterRegister(param_count - 1))); |
353 // Push arguments, adjust sp. | 361 // Push arguments, adjust sp. |
354 __ Dsubu(sp, sp, Operand(param_count * kPointerSize)); | 362 __ Dsubu(sp, sp, Operand(param_count * kPointerSize)); |
355 for (int i = 0; i < param_count; ++i) { | 363 for (int i = 0; i < param_count; ++i) { |
356 // Store argument to stack. | 364 // Store argument to stack. |
357 __ sd(descriptor->GetParameterRegister(i), | 365 __ sd(descriptor->GetEnvironmentParameterRegister(i), |
358 MemOperand(sp, (param_count-1-i) * kPointerSize)); | 366 MemOperand(sp, (param_count-1-i) * kPointerSize)); |
359 } | 367 } |
360 ExternalReference miss = descriptor->miss_handler(); | 368 ExternalReference miss = descriptor->miss_handler(); |
361 __ CallExternalReference(miss, descriptor->register_param_count()); | 369 __ CallExternalReference(miss, param_count); |
362 } | 370 } |
363 | 371 |
364 __ Ret(); | 372 __ Ret(); |
365 } | 373 } |
366 | 374 |
367 | 375 |
368 // Takes a Smi and converts to an IEEE 64 bit floating point value in two | 376 // Takes a Smi and converts to an IEEE 64 bit floating point value in two |
369 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and | 377 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and |
370 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a | 378 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a |
371 // scratch register. Destroys the source register. No GC occurs during this | 379 // scratch register. Destroys the source register. No GC occurs during this |
(...skipping 4944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5316 MemOperand(fp, 6 * kPointerSize), | 5324 MemOperand(fp, 6 * kPointerSize), |
5317 NULL); | 5325 NULL); |
5318 } | 5326 } |
5319 | 5327 |
5320 | 5328 |
5321 #undef __ | 5329 #undef __ |
5322 | 5330 |
5323 } } // namespace v8::internal | 5331 } } // namespace v8::internal |
5324 | 5332 |
5325 #endif // V8_TARGET_ARCH_MIPS64 | 5333 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |