OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 endmacro | 55 endmacro |
56 | 56 |
57 SIMD_ALL_TYPES(DECLARE_GLOBALS) | 57 SIMD_ALL_TYPES(DECLARE_GLOBALS) |
58 | 58 |
59 macro DECLARE_COMMON_FUNCTIONS(NAME, TYPE, LANES) | 59 macro DECLARE_COMMON_FUNCTIONS(NAME, TYPE, LANES) |
60 function NAMECheckJS(a) { | 60 function NAMECheckJS(a) { |
61 return %NAMECheck(a); | 61 return %NAMECheck(a); |
62 } | 62 } |
63 | 63 |
64 function NAMEToString() { | 64 function NAMEToString() { |
65 var value = %ValueOf(this); | 65 var value = %_ValueOf(this); |
66 if (typeof(value) !== 'TYPE') { | 66 if (typeof(value) !== 'TYPE') { |
67 throw MakeTypeError(kIncompatibleMethodReceiver, | 67 throw MakeTypeError(kIncompatibleMethodReceiver, |
68 "NAME.prototype.toString", this); | 68 "NAME.prototype.toString", this); |
69 } | 69 } |
70 var str = "SIMD.NAME("; | 70 var str = "SIMD.NAME("; |
71 str += %NAMEExtractLane(value, 0); | 71 str += %NAMEExtractLane(value, 0); |
72 for (var i = 1; i < LANES; i++) { | 72 for (var i = 1; i < LANES; i++) { |
73 str += ", " + %NAMEExtractLane(value, i); | 73 str += ", " + %NAMEExtractLane(value, i); |
74 } | 74 } |
75 return str + ")"; | 75 return str + ")"; |
76 } | 76 } |
77 | 77 |
78 function NAMEToLocaleString() { | 78 function NAMEToLocaleString() { |
79 var value = %ValueOf(this); | 79 var value = %_ValueOf(this); |
80 if (typeof(value) !== 'TYPE') { | 80 if (typeof(value) !== 'TYPE') { |
81 throw MakeTypeError(kIncompatibleMethodReceiver, | 81 throw MakeTypeError(kIncompatibleMethodReceiver, |
82 "NAME.prototype.toLocaleString", this); | 82 "NAME.prototype.toLocaleString", this); |
83 } | 83 } |
84 var str = "SIMD.NAME("; | 84 var str = "SIMD.NAME("; |
85 str += %NAMEExtractLane(value, 0).toLocaleString(); | 85 str += %NAMEExtractLane(value, 0).toLocaleString(); |
86 for (var i = 1; i < LANES; i++) { | 86 for (var i = 1; i < LANES; i++) { |
87 str += ", " + %NAMEExtractLane(value, i).toLocaleString(); | 87 str += ", " + %NAMEExtractLane(value, i).toLocaleString(); |
88 } | 88 } |
89 return str + ")"; | 89 return str + ")"; |
90 } | 90 } |
91 | 91 |
92 function NAMEValueOf() { | 92 function NAMEValueOf() { |
93 var value = %ValueOf(this); | 93 var value = %_ValueOf(this); |
94 if (typeof(value) !== 'TYPE') { | 94 if (typeof(value) !== 'TYPE') { |
95 throw MakeTypeError(kIncompatibleMethodReceiver, | 95 throw MakeTypeError(kIncompatibleMethodReceiver, |
96 "NAME.prototype.valueOf", this); | 96 "NAME.prototype.valueOf", this); |
97 } | 97 } |
98 return value; | 98 return value; |
99 } | 99 } |
100 | 100 |
101 function NAMEExtractLaneJS(instance, lane) { | 101 function NAMEExtractLaneJS(instance, lane) { |
102 return %NAMEExtractLane(instance, lane); | 102 return %NAMEExtractLane(instance, lane); |
103 } | 103 } |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 to.Bool32x4ToString = Bool32x4ToString; | 932 to.Bool32x4ToString = Bool32x4ToString; |
933 to.Int16x8ToString = Int16x8ToString; | 933 to.Int16x8ToString = Int16x8ToString; |
934 to.Uint16x8ToString = Uint16x8ToString; | 934 to.Uint16x8ToString = Uint16x8ToString; |
935 to.Bool16x8ToString = Bool16x8ToString; | 935 to.Bool16x8ToString = Bool16x8ToString; |
936 to.Int8x16ToString = Int8x16ToString; | 936 to.Int8x16ToString = Int8x16ToString; |
937 to.Uint8x16ToString = Uint8x16ToString; | 937 to.Uint8x16ToString = Uint8x16ToString; |
938 to.Bool8x16ToString = Bool8x16ToString; | 938 to.Bool8x16ToString = Bool8x16ToString; |
939 }); | 939 }); |
940 | 940 |
941 }) | 941 }) |
OLD | NEW |