OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 // Flags: --harmony-atomics --harmony-sharedarraybuffer | 5 // Flags: --harmony-sharedarraybuffer |
6 // | 6 // |
7 | 7 |
8 function toRangeWrapped(value) { | 8 function toRangeWrapped(value) { |
9 var range = this.max - this.min + 1; | 9 var range = this.max - this.min + 1; |
10 while (value < this.min) { | 10 while (value < this.min) { |
11 value += range; | 11 value += range; |
12 } | 12 } |
13 while (value > this.max) { | 13 while (value > this.max) { |
14 value -= range; | 14 value -= range; |
15 } | 15 } |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 // Exchange | 502 // Exchange |
503 sta[0] = val = 0x12; | 503 sta[0] = val = 0x12; |
504 operand = 0x22 + offset; | 504 operand = 0x22 + offset; |
505 valWrapped = t.toRange(operand); | 505 valWrapped = t.toRange(operand); |
506 assertEquals(val, Atomics.exchange(sta, 0, operand), name); | 506 assertEquals(val, Atomics.exchange(sta, 0, operand), name); |
507 assertEquals(valWrapped, sta[0], name); | 507 assertEquals(valWrapped, sta[0], name); |
508 } | 508 } |
509 | 509 |
510 }); | 510 }); |
511 })(); | 511 })(); |
OLD | NEW |