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 boom = (function(stdlib, foreign, heap) { |
| 8 "use asm"; |
| 9 var MEM8 = new stdlib.Uint8Array(heap); |
| 10 var MEM32 = new stdlib.Int32Array(heap); |
| 11 function foo(i, j) { |
| 12 j = MEM8[256]; |
| 13 // This following value '10' determines the value of 'rax' |
| 14 MEM32[j >> 10] = 0xabcdefaa; |
| 15 return MEM32[j >> 2] + j |
| 16 } |
| 17 return foo |
| 18 })(this, 0, new ArrayBuffer(256)); |
| 19 %OptimizeFunctionOnNextCall(boom); |
| 20 boom(0, 0x1000); |
OLD | NEW |