Files
sdk/pkg/vm/testcases/bytecode/asserts.dart.expect
T
Alexander Markov c53952a46d [vm/kernel/bytecode] Generate bytecode for assertions, bool checks
In addition:

* Use InstanceCall1 instead of InstanceCall2 for now as InstanceCall2
  requires ICData objects with 2 checked arguments.

* Remove try-catch around bytecode generation as all operations are
  supported and silent fallback is no longer needed.

Change-Id: Iead5a4997450cc47ef3bb3221647e733b7a72b62
Reviewed-on: https://dart-review.googlesource.com/62443
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-06-26 23:07:18 +00:00

81 lines
1.9 KiB
Plaintext

library #lib;
import self as self;
import "dart:core" as core;
[@vm.bytecode=
Bytecode {
Entry 0
CheckStack
JumpIfNoAsserts L1
Push FP[-5]
AssertBoolean 0
PushConstant CP#0
IfEqStrictTOS
Jump L1
PushConstant CP#1
PushConstant CP#2
PushConstant CP#3
PushConstant CP#5
IndirectStaticCall 3, CP#4
L1:
PushConstant CP#3
ReturnTOS
}
ConstantPool {
[0] = Bool true
[1] = Int 255
[2] = Int 264
[3] = Null
[4] = ArgDesc num-args 3, num-type-args 0, names []
[5] = StaticICData target 'dart.core::_AssertionError::_throwNew', arg-desc CP#4
}
]static method test1(core::bool condition) → void {
assert(condition);
}
[@vm.bytecode=
Bytecode {
Entry 0
CheckStack
JumpIfNoAsserts L1
Push FP[-6]
InstanceCall1 1, CP#1
AssertBoolean 0
PushConstant CP#2
IfEqStrictTOS
Jump L1
PushConstant CP#3
PushConstant CP#4
Push FP[-5]
InstanceCall1 1, CP#5
PushConstant CP#7
IndirectStaticCall 3, CP#6
L1:
PushConstant CP#8
ReturnTOS
}
ConstantPool {
[0] = ArgDesc num-args 1, num-type-args 0, names []
[1] = ICData target-name 'call', arg-desc CP#0
[2] = Bool true
[3] = Int 328
[4] = Int 339
[5] = ICData target-name 'call', arg-desc CP#0
[6] = ArgDesc num-args 3, num-type-args 0, names []
[7] = StaticICData target 'dart.core::_AssertionError::_throwNew', arg-desc CP#6
[8] = Null
}
]static method test2(() → core::bool condition, () → core::String message) → void {
assert(condition.call(), message.call());
}
[@vm.bytecode=
Bytecode {
Entry 0
CheckStack
PushConstant CP#0
ReturnTOS
}
ConstantPool {
[0] = Null
}
]static method main() → dynamic {}