OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS) { | 210 if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS) { |
211 HValue* elements = | 211 HValue* elements = |
212 AddInstruction(new(zone) HLoadElements(boilerplate, NULL)); | 212 AddInstruction(new(zone) HLoadElements(boilerplate, NULL)); |
213 | 213 |
214 IfBuilder if_fixed_cow(this); | 214 IfBuilder if_fixed_cow(this); |
215 if_fixed_cow.BeginIfMapEquals(elements, factory->fixed_cow_array_map()); | 215 if_fixed_cow.BeginIfMapEquals(elements, factory->fixed_cow_array_map()); |
216 environment()->Push(BuildCloneShallowArray(context(), | 216 environment()->Push(BuildCloneShallowArray(context(), |
217 boilerplate, | 217 boilerplate, |
218 alloc_site_mode, | 218 alloc_site_mode, |
219 FAST_ELEMENTS, | 219 FAST_ELEMENTS, |
220 BailoutId::StubEntry(), | |
221 0/*copy-on-write*/)); | 220 0/*copy-on-write*/)); |
222 if_fixed_cow.BeginElse(); | 221 if_fixed_cow.BeginElse(); |
223 | 222 |
224 IfBuilder if_fixed(this); | 223 IfBuilder if_fixed(this); |
225 if_fixed.BeginIfMapEquals(elements, factory->fixed_array_map()); | 224 if_fixed.BeginIfMapEquals(elements, factory->fixed_array_map()); |
226 environment()->Push(BuildCloneShallowArray(context(), | 225 environment()->Push(BuildCloneShallowArray(context(), |
227 boilerplate, | 226 boilerplate, |
228 alloc_site_mode, | 227 alloc_site_mode, |
229 FAST_ELEMENTS, | 228 FAST_ELEMENTS, |
230 BailoutId::StubEntry(), | |
231 length)); | 229 length)); |
232 if_fixed.BeginElse(); | 230 if_fixed.BeginElse(); |
233 | 231 |
234 environment()->Push(BuildCloneShallowArray(context(), | 232 environment()->Push(BuildCloneShallowArray(context(), |
235 boilerplate, | 233 boilerplate, |
236 alloc_site_mode, | 234 alloc_site_mode, |
237 FAST_DOUBLE_ELEMENTS, | 235 FAST_DOUBLE_ELEMENTS, |
238 BailoutId::StubEntry(), | |
239 length)); | 236 length)); |
240 } else { | 237 } else { |
241 ElementsKind elements_kind = casted_stub()->ComputeElementsKind(); | 238 ElementsKind elements_kind = casted_stub()->ComputeElementsKind(); |
242 environment()->Push(BuildCloneShallowArray(context(), | 239 environment()->Push(BuildCloneShallowArray(context(), |
243 boilerplate, | 240 boilerplate, |
244 alloc_site_mode, | 241 alloc_site_mode, |
245 elements_kind, | 242 elements_kind, |
246 BailoutId::StubEntry(), | |
247 length)); | 243 length)); |
248 } | 244 } |
249 | 245 |
250 return environment()->Pop(); | 246 return environment()->Pop(); |
251 } | 247 } |
252 | 248 |
253 | 249 |
254 Handle<Code> FastCloneShallowArrayStub::GenerateCode() { | 250 Handle<Code> FastCloneShallowArrayStub::GenerateCode() { |
255 CodeStubGraphBuilder<FastCloneShallowArrayStub> builder(this); | 251 CodeStubGraphBuilder<FastCloneShallowArrayStub> builder(this); |
256 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); | 252 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 current_block()->MarkAsDeoptimizing(); | 434 current_block()->MarkAsDeoptimizing(); |
439 return GetParameter(0); | 435 return GetParameter(0); |
440 } | 436 } |
441 | 437 |
442 | 438 |
443 Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() { | 439 Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() { |
444 return DoGenerateCode(this); | 440 return DoGenerateCode(this); |
445 } | 441 } |
446 | 442 |
447 } } // namespace v8::internal | 443 } } // namespace v8::internal |
OLD | NEW |