| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 AddInstruction(new(zone) HLoadKeyed(GetParameter(0), | 283 AddInstruction(new(zone) HLoadKeyed(GetParameter(0), |
| 284 GetParameter(1), | 284 GetParameter(1), |
| 285 NULL, | 285 NULL, |
| 286 FAST_ELEMENTS)); | 286 FAST_ELEMENTS)); |
| 287 | 287 |
| 288 IfBuilder checker(this); | 288 IfBuilder checker(this); |
| 289 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(boilerplate, undefined); | 289 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(boilerplate, undefined); |
| 290 checker.Then(); | 290 checker.Then(); |
| 291 | 291 |
| 292 if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS) { | 292 if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS) { |
| 293 HValue* elements = | 293 HValue* elements = AddLoadElements(boilerplate); |
| 294 AddInstruction(new(zone) HLoadElements(boilerplate, NULL)); | |
| 295 | 294 |
| 296 IfBuilder if_fixed_cow(this); | 295 IfBuilder if_fixed_cow(this); |
| 297 if_fixed_cow.IfCompareMap(elements, factory->fixed_cow_array_map()); | 296 if_fixed_cow.IfCompareMap(elements, factory->fixed_cow_array_map()); |
| 298 if_fixed_cow.Then(); | 297 if_fixed_cow.Then(); |
| 299 environment()->Push(BuildCloneShallowArray(context(), | 298 environment()->Push(BuildCloneShallowArray(context(), |
| 300 boilerplate, | 299 boilerplate, |
| 301 alloc_site_mode, | 300 alloc_site_mode, |
| 302 FAST_ELEMENTS, | 301 FAST_ELEMENTS, |
| 303 0/*copy-on-write*/)); | 302 0/*copy-on-write*/)); |
| 304 if_fixed_cow.Else(); | 303 if_fixed_cow.Else(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 | 445 |
| 447 IfBuilder if_builder(this); | 446 IfBuilder if_builder(this); |
| 448 | 447 |
| 449 if_builder.IfCompare(array_length, graph()->GetConstant0(), Token::EQ); | 448 if_builder.IfCompare(array_length, graph()->GetConstant0(), Token::EQ); |
| 450 if_builder.Then(); | 449 if_builder.Then(); |
| 451 | 450 |
| 452 // Nothing to do, just change the map. | 451 // Nothing to do, just change the map. |
| 453 | 452 |
| 454 if_builder.Else(); | 453 if_builder.Else(); |
| 455 | 454 |
| 456 HInstruction* elements = | 455 HInstruction* elements = AddLoadElements(js_array); |
| 457 AddInstruction(new(zone) HLoadElements(js_array, js_array)); | |
| 458 | 456 |
| 459 HInstruction* elements_length = | 457 HInstruction* elements_length = |
| 460 AddInstruction(new(zone) HFixedArrayBaseLength(elements)); | 458 AddInstruction(new(zone) HFixedArrayBaseLength(elements)); |
| 461 | 459 |
| 462 HValue* new_elements = | 460 HValue* new_elements = |
| 463 BuildAllocateAndInitializeElements(context(), to_kind, elements_length); | 461 BuildAllocateAndInitializeElements(context(), to_kind, elements_length); |
| 464 | 462 |
| 465 BuildCopyElements(context(), elements, | 463 BuildCopyElements(context(), elements, |
| 466 casted_stub()->from_kind(), new_elements, | 464 casted_stub()->from_kind(), new_elements, |
| 467 to_kind, array_length, elements_length); | 465 to_kind, array_length, elements_length); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 ? graph()->GetConstantSmi1() | 632 ? graph()->GetConstantSmi1() |
| 635 : graph()->GetConstantUndefined(); | 633 : graph()->GetConstantUndefined(); |
| 636 } | 634 } |
| 637 | 635 |
| 638 | 636 |
| 639 Handle<Code> CompareNilICStub::GenerateCode() { | 637 Handle<Code> CompareNilICStub::GenerateCode() { |
| 640 return DoGenerateCode(this); | 638 return DoGenerateCode(this); |
| 641 } | 639 } |
| 642 | 640 |
| 643 } } // namespace v8::internal | 641 } } // namespace v8::internal |
| OLD | NEW |