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

Side by Side Diff: runtime/lib/simd128.dart

Issue 12379085: Revert "Move Arrays class to private library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « runtime/lib/growable_array.dart ('k') | samples/swarm/swarm_ui_lib/observable/observable.dart » ('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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 patch class Float32x4 { 5 patch class Float32x4 {
6 /* patch */ factory Float32x4(double x, double y, double z, double w) { 6 /* patch */ factory Float32x4(double x, double y, double z, double w) {
7 return new _Float32x4(x, y, z, w); 7 return new _Float32x4(x, y, z, w);
8 } 8 }
9 /* patch */ factory Float32x4.zero() { 9 /* patch */ factory Float32x4.zero() {
10 return new _Float32x4.zero(); 10 return new _Float32x4.zero();
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 return result; 606 return result;
607 } 607 }
608 void setRange(int start, int length, List<Float32x4> from, 608 void setRange(int start, int length, List<Float32x4> from,
609 [int startFrom = 0]) { 609 [int startFrom = 0]) {
610 if (from is _Float32x4Array) { 610 if (from is _Float32x4Array) {
611 _setRange(start * _BYTES_PER_ELEMENT, 611 _setRange(start * _BYTES_PER_ELEMENT,
612 length * _BYTES_PER_ELEMENT, 612 length * _BYTES_PER_ELEMENT,
613 from, 613 from,
614 startFrom * _BYTES_PER_ELEMENT); 614 startFrom * _BYTES_PER_ELEMENT);
615 } else { 615 } else {
616 IterableMixinWorkaround.setRangeList( 616 Arrays.copy(from, startFrom, this, start, length);
617 this, start, length, from, startFrom);
618 } 617 }
619 } 618 }
620 String toString() { 619 String toString() {
621 return Collections.collectionToString(this); 620 return Collections.collectionToString(this);
622 } 621 }
623 int bytesPerElement() { 622 int bytesPerElement() {
624 return _BYTES_PER_ELEMENT; 623 return _BYTES_PER_ELEMENT;
625 } 624 }
626 int lengthInBytes() { 625 int lengthInBytes() {
627 return _length() * _BYTES_PER_ELEMENT; 626 return _length() * _BYTES_PER_ELEMENT;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 668
670 List<Float32x4> getRange(int start, int length) { 669 List<Float32x4> getRange(int start, int length) {
671 _rangeCheck(this.length, start, length); 670 _rangeCheck(this.length, start, length);
672 List<Float32x4> result = new Float32List(length); 671 List<Float32x4> result = new Float32List(length);
673 result.setRange(0, length, this, start); 672 result.setRange(0, length, this, start);
674 return result; 673 return result;
675 } 674 }
676 675
677 void setRange(int start, int length, List<Float32x4> from, 676 void setRange(int start, int length, List<Float32x4> from,
678 [int startFrom = 0]) { 677 [int startFrom = 0]) {
679 IterableMixinWorkaround.setRangeList(this, start, length, from, startFrom); 678 Arrays.copy(from, startFrom, this, start, length);
680 } 679 }
681 680
682 String toString() { 681 String toString() {
683 return Collections.collectionToString(this); 682 return Collections.collectionToString(this);
684 } 683 }
685 684
686 int bytesPerElement() { 685 int bytesPerElement() {
687 return _BYTES_PER_ELEMENT; 686 return _BYTES_PER_ELEMENT;
688 } 687 }
689 688
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 } 724 }
726 725
727 void setRange(int start, int length, List<Float32x4> from, 726 void setRange(int start, int length, List<Float32x4> from,
728 [int startFrom = 0]) { 727 [int startFrom = 0]) {
729 if (from is _ExternalFloat32x4Array) { 728 if (from is _ExternalFloat32x4Array) {
730 _setRange(start * _BYTES_PER_ELEMENT, 729 _setRange(start * _BYTES_PER_ELEMENT,
731 length * _BYTES_PER_ELEMENT, 730 length * _BYTES_PER_ELEMENT,
732 from, 731 from,
733 startFrom * _BYTES_PER_ELEMENT); 732 startFrom * _BYTES_PER_ELEMENT);
734 } else { 733 } else {
735 IterableMixinWorkaround.setRangeList( 734 Arrays.copy(from, startFrom, this, start, length);
736 this, start, length, from, startFrom);
737 } 735 }
738 } 736 }
739 737
740 String toString() { 738 String toString() {
741 return Collections.collectionToString(this); 739 return Collections.collectionToString(this);
742 } 740 }
743 741
744 int bytesPerElement() { 742 int bytesPerElement() {
745 return _BYTES_PER_ELEMENT; 743 return _BYTES_PER_ELEMENT;
746 } 744 }
747 745
748 int lengthInBytes() { 746 int lengthInBytes() {
749 return _length() * _BYTES_PER_ELEMENT; 747 return _length() * _BYTES_PER_ELEMENT;
750 } 748 }
751 749
752 static const int _BYTES_PER_ELEMENT = 16; 750 static const int _BYTES_PER_ELEMENT = 16;
753 751
754 Float32x4 _getIndexed(int index) 752 Float32x4 _getIndexed(int index)
755 native "ExternalFloat32x4Array_getIndexed"; 753 native "ExternalFloat32x4Array_getIndexed";
756 int _setIndexed(int index, Float32x4 value) 754 int _setIndexed(int index, Float32x4 value)
757 native "ExternalFloat32x4Array_setIndexed"; 755 native "ExternalFloat32x4Array_setIndexed";
758 } 756 }
OLDNEW
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | samples/swarm/swarm_ui_lib/observable/observable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698