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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 HInstruction* argument = AddInstruction( | 592 HInstruction* argument = AddInstruction( |
593 new(zone()) HAccessArgumentsAt(elements, constant_one, constant_zero)); | 593 new(zone()) HAccessArgumentsAt(elements, constant_one, constant_zero)); |
594 | 594 |
595 HConstant* max_alloc_length = | 595 HConstant* max_alloc_length = |
596 new(zone()) HConstant(JSObject::kInitialMaxFastElementArray); | 596 new(zone()) HConstant(JSObject::kInitialMaxFastElementArray); |
597 AddInstruction(max_alloc_length); | 597 AddInstruction(max_alloc_length); |
598 const int initial_capacity = JSArray::kPreallocatedArrayElements; | 598 const int initial_capacity = JSArray::kPreallocatedArrayElements; |
599 HConstant* initial_capacity_node = new(zone()) HConstant(initial_capacity); | 599 HConstant* initial_capacity_node = new(zone()) HConstant(initial_capacity); |
600 AddInstruction(initial_capacity_node); | 600 AddInstruction(initial_capacity_node); |
601 | 601 |
602 HBoundsCheck* checked_arg = AddBoundsCheck(argument, max_alloc_length); | 602 HBoundsCheck* checked_arg = Add<HBoundsCheck>(argument, max_alloc_length); |
603 IfBuilder if_builder(this); | 603 IfBuilder if_builder(this); |
604 if_builder.IfCompare(checked_arg, constant_zero, Token::EQ); | 604 if_builder.IfCompare(checked_arg, constant_zero, Token::EQ); |
605 if_builder.Then(); | 605 if_builder.Then(); |
606 Push(initial_capacity_node); // capacity | 606 Push(initial_capacity_node); // capacity |
607 Push(constant_zero); // length | 607 Push(constant_zero); // length |
608 if_builder.Else(); | 608 if_builder.Else(); |
609 Push(checked_arg); // capacity | 609 Push(checked_arg); // capacity |
610 Push(checked_arg); // length | 610 Push(checked_arg); // length |
611 if_builder.End(); | 611 if_builder.End(); |
612 | 612 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 return graph()->GetConstant0(); | 768 return graph()->GetConstant0(); |
769 } | 769 } |
770 | 770 |
771 | 771 |
772 Handle<Code> ToBooleanStub::GenerateCode() { | 772 Handle<Code> ToBooleanStub::GenerateCode() { |
773 return DoGenerateCode(this); | 773 return DoGenerateCode(this); |
774 } | 774 } |
775 | 775 |
776 | 776 |
777 } } // namespace v8::internal | 777 } } // namespace v8::internal |
OLD | NEW |