Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Side by Side Diff: src/factory.cc

Issue 101413006: Implement in-heap backing store for typed arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: GC fixes Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/factory.h ('k') | src/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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); 732 ASSERT(0 <= length && length <= Smi::kMaxValue);
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
743 Handle<Cell> Factory::NewCell(Handle<Object> value) { 757 Handle<Cell> Factory::NewCell(Handle<Object> value) {
744 AllowDeferredHandleDereference convert_to_cell; 758 AllowDeferredHandleDereference convert_to_cell;
745 CALL_HEAP_FUNCTION( 759 CALL_HEAP_FUNCTION(
746 isolate(), 760 isolate(),
747 isolate()->heap()->AllocateCell(*value), 761 isolate()->heap()->AllocateCell(*value),
748 Cell); 762 Cell);
749 } 763 }
750 764
751 765
752 Handle<PropertyCell> Factory::NewPropertyCellWithHole() { 766 Handle<PropertyCell> Factory::NewPropertyCellWithHole() {
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1993 return Handle<Object>::null(); 2007 return Handle<Object>::null();
1994 } 2008 }
1995 2009
1996 2010
1997 Handle<Object> Factory::ToBoolean(bool value) { 2011 Handle<Object> Factory::ToBoolean(bool value) {
1998 return value ? true_value() : false_value(); 2012 return value ? true_value() : false_value();
1999 } 2013 }
2000 2014
2001 2015
2002 } } // namespace v8::internal 2016 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698