| 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 // Smi check and range check on the input arg. | 557 // Smi check and range check on the input arg. |
| 558 HValue* constant_one = graph()->GetConstant1(); | 558 HValue* constant_one = graph()->GetConstant1(); |
| 559 HValue* constant_zero = graph()->GetConstant0(); | 559 HValue* constant_zero = graph()->GetConstant0(); |
| 560 | 560 |
| 561 HInstruction* elements = AddInstruction( | 561 HInstruction* elements = AddInstruction( |
| 562 new(zone()) HArgumentsElements(false)); | 562 new(zone()) HArgumentsElements(false)); |
| 563 HInstruction* argument = AddInstruction( | 563 HInstruction* argument = AddInstruction( |
| 564 new(zone()) HAccessArgumentsAt(elements, constant_one, constant_zero)); | 564 new(zone()) HAccessArgumentsAt(elements, constant_one, constant_zero)); |
| 565 | 565 |
| 566 HConstant* max_alloc_length = | 566 HConstant* max_alloc_length = |
| 567 new(zone()) HConstant(JSObject::kInitialMaxFastElementArray, | 567 new(zone()) HConstant(JSObject::kInitialMaxFastElementArray); |
| 568 Representation::Tagged()); | |
| 569 AddInstruction(max_alloc_length); | 568 AddInstruction(max_alloc_length); |
| 570 const int initial_capacity = JSArray::kPreallocatedArrayElements; | 569 const int initial_capacity = JSArray::kPreallocatedArrayElements; |
| 571 HConstant* initial_capacity_node = | 570 HConstant* initial_capacity_node = new(zone()) HConstant(initial_capacity); |
| 572 new(zone()) HConstant(initial_capacity, Representation::Tagged()); | |
| 573 AddInstruction(initial_capacity_node); | 571 AddInstruction(initial_capacity_node); |
| 574 | 572 |
| 575 HBoundsCheck* checked_arg = AddBoundsCheck( | 573 HBoundsCheck* checked_arg = AddBoundsCheck(argument, max_alloc_length); |
| 576 argument, max_alloc_length, ALLOW_SMI_KEY); | |
| 577 IfBuilder if_builder(this); | 574 IfBuilder if_builder(this); |
| 578 if_builder.IfCompare(checked_arg, constant_zero, Token::EQ); | 575 if_builder.IfCompare(checked_arg, constant_zero, Token::EQ); |
| 579 if_builder.Then(); | 576 if_builder.Then(); |
| 580 Push(initial_capacity_node); // capacity | 577 Push(initial_capacity_node); // capacity |
| 581 Push(constant_zero); // length | 578 Push(constant_zero); // length |
| 582 if_builder.Else(); | 579 if_builder.Else(); |
| 583 Push(checked_arg); // capacity | 580 Push(checked_arg); // capacity |
| 584 Push(checked_arg); // length | 581 Push(checked_arg); // length |
| 585 if_builder.End(); | 582 if_builder.End(); |
| 586 | 583 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 ? graph()->GetConstant1() | 667 ? graph()->GetConstant1() |
| 671 : graph()->GetConstantUndefined(); | 668 : graph()->GetConstantUndefined(); |
| 672 } | 669 } |
| 673 | 670 |
| 674 | 671 |
| 675 Handle<Code> CompareNilICStub::GenerateCode() { | 672 Handle<Code> CompareNilICStub::GenerateCode() { |
| 676 return DoGenerateCode(this); | 673 return DoGenerateCode(this); |
| 677 } | 674 } |
| 678 | 675 |
| 679 } } // namespace v8::internal | 676 } } // namespace v8::internal |
| OLD | NEW |