OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 isolate(), | 722 isolate(), |
723 isolate()->heap()->AllocateByteArray(length, pretenure), | 723 isolate()->heap()->AllocateByteArray(length, pretenure), |
724 ByteArray); | 724 ByteArray); |
725 } | 725 } |
726 | 726 |
727 | 727 |
728 Handle<ExternalArray> Factory::NewExternalArray(int length, | 728 Handle<ExternalArray> Factory::NewExternalArray(int length, |
729 ExternalArrayType array_type, | 729 ExternalArrayType array_type, |
730 void* external_pointer, | 730 void* external_pointer, |
731 PretenureFlag pretenure) { | 731 PretenureFlag pretenure) { |
732 ASSERT(0 <= length && length <= Smi::kMaxValue); | 732 ASSERT(0 <= length); |
733 CALL_HEAP_FUNCTION( | 733 CALL_HEAP_FUNCTION( |
734 isolate(), | 734 isolate(), |
735 isolate()->heap()->AllocateExternalArray(length, | 735 isolate()->heap()->AllocateExternalArray(length, |
736 array_type, | 736 array_type, |
737 external_pointer, | 737 external_pointer, |
738 pretenure), | 738 pretenure), |
739 ExternalArray); | 739 ExternalArray); |
740 } | 740 } |
741 | 741 |
742 | 742 |
743 Handle<FixedTypedArrayBase> Factory::NewFixedTypedArray( | |
744 int length, | |
745 ExternalArrayType array_type, | |
746 PretenureFlag pretenure) { | |
747 ASSERT(0 <= length && length <= Smi::kMaxValue); | |
748 CALL_HEAP_FUNCTION( | |
749 isolate(), | |
750 isolate()->heap()->AllocateFixedTypedArray(length, | |
751 array_type, | |
752 pretenure), | |
753 FixedTypedArrayBase); | |
754 } | |
755 | |
756 | |
757 Handle<Cell> Factory::NewCell(Handle<Object> value) { | 743 Handle<Cell> Factory::NewCell(Handle<Object> value) { |
758 AllowDeferredHandleDereference convert_to_cell; | 744 AllowDeferredHandleDereference convert_to_cell; |
759 CALL_HEAP_FUNCTION( | 745 CALL_HEAP_FUNCTION( |
760 isolate(), | 746 isolate(), |
761 isolate()->heap()->AllocateCell(*value), | 747 isolate()->heap()->AllocateCell(*value), |
762 Cell); | 748 Cell); |
763 } | 749 } |
764 | 750 |
765 | 751 |
766 Handle<PropertyCell> Factory::NewPropertyCellWithHole() { | 752 Handle<PropertyCell> Factory::NewPropertyCellWithHole() { |
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 return Handle<Object>::null(); | 1993 return Handle<Object>::null(); |
2008 } | 1994 } |
2009 | 1995 |
2010 | 1996 |
2011 Handle<Object> Factory::ToBoolean(bool value) { | 1997 Handle<Object> Factory::ToBoolean(bool value) { |
2012 return value ? true_value() : false_value(); | 1998 return value ? true_value() : false_value(); |
2013 } | 1999 } |
2014 | 2000 |
2015 | 2001 |
2016 } } // namespace v8::internal | 2002 } } // namespace v8::internal |
OLD | NEW |