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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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/isolate.h" | 12 #include "src/isolate.h" |
13 #include "src/jsregexp.h" | 13 #include "src/jsregexp.h" |
14 #include "src/regexp-macro-assembler.h" | 14 #include "src/regexp-macro-assembler.h" |
15 #include "src/runtime.h" | 15 #include "src/runtime.h" |
16 #include "src/stub-cache.h" | 16 #include "src/stub-cache.h" |
17 | 17 |
18 namespace v8 { | 18 namespace v8 { |
19 namespace internal { | 19 namespace internal { |
20 | 20 |
21 | 21 |
22 void FastNewClosureStub::InitializeInterfaceDescriptor( | 22 void FastNewClosureStub::InitializeInterfaceDescriptor( |
23 CodeStubInterfaceDescriptor* descriptor) { | 23 CodeStubInterfaceDescriptor* descriptor) { |
24 Register registers[] = { ebx }; | 24 Register registers[] = { esi, ebx }; |
25 descriptor->Initialize( | 25 descriptor->Initialize( |
26 ARRAY_SIZE(registers), registers, | 26 ARRAY_SIZE(registers), registers, |
27 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry); | 27 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry); |
28 } | 28 } |
29 | 29 |
30 | 30 |
31 void FastNewContextStub::InitializeInterfaceDescriptor( | 31 void FastNewContextStub::InitializeInterfaceDescriptor( |
32 CodeStubInterfaceDescriptor* descriptor) { | 32 CodeStubInterfaceDescriptor* descriptor) { |
33 Register registers[] = { edi }; | 33 Register registers[] = { esi, edi }; |
34 descriptor->Initialize(ARRAY_SIZE(registers), registers); | 34 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
35 } | 35 } |
36 | 36 |
37 | 37 |
38 void ToNumberStub::InitializeInterfaceDescriptor( | 38 void ToNumberStub::InitializeInterfaceDescriptor( |
39 CodeStubInterfaceDescriptor* descriptor) { | 39 CodeStubInterfaceDescriptor* descriptor) { |
40 Register registers[] = { eax }; | 40 // ToNumberStub invokes a function, and therefore needs a context. |
| 41 Register registers[] = { esi, eax }; |
41 descriptor->Initialize(ARRAY_SIZE(registers), registers); | 42 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
42 } | 43 } |
43 | 44 |
44 | 45 |
45 void NumberToStringStub::InitializeInterfaceDescriptor( | 46 void NumberToStringStub::InitializeInterfaceDescriptor( |
46 CodeStubInterfaceDescriptor* descriptor) { | 47 CodeStubInterfaceDescriptor* descriptor) { |
47 Register registers[] = { eax }; | 48 Register registers[] = { esi, eax }; |
48 descriptor->Initialize( | 49 descriptor->Initialize( |
49 ARRAY_SIZE(registers), registers, | 50 ARRAY_SIZE(registers), registers, |
50 Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry); | 51 Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry); |
51 } | 52 } |
52 | 53 |
53 | 54 |
54 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 55 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
55 CodeStubInterfaceDescriptor* descriptor) { | 56 CodeStubInterfaceDescriptor* descriptor) { |
56 Register registers[] = { eax, ebx, ecx }; | 57 Register registers[] = { esi, eax, ebx, ecx }; |
57 Representation representations[] = { | 58 Representation representations[] = { |
58 Representation::Tagged(), | 59 Representation::Tagged(), |
| 60 Representation::Tagged(), |
59 Representation::Smi(), | 61 Representation::Smi(), |
60 Representation::Tagged() }; | 62 Representation::Tagged() }; |
61 | 63 |
62 descriptor->Initialize( | 64 descriptor->Initialize( |
63 ARRAY_SIZE(registers), registers, | 65 ARRAY_SIZE(registers), registers, |
64 Runtime::FunctionForId( | 66 Runtime::FunctionForId( |
65 Runtime::kCreateArrayLiteralStubBailout)->entry, | 67 Runtime::kCreateArrayLiteralStubBailout)->entry, |
66 representations); | 68 representations); |
67 } | 69 } |
68 | 70 |
69 | 71 |
70 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 72 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
71 CodeStubInterfaceDescriptor* descriptor) { | 73 CodeStubInterfaceDescriptor* descriptor) { |
72 Register registers[] = { eax, ebx, ecx, edx }; | 74 Register registers[] = { esi, eax, ebx, ecx, edx }; |
73 descriptor->Initialize( | 75 descriptor->Initialize( |
74 ARRAY_SIZE(registers), registers, | 76 ARRAY_SIZE(registers), registers, |
75 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry); | 77 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry); |
76 } | 78 } |
77 | 79 |
78 | 80 |
79 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 81 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
80 CodeStubInterfaceDescriptor* descriptor) { | 82 CodeStubInterfaceDescriptor* descriptor) { |
81 Register registers[] = { ebx, edx }; | 83 Register registers[] = { esi, ebx, edx }; |
82 descriptor->Initialize(ARRAY_SIZE(registers), registers); | 84 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
83 } | 85 } |
84 | 86 |
85 | 87 |
86 void RegExpConstructResultStub::InitializeInterfaceDescriptor( | 88 void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
87 CodeStubInterfaceDescriptor* descriptor) { | 89 CodeStubInterfaceDescriptor* descriptor) { |
88 Register registers[] = { ecx, ebx, eax }; | 90 Register registers[] = { esi, ecx, ebx, eax }; |
89 descriptor->Initialize( | 91 descriptor->Initialize( |
90 ARRAY_SIZE(registers), registers, | 92 ARRAY_SIZE(registers), registers, |
91 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry); | 93 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry); |
92 } | 94 } |
93 | 95 |
94 | 96 |
95 void TransitionElementsKindStub::InitializeInterfaceDescriptor( | 97 void TransitionElementsKindStub::InitializeInterfaceDescriptor( |
96 CodeStubInterfaceDescriptor* descriptor) { | 98 CodeStubInterfaceDescriptor* descriptor) { |
97 Register registers[] = { eax, ebx }; | 99 Register registers[] = { esi, eax, ebx }; |
98 descriptor->Initialize( | 100 descriptor->Initialize( |
99 ARRAY_SIZE(registers), registers, | 101 ARRAY_SIZE(registers), registers, |
100 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry); | 102 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry); |
101 } | 103 } |
102 | 104 |
103 | 105 |
| 106 const Register InterfaceDescriptor::ContextRegister() { return esi; } |
| 107 |
| 108 |
104 static void InitializeArrayConstructorDescriptor( | 109 static void InitializeArrayConstructorDescriptor( |
105 Isolate* isolate, | 110 Isolate* isolate, |
106 CodeStubInterfaceDescriptor* descriptor, | 111 CodeStubInterfaceDescriptor* descriptor, |
107 int constant_stack_parameter_count) { | 112 int constant_stack_parameter_count) { |
108 // register state | 113 // register state |
109 // eax -- number of arguments | 114 // eax -- number of arguments |
110 // edi -- function | 115 // edi -- function |
111 // ebx -- allocation site with elements kind | 116 // ebx -- allocation site with elements kind |
112 Address deopt_handler = Runtime::FunctionForId( | 117 Address deopt_handler = Runtime::FunctionForId( |
113 Runtime::kArrayConstructor)->entry; | 118 Runtime::kArrayConstructor)->entry; |
114 | 119 |
115 if (constant_stack_parameter_count == 0) { | 120 if (constant_stack_parameter_count == 0) { |
116 Register registers[] = { edi, ebx }; | 121 Register registers[] = { esi, edi, ebx }; |
117 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 122 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
118 deopt_handler, | 123 deopt_handler, |
119 NULL, | 124 NULL, |
120 constant_stack_parameter_count, | 125 constant_stack_parameter_count, |
121 JS_FUNCTION_STUB_MODE); | 126 JS_FUNCTION_STUB_MODE); |
122 } else { | 127 } else { |
123 // stack param count needs (constructor pointer, and single argument) | 128 // stack param count needs (constructor pointer, and single argument) |
124 Register registers[] = { edi, ebx, eax }; | 129 Register registers[] = { esi, edi, ebx, eax }; |
125 Representation representations[] = { | 130 Representation representations[] = { |
126 Representation::Tagged(), | 131 Representation::Tagged(), |
127 Representation::Tagged(), | 132 Representation::Tagged(), |
| 133 Representation::Tagged(), |
128 Representation::Integer32() }; | 134 Representation::Integer32() }; |
129 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 135 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
130 eax, | 136 eax, |
131 deopt_handler, | 137 deopt_handler, |
132 representations, | 138 representations, |
133 constant_stack_parameter_count, | 139 constant_stack_parameter_count, |
134 JS_FUNCTION_STUB_MODE, | 140 JS_FUNCTION_STUB_MODE, |
135 PASS_ARGUMENTS); | 141 PASS_ARGUMENTS); |
136 } | 142 } |
137 } | 143 } |
138 | 144 |
139 | 145 |
140 static void InitializeInternalArrayConstructorDescriptor( | 146 static void InitializeInternalArrayConstructorDescriptor( |
141 CodeStubInterfaceDescriptor* descriptor, | 147 CodeStubInterfaceDescriptor* descriptor, |
142 int constant_stack_parameter_count) { | 148 int constant_stack_parameter_count) { |
143 // register state | 149 // register state |
144 // eax -- number of arguments | 150 // eax -- number of arguments |
145 // edi -- constructor function | 151 // edi -- constructor function |
146 Address deopt_handler = Runtime::FunctionForId( | 152 Address deopt_handler = Runtime::FunctionForId( |
147 Runtime::kInternalArrayConstructor)->entry; | 153 Runtime::kInternalArrayConstructor)->entry; |
148 | 154 |
149 if (constant_stack_parameter_count == 0) { | 155 if (constant_stack_parameter_count == 0) { |
150 Register registers[] = { edi }; | 156 Register registers[] = { esi, edi }; |
151 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 157 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
152 deopt_handler, | 158 deopt_handler, |
153 NULL, | 159 NULL, |
154 constant_stack_parameter_count, | 160 constant_stack_parameter_count, |
155 JS_FUNCTION_STUB_MODE); | 161 JS_FUNCTION_STUB_MODE); |
156 } else { | 162 } else { |
157 // stack param count needs (constructor pointer, and single argument) | 163 // stack param count needs (constructor pointer, and single argument) |
158 Register registers[] = { edi, eax }; | 164 Register registers[] = { esi, edi, eax }; |
159 Representation representations[] = { | 165 Representation representations[] = { |
160 Representation::Tagged(), | 166 Representation::Tagged(), |
| 167 Representation::Tagged(), |
161 Representation::Integer32() }; | 168 Representation::Integer32() }; |
162 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 169 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
163 eax, | 170 eax, |
164 deopt_handler, | 171 deopt_handler, |
165 representations, | 172 representations, |
166 constant_stack_parameter_count, | 173 constant_stack_parameter_count, |
167 JS_FUNCTION_STUB_MODE, | 174 JS_FUNCTION_STUB_MODE, |
168 PASS_ARGUMENTS); | 175 PASS_ARGUMENTS); |
169 } | 176 } |
170 } | 177 } |
(...skipping 30 matching lines...) Expand all Loading... |
201 | 208 |
202 | 209 |
203 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 210 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
204 CodeStubInterfaceDescriptor* descriptor) { | 211 CodeStubInterfaceDescriptor* descriptor) { |
205 InitializeInternalArrayConstructorDescriptor(descriptor, -1); | 212 InitializeInternalArrayConstructorDescriptor(descriptor, -1); |
206 } | 213 } |
207 | 214 |
208 | 215 |
209 void CompareNilICStub::InitializeInterfaceDescriptor( | 216 void CompareNilICStub::InitializeInterfaceDescriptor( |
210 CodeStubInterfaceDescriptor* descriptor) { | 217 CodeStubInterfaceDescriptor* descriptor) { |
211 Register registers[] = { eax }; | 218 Register registers[] = { esi, eax }; |
212 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 219 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
213 FUNCTION_ADDR(CompareNilIC_Miss)); | 220 FUNCTION_ADDR(CompareNilIC_Miss)); |
214 descriptor->SetMissHandler( | 221 descriptor->SetMissHandler( |
215 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); | 222 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); |
216 } | 223 } |
217 | 224 |
218 void ToBooleanStub::InitializeInterfaceDescriptor( | 225 void ToBooleanStub::InitializeInterfaceDescriptor( |
219 CodeStubInterfaceDescriptor* descriptor) { | 226 CodeStubInterfaceDescriptor* descriptor) { |
220 Register registers[] = { eax }; | 227 Register registers[] = { esi, eax }; |
221 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 228 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
222 FUNCTION_ADDR(ToBooleanIC_Miss)); | 229 FUNCTION_ADDR(ToBooleanIC_Miss)); |
223 descriptor->SetMissHandler( | 230 descriptor->SetMissHandler( |
224 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); | 231 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); |
225 } | 232 } |
226 | 233 |
227 | 234 |
228 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( | 235 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( |
229 CodeStubInterfaceDescriptor* descriptor) { | 236 CodeStubInterfaceDescriptor* descriptor) { |
230 Register registers[] = { eax, ebx, ecx, edx }; | 237 Register registers[] = { esi, eax, ebx, ecx, edx }; |
231 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 238 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
232 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss)); | 239 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss)); |
233 } | 240 } |
234 | 241 |
235 | 242 |
236 void BinaryOpICStub::InitializeInterfaceDescriptor( | 243 void BinaryOpICStub::InitializeInterfaceDescriptor( |
237 CodeStubInterfaceDescriptor* descriptor) { | 244 CodeStubInterfaceDescriptor* descriptor) { |
238 Register registers[] = { edx, eax }; | 245 Register registers[] = { esi, edx, eax }; |
239 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 246 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
240 FUNCTION_ADDR(BinaryOpIC_Miss)); | 247 FUNCTION_ADDR(BinaryOpIC_Miss)); |
241 descriptor->SetMissHandler( | 248 descriptor->SetMissHandler( |
242 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); | 249 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); |
243 } | 250 } |
244 | 251 |
245 | 252 |
246 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( | 253 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( |
247 CodeStubInterfaceDescriptor* descriptor) { | 254 CodeStubInterfaceDescriptor* descriptor) { |
248 Register registers[] = { ecx, edx, eax }; | 255 Register registers[] = { esi, ecx, edx, eax }; |
249 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 256 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
250 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); | 257 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); |
251 } | 258 } |
252 | 259 |
253 | 260 |
254 void StringAddStub::InitializeInterfaceDescriptor( | 261 void StringAddStub::InitializeInterfaceDescriptor( |
255 CodeStubInterfaceDescriptor* descriptor) { | 262 CodeStubInterfaceDescriptor* descriptor) { |
256 Register registers[] = { edx, eax }; | 263 Register registers[] = { esi, edx, eax }; |
257 descriptor->Initialize( | 264 descriptor->Initialize( |
258 ARRAY_SIZE(registers), registers, | 265 ARRAY_SIZE(registers), registers, |
259 Runtime::FunctionForId(Runtime::kStringAdd)->entry); | 266 Runtime::FunctionForId(Runtime::kStringAdd)->entry); |
260 } | 267 } |
261 | 268 |
262 | 269 |
263 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 270 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
264 { | 271 { |
265 CallInterfaceDescriptor* descriptor = | 272 CallInterfaceDescriptor* descriptor = |
266 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); | 273 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); |
267 Register registers[] = { edi, // JSFunction | 274 Register registers[] = { esi, // context |
268 esi, // context | 275 edi, // JSFunction |
269 eax, // actual number of arguments | 276 eax, // actual number of arguments |
270 ebx, // expected number of arguments | 277 ebx, // expected number of arguments |
271 }; | 278 }; |
272 Representation representations[] = { | 279 Representation representations[] = { |
| 280 Representation::Tagged(), // context |
273 Representation::Tagged(), // JSFunction | 281 Representation::Tagged(), // JSFunction |
274 Representation::Tagged(), // context | |
275 Representation::Integer32(), // actual number of arguments | 282 Representation::Integer32(), // actual number of arguments |
276 Representation::Integer32(), // expected number of arguments | 283 Representation::Integer32(), // expected number of arguments |
277 }; | 284 }; |
278 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 285 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); |
279 } | 286 } |
280 { | 287 { |
281 CallInterfaceDescriptor* descriptor = | 288 CallInterfaceDescriptor* descriptor = |
282 isolate->call_descriptor(Isolate::KeyedCall); | 289 isolate->call_descriptor(Isolate::KeyedCall); |
283 Register registers[] = { esi, // context | 290 Register registers[] = { esi, // context |
284 ecx, // key | 291 ecx, // key |
(...skipping 13 matching lines...) Expand all Loading... |
298 Representation representations[] = { | 305 Representation representations[] = { |
299 Representation::Tagged(), // context | 306 Representation::Tagged(), // context |
300 Representation::Tagged(), // name | 307 Representation::Tagged(), // name |
301 }; | 308 }; |
302 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 309 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); |
303 } | 310 } |
304 { | 311 { |
305 CallInterfaceDescriptor* descriptor = | 312 CallInterfaceDescriptor* descriptor = |
306 isolate->call_descriptor(Isolate::CallHandler); | 313 isolate->call_descriptor(Isolate::CallHandler); |
307 Register registers[] = { esi, // context | 314 Register registers[] = { esi, // context |
308 edx, // receiver | 315 edx, // name |
309 }; | 316 }; |
310 Representation representations[] = { | 317 Representation representations[] = { |
311 Representation::Tagged(), // context | 318 Representation::Tagged(), // context |
312 Representation::Tagged(), // receiver | 319 Representation::Tagged(), // receiver |
313 }; | 320 }; |
314 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 321 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); |
315 } | 322 } |
316 { | 323 { |
317 CallInterfaceDescriptor* descriptor = | 324 CallInterfaceDescriptor* descriptor = |
318 isolate->call_descriptor(Isolate::ApiFunctionCall); | 325 isolate->call_descriptor(Isolate::ApiFunctionCall); |
319 Register registers[] = { eax, // callee | 326 Register registers[] = { esi, // context |
| 327 eax, // callee |
320 ebx, // call_data | 328 ebx, // call_data |
321 ecx, // holder | 329 ecx, // holder |
322 edx, // api_function_address | 330 edx, // api_function_address |
323 esi, // context | |
324 }; | 331 }; |
325 Representation representations[] = { | 332 Representation representations[] = { |
| 333 Representation::Tagged(), // context |
326 Representation::Tagged(), // callee | 334 Representation::Tagged(), // callee |
327 Representation::Tagged(), // call_data | 335 Representation::Tagged(), // call_data |
328 Representation::Tagged(), // holder | 336 Representation::Tagged(), // holder |
329 Representation::External(), // api_function_address | 337 Representation::External(), // api_function_address |
330 Representation::Tagged(), // context | |
331 }; | 338 }; |
332 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 339 descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); |
333 } | 340 } |
334 } | 341 } |
335 | 342 |
336 | 343 |
337 #define __ ACCESS_MASM(masm) | 344 #define __ ACCESS_MASM(masm) |
338 | 345 |
339 | 346 |
340 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 347 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
341 // Update the static counter each time a new code stub is generated. | 348 // Update the static counter each time a new code stub is generated. |
342 isolate()->counters()->code_stubs()->Increment(); | 349 isolate()->counters()->code_stubs()->Increment(); |
343 | 350 |
344 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); | 351 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); |
345 int param_count = descriptor->register_param_count(); | 352 int param_count = descriptor->GetEnvironmentParameterCount(); |
346 { | 353 { |
347 // Call the runtime system in a fresh internal frame. | 354 // Call the runtime system in a fresh internal frame. |
348 FrameScope scope(masm, StackFrame::INTERNAL); | 355 FrameScope scope(masm, StackFrame::INTERNAL); |
349 ASSERT(descriptor->register_param_count() == 0 || | 356 ASSERT(param_count == 0 || |
350 eax.is(descriptor->GetParameterRegister(param_count - 1))); | 357 eax.is(descriptor->GetEnvironmentParameterRegister( |
| 358 param_count - 1))); |
351 // Push arguments | 359 // Push arguments |
352 for (int i = 0; i < param_count; ++i) { | 360 for (int i = 0; i < param_count; ++i) { |
353 __ push(descriptor->GetParameterRegister(i)); | 361 __ push(descriptor->GetEnvironmentParameterRegister(i)); |
354 } | 362 } |
355 ExternalReference miss = descriptor->miss_handler(); | 363 ExternalReference miss = descriptor->miss_handler(); |
356 __ CallExternalReference(miss, descriptor->register_param_count()); | 364 __ CallExternalReference(miss, param_count); |
357 } | 365 } |
358 | 366 |
359 __ ret(0); | 367 __ ret(0); |
360 } | 368 } |
361 | 369 |
362 | 370 |
363 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { | 371 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { |
364 // We don't allow a GC during a store buffer overflow so there is no need to | 372 // We don't allow a GC during a store buffer overflow so there is no need to |
365 // store the registers in any particular way, but we do have to store and | 373 // store the registers in any particular way, but we do have to store and |
366 // restore them. | 374 // restore them. |
(...skipping 4609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4976 Operand(ebp, 7 * kPointerSize), | 4984 Operand(ebp, 7 * kPointerSize), |
4977 NULL); | 4985 NULL); |
4978 } | 4986 } |
4979 | 4987 |
4980 | 4988 |
4981 #undef __ | 4989 #undef __ |
4982 | 4990 |
4983 } } // namespace v8::internal | 4991 } } // namespace v8::internal |
4984 | 4992 |
4985 #endif // V8_TARGET_ARCH_IA32 | 4993 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |