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

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: Self-review Created 7 years 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
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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 isolate(), 530 isolate(),
531 isolate()->heap()->AllocateByteArray(length, pretenure), 531 isolate()->heap()->AllocateByteArray(length, pretenure),
532 ByteArray); 532 ByteArray);
533 } 533 }
534 534
535 535
536 Handle<ExternalArray> Factory::NewExternalArray(int length, 536 Handle<ExternalArray> Factory::NewExternalArray(int length,
537 ExternalArrayType array_type, 537 ExternalArrayType array_type,
538 void* external_pointer, 538 void* external_pointer,
539 PretenureFlag pretenure) { 539 PretenureFlag pretenure) {
540 ASSERT(0 <= length); 540 ASSERT(0 <= length && length <= Smi::kMaxValue);
541 CALL_HEAP_FUNCTION( 541 CALL_HEAP_FUNCTION(
542 isolate(), 542 isolate(),
543 isolate()->heap()->AllocateExternalArray(length, 543 isolate()->heap()->AllocateExternalArray(length,
544 array_type, 544 array_type,
545 external_pointer, 545 external_pointer,
546 pretenure), 546 pretenure),
547 ExternalArray); 547 ExternalArray);
548 } 548 }
549 549
550 550
551 Handle<FixedTypedArrayBase> Factory::NewFixedTypedArray(
552 int length,
553 ExternalArrayType array_type,
554 PretenureFlag pretenure) {
555 ASSERT(0 <= length && length <= Smi::kMaxValue);
556 CALL_HEAP_FUNCTION(
557 isolate(),
558 isolate()->heap()->AllocateFixedTypedArray(length,
559 array_type,
560 pretenure),
561 FixedTypedArrayBase);
562 }
563
564
551 Handle<Cell> Factory::NewCell(Handle<Object> value) { 565 Handle<Cell> Factory::NewCell(Handle<Object> value) {
552 AllowDeferredHandleDereference convert_to_cell; 566 AllowDeferredHandleDereference convert_to_cell;
553 CALL_HEAP_FUNCTION( 567 CALL_HEAP_FUNCTION(
554 isolate(), 568 isolate(),
555 isolate()->heap()->AllocateCell(*value), 569 isolate()->heap()->AllocateCell(*value),
556 Cell); 570 Cell);
557 } 571 }
558 572
559 573
560 Handle<PropertyCell> Factory::NewPropertyCellWithHole() { 574 Handle<PropertyCell> Factory::NewPropertyCellWithHole() {
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1797 return Handle<Object>::null(); 1811 return Handle<Object>::null();
1798 } 1812 }
1799 1813
1800 1814
1801 Handle<Object> Factory::ToBoolean(bool value) { 1815 Handle<Object> Factory::ToBoolean(bool value) {
1802 return value ? true_value() : false_value(); 1816 return value ? true_value() : false_value();
1803 } 1817 }
1804 1818
1805 1819
1806 } } // namespace v8::internal 1820 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698