| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import "../../../lib/compiler/implementation/ssa/ssa.dart"; | 5 import "../../../lib/compiler/implementation/ssa/ssa.dart"; |
| 6 import "../../../lib/compiler/implementation/dart2jslib.dart"; | 6 import "../../../lib/compiler/implementation/dart2jslib.dart"; |
| 7 import "../../../lib/compiler/implementation/js_backend/js_backend.dart"; | 7 import "../../../lib/compiler/implementation/js_backend/js_backend.dart"; |
| 8 | 8 |
| 9 ValueRangeInfo info = new ValueRangeInfo(const JavaScriptConstantSystem()); | 9 ValueRangeInfo info = new ValueRangeInfo(const JavaScriptConstantSystem()); |
| 10 | 10 |
| 11 Value instructionValue = info.newInstructionValue(new HReturn(null)); | 11 Value instructionValue = info.newInstructionValue(new HReturn(null)); |
| 12 Value lengthValue = info.newLengthValue(new HReturn(null)); | 12 Value lengthValue = info.newLengthValue(new HReturn(null)); |
| 13 | 13 |
| 14 Range createSingleRange(Value value) => info.newRange(value, value); | 14 Range createSingleRange(Value value) => info.newRange(value, value); |
| 15 Range createSingleIntRange(int value) => createSingleRange(info.newIntValue(valu
e)); | 15 |
| 16 Range createSingleIntRange(int value) { |
| 17 return createSingleRange(info.newIntValue(value)); |
| 18 } |
| 19 |
| 16 Range createSingleInstructionRange() => createSingleRange(instructionValue); | 20 Range createSingleInstructionRange() => createSingleRange(instructionValue); |
| 21 |
| 17 Range createSingleLengthRange() => createSingleRange(lengthValue); | 22 Range createSingleLengthRange() => createSingleRange(lengthValue); |
| 23 |
| 18 Range createIntRange(int lower, int upper) { | 24 Range createIntRange(int lower, int upper) { |
| 19 return info.newRange(info.newIntValue(lower), info.newIntValue(upper)); | 25 return info.newRange(info.newIntValue(lower), info.newIntValue(upper)); |
| 20 } | 26 } |
| 27 |
| 21 Range createLengthRange(int lower) { | 28 Range createLengthRange(int lower) { |
| 22 return info.newRange(info.newIntValue(lower), lengthValue); | 29 return info.newRange(info.newIntValue(lower), lengthValue); |
| 23 } | 30 } |
| 31 |
| 24 Range createInstructionRange(int lower) { | 32 Range createInstructionRange(int lower) { |
| 25 return info.newRange(info.newIntValue(lower), instructionValue); | 33 return info.newRange(info.newIntValue(lower), instructionValue); |
| 26 } | 34 } |
| 27 | 35 |
| 28 Range instruction = createSingleInstructionRange(); | 36 Range instruction = createSingleInstructionRange(); |
| 29 Range FF = createSingleIntRange(0xFF); | 37 Range FF = createSingleIntRange(0xFF); |
| 30 Range FA = createSingleIntRange(0xFA); | 38 Range FA = createSingleIntRange(0xFA); |
| 31 Range nFF = createSingleIntRange(-0xFF); | 39 Range nFF = createSingleIntRange(-0xFF); |
| 32 Range length = createSingleLengthRange(); | 40 Range length = createSingleLengthRange(); |
| 33 Range _FA_FF = createIntRange(0xFA, 0xFF); | 41 Range _FA_FF = createIntRange(0xFA, 0xFF); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 checkSubRange(_0_instruction, _0_length, null, _0_instruction.upper); | 374 checkSubRange(_0_instruction, _0_length, null, _0_instruction.upper); |
| 367 checkSubRange(_0_instruction, _0_instruction, null, _0_instruction.upper); | 375 checkSubRange(_0_instruction, _0_instruction, null, _0_instruction.upper); |
| 368 } | 376 } |
| 369 | 377 |
| 370 main() { | 378 main() { |
| 371 HInstruction.idCounter = 0; | 379 HInstruction.idCounter = 0; |
| 372 testAnd(); | 380 testAnd(); |
| 373 testSub(); | 381 testSub(); |
| 374 testNegate(); | 382 testNegate(); |
| 375 } | 383 } |
| OLD | NEW |