Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Flags: --allow-natives-syntax | |
| 6 | |
| 7 var foo = (function() { | |
| 8 "use asm"; | |
| 9 var a = new Uint8Array(2); | |
| 10 a[0] = 128; | |
| 11 a[1] = 127; | |
| 12 | |
| 13 function foo() { | |
| 14 var x = a[0]|0; | |
| 15 var y = a[1]|0; | |
| 16 if (x < 0) x = 4294967296 + x|0; | |
| 17 if (y < 0) y = 4294967296 + y|0; | |
| 18 return x >= y; | |
| 19 } | |
| 20 | |
| 21 return foo; | |
| 22 })(); | |
| 23 | |
| 24 assertTrue(foo()); | |
| 25 assertTrue(foo()); | |
| 26 %OptimizeFunctionOnNextCall(foo); | |
| 27 assertTrue(foo()); | |
| OLD | NEW |