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

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

Issue 352583002: The IC exposes a register definition. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments. Created 6 years, 6 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/deoptimizer.cc ('k') | src/ia32/deoptimizer-ia32.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_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/runtime.h" 16 #include "src/runtime.h"
17 #include "src/stub-cache.h" 17 #include "src/stub-cache.h"
18 18
19 namespace v8 { 19 namespace v8 {
20 namespace internal { 20 namespace internal {
21 21
22 22
23 void FastNewClosureStub::InitializeInterfaceDescriptor( 23 void FastNewClosureStub::InitializeInterfaceDescriptor(
24 CodeStubInterfaceDescriptor* descriptor) { 24 CodeStubInterfaceDescriptor* descriptor) {
25 static Register registers[] = { ebx }; 25 Register registers[] = { ebx };
26 descriptor->register_param_count_ = 1; 26 descriptor->Initialize(
27 descriptor->register_params_ = registers; 27 ARRAY_SIZE(registers), registers,
28 descriptor->deoptimization_handler_ = 28 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry);
29 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry;
30 } 29 }
31 30
32 31
33 void FastNewContextStub::InitializeInterfaceDescriptor( 32 void FastNewContextStub::InitializeInterfaceDescriptor(
34 CodeStubInterfaceDescriptor* descriptor) { 33 CodeStubInterfaceDescriptor* descriptor) {
35 static Register registers[] = { edi }; 34 Register registers[] = { edi };
36 descriptor->register_param_count_ = 1; 35 descriptor->Initialize(ARRAY_SIZE(registers), registers);
37 descriptor->register_params_ = registers;
38 descriptor->deoptimization_handler_ = NULL;
39 } 36 }
40 37
41 38
42 void ToNumberStub::InitializeInterfaceDescriptor( 39 void ToNumberStub::InitializeInterfaceDescriptor(
43 CodeStubInterfaceDescriptor* descriptor) { 40 CodeStubInterfaceDescriptor* descriptor) {
44 static Register registers[] = { eax }; 41 Register registers[] = { eax };
45 descriptor->register_param_count_ = 1; 42 descriptor->Initialize(ARRAY_SIZE(registers), registers);
46 descriptor->register_params_ = registers;
47 descriptor->deoptimization_handler_ = NULL;
48 } 43 }
49 44
50 45
51 void NumberToStringStub::InitializeInterfaceDescriptor( 46 void NumberToStringStub::InitializeInterfaceDescriptor(
52 CodeStubInterfaceDescriptor* descriptor) { 47 CodeStubInterfaceDescriptor* descriptor) {
53 static Register registers[] = { eax }; 48 Register registers[] = { eax };
54 descriptor->register_param_count_ = 1; 49 descriptor->Initialize(
55 descriptor->register_params_ = registers; 50 ARRAY_SIZE(registers), registers,
56 descriptor->deoptimization_handler_ = 51 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry);
57 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry;
58 } 52 }
59 53
60 54
61 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 55 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
62 CodeStubInterfaceDescriptor* descriptor) { 56 CodeStubInterfaceDescriptor* descriptor) {
63 static Register registers[] = { eax, ebx, ecx }; 57 Register registers[] = { eax, ebx, ecx };
64 descriptor->register_param_count_ = 3; 58 Representation representations[] = {
65 descriptor->register_params_ = registers;
66 static Representation representations[] = {
67 Representation::Tagged(), 59 Representation::Tagged(),
68 Representation::Smi(), 60 Representation::Smi(),
69 Representation::Tagged() }; 61 Representation::Tagged() };
70 descriptor->register_param_representations_ = representations; 62
71 descriptor->deoptimization_handler_ = 63 descriptor->Initialize(
64 ARRAY_SIZE(registers), registers,
72 Runtime::FunctionForId( 65 Runtime::FunctionForId(
73 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; 66 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry,
67 representations);
74 } 68 }
75 69
76 70
77 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 71 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
78 CodeStubInterfaceDescriptor* descriptor) { 72 CodeStubInterfaceDescriptor* descriptor) {
79 static Register registers[] = { eax, ebx, ecx, edx }; 73 Register registers[] = { eax, ebx, ecx, edx };
80 descriptor->register_param_count_ = 4; 74 descriptor->Initialize(
81 descriptor->register_params_ = registers; 75 ARRAY_SIZE(registers), registers,
82 descriptor->deoptimization_handler_ = 76 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry);
83 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry;
84 } 77 }
85 78
86 79
87 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( 80 void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
88 CodeStubInterfaceDescriptor* descriptor) { 81 CodeStubInterfaceDescriptor* descriptor) {
89 static Register registers[] = { ebx, edx }; 82 Register registers[] = { ebx, edx };
90 descriptor->register_param_count_ = 2; 83 descriptor->Initialize(ARRAY_SIZE(registers), registers);
91 descriptor->register_params_ = registers;
92 descriptor->deoptimization_handler_ = NULL;
93 }
94
95
96 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
97 CodeStubInterfaceDescriptor* descriptor) {
98 static Register registers[] = { edx, ecx };
99 descriptor->register_param_count_ = 2;
100 descriptor->register_params_ = registers;
101 descriptor->deoptimization_handler_ =
102 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
103 }
104
105
106 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
107 CodeStubInterfaceDescriptor* descriptor) {
108 static Register registers[] = { edx, ecx };
109 descriptor->register_param_count_ = 2;
110 descriptor->register_params_ = registers;
111 descriptor->deoptimization_handler_ =
112 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
113 } 84 }
114 85
115 86
116 void RegExpConstructResultStub::InitializeInterfaceDescriptor( 87 void RegExpConstructResultStub::InitializeInterfaceDescriptor(
117 CodeStubInterfaceDescriptor* descriptor) { 88 CodeStubInterfaceDescriptor* descriptor) {
118 static Register registers[] = { ecx, ebx, eax }; 89 Register registers[] = { ecx, ebx, eax };
119 descriptor->register_param_count_ = 3; 90 descriptor->Initialize(
120 descriptor->register_params_ = registers; 91 ARRAY_SIZE(registers), registers,
121 descriptor->deoptimization_handler_ = 92 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry);
122 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry;
123 }
124
125
126 void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor(
127 CodeStubInterfaceDescriptor* descriptor) {
128 static Register registers[] = { edx, ecx };
129 descriptor->register_param_count_ = 2;
130 descriptor->register_params_ = registers;
131 descriptor->deoptimization_handler_ =
132 Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry;
133 } 93 }
134 94
135 95
136 void LoadFieldStub::InitializeInterfaceDescriptor( 96 void LoadFieldStub::InitializeInterfaceDescriptor(
137 CodeStubInterfaceDescriptor* descriptor) { 97 CodeStubInterfaceDescriptor* descriptor) {
138 static Register registers[] = { edx }; 98 Register registers[] = { edx };
139 descriptor->register_param_count_ = 1; 99 descriptor->Initialize(ARRAY_SIZE(registers), registers);
140 descriptor->register_params_ = registers;
141 descriptor->deoptimization_handler_ = NULL;
142 } 100 }
143 101
144 102
145 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( 103 void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
146 CodeStubInterfaceDescriptor* descriptor) { 104 CodeStubInterfaceDescriptor* descriptor) {
147 static Register registers[] = { edx }; 105 Register registers[] = { edx };
148 descriptor->register_param_count_ = 1; 106 descriptor->Initialize(ARRAY_SIZE(registers), registers);
149 descriptor->register_params_ = registers;
150 descriptor->deoptimization_handler_ = NULL;
151 } 107 }
152 108
153 109
154 void StringLengthStub::InitializeInterfaceDescriptor( 110 void StringLengthStub::InitializeInterfaceDescriptor(
155 CodeStubInterfaceDescriptor* descriptor) { 111 CodeStubInterfaceDescriptor* descriptor) {
156 static Register registers[] = { edx, ecx }; 112 Register registers[] = { edx, ecx };
157 descriptor->register_param_count_ = 2; 113 descriptor->Initialize(ARRAY_SIZE(registers), registers);
158 descriptor->register_params_ = registers;
159 descriptor->deoptimization_handler_ = NULL;
160 } 114 }
161 115
162 116
163 void KeyedStringLengthStub::InitializeInterfaceDescriptor( 117 void KeyedStringLengthStub::InitializeInterfaceDescriptor(
164 CodeStubInterfaceDescriptor* descriptor) { 118 CodeStubInterfaceDescriptor* descriptor) {
165 static Register registers[] = { edx, ecx }; 119 Register registers[] = { edx, ecx };
166 descriptor->register_param_count_ = 2; 120 descriptor->Initialize(ARRAY_SIZE(registers), registers);
167 descriptor->register_params_ = registers;
168 descriptor->deoptimization_handler_ = NULL;
169 } 121 }
170 122
171 123
172 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( 124 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
173 CodeStubInterfaceDescriptor* descriptor) { 125 CodeStubInterfaceDescriptor* descriptor) {
174 static Register registers[] = { edx, ecx, eax }; 126 Register registers[] = { edx, ecx, eax };
175 descriptor->register_param_count_ = 3; 127 descriptor->Initialize(
176 descriptor->register_params_ = registers; 128 ARRAY_SIZE(registers), registers,
177 descriptor->deoptimization_handler_ = 129 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure));
178 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure);
179 } 130 }
180 131
181 132
182 void TransitionElementsKindStub::InitializeInterfaceDescriptor( 133 void TransitionElementsKindStub::InitializeInterfaceDescriptor(
183 CodeStubInterfaceDescriptor* descriptor) { 134 CodeStubInterfaceDescriptor* descriptor) {
184 static Register registers[] = { eax, ebx }; 135 Register registers[] = { eax, ebx };
185 descriptor->register_param_count_ = 2; 136 descriptor->Initialize(
186 descriptor->register_params_ = registers; 137 ARRAY_SIZE(registers), registers,
187 descriptor->deoptimization_handler_ = 138 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry);
188 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry;
189 } 139 }
190 140
191 141
192 static void InitializeArrayConstructorDescriptor( 142 static void InitializeArrayConstructorDescriptor(
193 Isolate* isolate, 143 Isolate* isolate,
194 CodeStubInterfaceDescriptor* descriptor, 144 CodeStubInterfaceDescriptor* descriptor,
195 int constant_stack_parameter_count) { 145 int constant_stack_parameter_count) {
196 // register state 146 // register state
197 // eax -- number of arguments 147 // eax -- number of arguments
198 // edi -- function 148 // edi -- function
199 // ebx -- allocation site with elements kind 149 // ebx -- allocation site with elements kind
200 static Register registers_variable_args[] = { edi, ebx, eax }; 150 Address deopt_handler = Runtime::FunctionForId(
201 static Register registers_no_args[] = { edi, ebx }; 151 Runtime::kHiddenArrayConstructor)->entry;
202 152
203 if (constant_stack_parameter_count == 0) { 153 if (constant_stack_parameter_count == 0) {
204 descriptor->register_param_count_ = 2; 154 Register registers[] = { edi, ebx };
205 descriptor->register_params_ = registers_no_args; 155 descriptor->Initialize(ARRAY_SIZE(registers), registers,
156 deopt_handler,
157 NULL,
158 constant_stack_parameter_count,
159 JS_FUNCTION_STUB_MODE);
206 } else { 160 } else {
207 // stack param count needs (constructor pointer, and single argument) 161 // stack param count needs (constructor pointer, and single argument)
208 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 162 Register registers[] = { edi, ebx, eax };
209 descriptor->stack_parameter_count_ = eax; 163 Representation representations[] = {
210 descriptor->register_param_count_ = 3;
211 descriptor->register_params_ = registers_variable_args;
212 static Representation representations[] = {
213 Representation::Tagged(), 164 Representation::Tagged(),
214 Representation::Tagged(), 165 Representation::Tagged(),
215 Representation::Integer32() }; 166 Representation::Integer32() };
216 descriptor->register_param_representations_ = representations; 167 descriptor->Initialize(ARRAY_SIZE(registers), registers,
168 eax,
169 deopt_handler,
170 representations,
171 constant_stack_parameter_count,
172 JS_FUNCTION_STUB_MODE,
173 PASS_ARGUMENTS);
217 } 174 }
218
219 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
220 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
221 descriptor->deoptimization_handler_ =
222 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry;
223 } 175 }
224 176
225 177
226 static void InitializeInternalArrayConstructorDescriptor( 178 static void InitializeInternalArrayConstructorDescriptor(
227 CodeStubInterfaceDescriptor* descriptor, 179 CodeStubInterfaceDescriptor* descriptor,
228 int constant_stack_parameter_count) { 180 int constant_stack_parameter_count) {
229 // register state 181 // register state
230 // eax -- number of arguments 182 // eax -- number of arguments
231 // edi -- constructor function 183 // edi -- constructor function
232 static Register registers_variable_args[] = { edi, eax }; 184 Address deopt_handler = Runtime::FunctionForId(
233 static Register registers_no_args[] = { edi }; 185 Runtime::kHiddenInternalArrayConstructor)->entry;
234 186
235 if (constant_stack_parameter_count == 0) { 187 if (constant_stack_parameter_count == 0) {
236 descriptor->register_param_count_ = 1; 188 Register registers[] = { edi };
237 descriptor->register_params_ = registers_no_args; 189 descriptor->Initialize(ARRAY_SIZE(registers), registers,
190 deopt_handler,
191 NULL,
192 constant_stack_parameter_count,
193 JS_FUNCTION_STUB_MODE);
238 } else { 194 } else {
239 // stack param count needs (constructor pointer, and single argument) 195 // stack param count needs (constructor pointer, and single argument)
240 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 196 Register registers[] = { edi, eax };
241 descriptor->stack_parameter_count_ = eax; 197 Representation representations[] = {
242 descriptor->register_param_count_ = 2;
243 descriptor->register_params_ = registers_variable_args;
244 static Representation representations[] = {
245 Representation::Tagged(), 198 Representation::Tagged(),
246 Representation::Integer32() }; 199 Representation::Integer32() };
247 descriptor->register_param_representations_ = representations; 200 descriptor->Initialize(ARRAY_SIZE(registers), registers,
201 eax,
202 deopt_handler,
203 representations,
204 constant_stack_parameter_count,
205 JS_FUNCTION_STUB_MODE,
206 PASS_ARGUMENTS);
248 } 207 }
249
250 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
251 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
252 descriptor->deoptimization_handler_ =
253 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry;
254 } 208 }
255 209
256 210
257 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 211 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
258 CodeStubInterfaceDescriptor* descriptor) { 212 CodeStubInterfaceDescriptor* descriptor) {
259 InitializeArrayConstructorDescriptor(isolate(), descriptor, 0); 213 InitializeArrayConstructorDescriptor(isolate(), descriptor, 0);
260 } 214 }
261 215
262 216
263 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( 217 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
(...skipping 21 matching lines...) Expand all
285 239
286 240
287 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( 241 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
288 CodeStubInterfaceDescriptor* descriptor) { 242 CodeStubInterfaceDescriptor* descriptor) {
289 InitializeInternalArrayConstructorDescriptor(descriptor, -1); 243 InitializeInternalArrayConstructorDescriptor(descriptor, -1);
290 } 244 }
291 245
292 246
293 void CompareNilICStub::InitializeInterfaceDescriptor( 247 void CompareNilICStub::InitializeInterfaceDescriptor(
294 CodeStubInterfaceDescriptor* descriptor) { 248 CodeStubInterfaceDescriptor* descriptor) {
295 static Register registers[] = { eax }; 249 Register registers[] = { eax };
296 descriptor->register_param_count_ = 1; 250 descriptor->Initialize(ARRAY_SIZE(registers), registers,
297 descriptor->register_params_ = registers; 251 FUNCTION_ADDR(CompareNilIC_Miss));
298 descriptor->deoptimization_handler_ =
299 FUNCTION_ADDR(CompareNilIC_Miss);
300 descriptor->SetMissHandler( 252 descriptor->SetMissHandler(
301 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); 253 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
302 } 254 }
303 255
304 void ToBooleanStub::InitializeInterfaceDescriptor( 256 void ToBooleanStub::InitializeInterfaceDescriptor(
305 CodeStubInterfaceDescriptor* descriptor) { 257 CodeStubInterfaceDescriptor* descriptor) {
306 static Register registers[] = { eax }; 258 Register registers[] = { eax };
307 descriptor->register_param_count_ = 1; 259 descriptor->Initialize(ARRAY_SIZE(registers), registers,
308 descriptor->register_params_ = registers; 260 FUNCTION_ADDR(ToBooleanIC_Miss));
309 descriptor->deoptimization_handler_ =
310 FUNCTION_ADDR(ToBooleanIC_Miss);
311 descriptor->SetMissHandler( 261 descriptor->SetMissHandler(
312 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); 262 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate()));
313 } 263 }
314 264
315 265
316 void StoreGlobalStub::InitializeInterfaceDescriptor( 266 void StoreGlobalStub::InitializeInterfaceDescriptor(
317 CodeStubInterfaceDescriptor* descriptor) { 267 CodeStubInterfaceDescriptor* descriptor) {
318 static Register registers[] = { edx, ecx, eax }; 268 Register registers[] = { edx, ecx, eax };
319 descriptor->register_param_count_ = 3; 269 descriptor->Initialize(ARRAY_SIZE(registers), registers,
320 descriptor->register_params_ = registers; 270 FUNCTION_ADDR(StoreIC_MissFromStubFailure));
321 descriptor->deoptimization_handler_ =
322 FUNCTION_ADDR(StoreIC_MissFromStubFailure);
323 } 271 }
324 272
325 273
326 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( 274 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
327 CodeStubInterfaceDescriptor* descriptor) { 275 CodeStubInterfaceDescriptor* descriptor) {
328 static Register registers[] = { eax, ebx, ecx, edx }; 276 Register registers[] = { eax, ebx, ecx, edx };
329 descriptor->register_param_count_ = 4; 277 descriptor->Initialize(ARRAY_SIZE(registers), registers,
330 descriptor->register_params_ = registers; 278 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
331 descriptor->deoptimization_handler_ =
332 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss);
333 } 279 }
334 280
335 281
336 void BinaryOpICStub::InitializeInterfaceDescriptor( 282 void BinaryOpICStub::InitializeInterfaceDescriptor(
337 CodeStubInterfaceDescriptor* descriptor) { 283 CodeStubInterfaceDescriptor* descriptor) {
338 static Register registers[] = { edx, eax }; 284 Register registers[] = { edx, eax };
339 descriptor->register_param_count_ = 2; 285 descriptor->Initialize(ARRAY_SIZE(registers), registers,
340 descriptor->register_params_ = registers; 286 FUNCTION_ADDR(BinaryOpIC_Miss));
341 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss);
342 descriptor->SetMissHandler( 287 descriptor->SetMissHandler(
343 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); 288 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate()));
344 } 289 }
345 290
346 291
347 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( 292 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
348 CodeStubInterfaceDescriptor* descriptor) { 293 CodeStubInterfaceDescriptor* descriptor) {
349 static Register registers[] = { ecx, edx, eax }; 294 Register registers[] = { ecx, edx, eax };
350 descriptor->register_param_count_ = 3; 295 descriptor->Initialize(ARRAY_SIZE(registers), registers,
351 descriptor->register_params_ = registers; 296 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite));
352 descriptor->deoptimization_handler_ =
353 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite);
354 } 297 }
355 298
356 299
357 void StringAddStub::InitializeInterfaceDescriptor( 300 void StringAddStub::InitializeInterfaceDescriptor(
358 CodeStubInterfaceDescriptor* descriptor) { 301 CodeStubInterfaceDescriptor* descriptor) {
359 static Register registers[] = { edx, eax }; 302 Register registers[] = { edx, eax };
360 descriptor->register_param_count_ = 2; 303 descriptor->Initialize(
361 descriptor->register_params_ = registers; 304 ARRAY_SIZE(registers), registers,
362 descriptor->deoptimization_handler_ = 305 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry);
363 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry;
364 } 306 }
365 307
366 308
367 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { 309 void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
368 { 310 {
369 CallInterfaceDescriptor* descriptor = 311 CallInterfaceDescriptor* descriptor =
370 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); 312 isolate->call_descriptor(Isolate::ArgumentAdaptorCall);
371 static Register registers[] = { edi, // JSFunction 313 static Register registers[] = { edi, // JSFunction
372 esi, // context 314 esi, // context
373 eax, // actual number of arguments 315 eax, // actual number of arguments
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 391
450 392
451 #define __ ACCESS_MASM(masm) 393 #define __ ACCESS_MASM(masm)
452 394
453 395
454 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { 396 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
455 // Update the static counter each time a new code stub is generated. 397 // Update the static counter each time a new code stub is generated.
456 isolate()->counters()->code_stubs()->Increment(); 398 isolate()->counters()->code_stubs()->Increment();
457 399
458 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); 400 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
459 int param_count = descriptor->register_param_count_; 401 int param_count = descriptor->register_param_count();
460 { 402 {
461 // Call the runtime system in a fresh internal frame. 403 // Call the runtime system in a fresh internal frame.
462 FrameScope scope(masm, StackFrame::INTERNAL); 404 FrameScope scope(masm, StackFrame::INTERNAL);
463 ASSERT(descriptor->register_param_count_ == 0 || 405 ASSERT(descriptor->register_param_count() == 0 ||
464 eax.is(descriptor->register_params_[param_count - 1])); 406 eax.is(descriptor->GetParameterRegister(param_count - 1)));
465 // Push arguments 407 // Push arguments
466 for (int i = 0; i < param_count; ++i) { 408 for (int i = 0; i < param_count; ++i) {
467 __ push(descriptor->register_params_[i]); 409 __ push(descriptor->GetParameterRegister(i));
468 } 410 }
469 ExternalReference miss = descriptor->miss_handler(); 411 ExternalReference miss = descriptor->miss_handler();
470 __ CallExternalReference(miss, descriptor->register_param_count_); 412 __ CallExternalReference(miss, descriptor->register_param_count());
471 } 413 }
472 414
473 __ ret(0); 415 __ ret(0);
474 } 416 }
475 417
476 418
477 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { 419 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) {
478 // We don't allow a GC during a store buffer overflow so there is no need to 420 // We don't allow a GC during a store buffer overflow so there is no need to
479 // store the registers in any particular way, but we do have to store and 421 // store the registers in any particular way, but we do have to store and
480 // restore them. 422 // restore them.
(...skipping 4604 matching lines...) Expand 10 before | Expand all | Expand 10 after
5085 Operand(ebp, 7 * kPointerSize), 5027 Operand(ebp, 7 * kPointerSize),
5086 NULL); 5028 NULL);
5087 } 5029 }
5088 5030
5089 5031
5090 #undef __ 5032 #undef __
5091 5033
5092 } } // namespace v8::internal 5034 } } // namespace v8::internal
5093 5035
5094 #endif // V8_TARGET_ARCH_IA32 5036 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698