| 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 | 503 |
| 504 if_builder.IfCompare(array_length, graph()->GetConstant0(), Token::EQ); | 504 if_builder.IfCompare(array_length, graph()->GetConstant0(), Token::EQ); |
| 505 if_builder.Then(); | 505 if_builder.Then(); |
| 506 | 506 |
| 507 // Nothing to do, just change the map. | 507 // Nothing to do, just change the map. |
| 508 | 508 |
| 509 if_builder.Else(); | 509 if_builder.Else(); |
| 510 | 510 |
| 511 HInstruction* elements = AddLoadElements(js_array); | 511 HInstruction* elements = AddLoadElements(js_array); |
| 512 | 512 |
| 513 HInstruction* elements_length = | 513 HInstruction* elements_length = AddLoadFixedArrayLength(elements); |
| 514 AddInstruction(new(zone) HFixedArrayBaseLength(elements)); | |
| 515 | 514 |
| 516 HValue* new_elements = BuildAllocateElementsAndInitializeElementsHeader( | 515 HValue* new_elements = BuildAllocateElementsAndInitializeElementsHeader( |
| 517 context(), to_kind, elements_length); | 516 context(), to_kind, elements_length); |
| 518 | 517 |
| 519 BuildCopyElements(context(), elements, | 518 BuildCopyElements(context(), elements, |
| 520 casted_stub()->from_kind(), new_elements, | 519 casted_stub()->from_kind(), new_elements, |
| 521 to_kind, array_length, elements_length); | 520 to_kind, array_length, elements_length); |
| 522 | 521 |
| 523 AddStore(js_array, HObjectAccess::ForElementsPointer(), new_elements); | 522 AddStore(js_array, HObjectAccess::ForElementsPointer(), new_elements); |
| 524 | 523 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 return graph()->GetConstant0(); | 776 return graph()->GetConstant0(); |
| 778 } | 777 } |
| 779 | 778 |
| 780 | 779 |
| 781 Handle<Code> ToBooleanStub::GenerateCode() { | 780 Handle<Code> ToBooleanStub::GenerateCode() { |
| 782 return DoGenerateCode(this); | 781 return DoGenerateCode(this); |
| 783 } | 782 } |
| 784 | 783 |
| 785 | 784 |
| 786 } } // namespace v8::internal | 785 } } // namespace v8::internal |
| OLD | NEW |