Files
sdk/pkg/vm/testcases/bytecode/switch.dart.expect
T
Alexander Markov da8cb470cc [vm/bytecode] Represent classes, libraries, scripts and recursive types in bytecode
Size of a large application:
Before: 26628600
After: 21480120 (-19.3%)

Size of snapshots:

isolate_snapshot_framework.bin
Before: 9322496
After: 6782976 (-27.2%)

isolate_snapshot_product_framework.bin
Before: 9166848
After: 6602752 (-27.9%)

Regressions in tests:

1) Test language_2/type_alias_equality_test/04 fails similarly to default mode, as VM
does not implement comparison of function types according to the specification.
Previously this test was passing as function types were canonicalized in bytecode,
which was not always correct. This CL fixes the problem with canonicalization of
function types in bytecode and the test starts failing again.

2) Tests standalone_2/entrypoints_verification_test, standalone_2/io/test_extension_test,
standalone_2/io/test_extension_fail_test fail as native extensions are not supported
in bytecode yet. These tests start passing after df5e7aac17,
which switched bytecode tests to kernel service (on x64), because kernel service doesn't
drop ASTs. This CL switches from reading AST library declarations to bytecode even if
AST is not removed, so tests fail again.

Change-Id: I8b7ba44bfa49d0b1599b2509553ff7c831a4e244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104700
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-20 18:27:21 +00:00

272 lines
5.3 KiB
Plaintext

main = #lib::main;
[@vm.bytecode=
BytecodeMetadata {
Bytecode (version: stable)
Main library: #lib
Library '#lib'
name '#lib'
script '#lib'
Class '', script = '#lib'
Function 'foo1', static, reflectable, debuggable
parameters [dart:core::int 'x'] (required: 1)
return-type dart:core::int
Bytecode {
Entry 2
CheckStack 0
PushNull
PopLocal r0
Push FP[-5]
PopLocal r1
Push r1
PushInt 1
InterfaceCall CP#0, 2
JumpIfTrue L1
Push r1
PushInt 2
InterfaceCall CP#0, 2
JumpIfTrue L2
Push r1
PushInt 3
InterfaceCall CP#0, 2
JumpIfTrue L3
Jump L4
L1:
PushInt 11
PopLocal r0
Jump L4
L2:
PushInt 22
PopLocal r0
Jump L4
L3:
PushInt 33
PopLocal r0
Jump L4
L4:
Push r0
ReturnTOS
}
ConstantPool {
[0] = InterfaceCall 'dart:core::Object::==', ArgDesc num-args 2, num-type-args 0, names []
[1] = Reserved
}
Function 'foo2', static, reflectable, debuggable
parameters [dart:core::int 'x'] (required: 1)
return-type dart:core::int
Bytecode {
Entry 2
CheckStack 0
PushNull
PopLocal r0
Push FP[-5]
PopLocal r1
Push r1
PushInt 1
InterfaceCall CP#0, 2
JumpIfTrue L1
Push r1
PushInt 2
InterfaceCall CP#0, 2
JumpIfTrue L1
Push r1
PushInt 3
InterfaceCall CP#0, 2
JumpIfTrue L1
Push r1
PushInt 4
InterfaceCall CP#0, 2
JumpIfTrue L2
Push r1
PushInt 5
InterfaceCall CP#0, 2
JumpIfTrue L2
Push r1
PushInt 6
InterfaceCall CP#0, 2
JumpIfTrue L2
Jump L3
L1:
PushInt 11
PopLocal r0
Jump L4
L2:
PushInt 22
PopLocal r0
Jump L4
L3:
PushInt 33
PopLocal r0
L4:
Push r0
ReturnTOS
}
ConstantPool {
[0] = InterfaceCall 'dart:core::Object::==', ArgDesc num-args 2, num-type-args 0, names []
[1] = Reserved
}
Function 'foo3', static, reflectable, debuggable
parameters [dart:core::int 'x'] (required: 1)
return-type dart:core::int
Bytecode {
Entry 2
CheckStack 0
PushNull
PopLocal r0
Push FP[-5]
PopLocal r1
Push r1
PushInt 1
InterfaceCall CP#0, 2
JumpIfTrue L1
Push r1
PushInt 2
InterfaceCall CP#0, 2
JumpIfTrue L1
Push r1
PushInt 3
InterfaceCall CP#0, 2
JumpIfTrue L1
Push r1
PushInt 4
InterfaceCall CP#0, 2
JumpIfTrue L2
Push r1
PushInt 5
InterfaceCall CP#0, 2
JumpIfTrue L2
Push r1
PushInt 6
InterfaceCall CP#0, 2
JumpIfTrue L2
Jump L3
L1:
PushInt 11
PopLocal r0
Jump L2
L2:
PushInt 22
PopLocal r0
PushInt 42
ReturnTOS
L3:
PushInt 33
PopLocal r0
Push r0
ReturnTOS
}
ConstantPool {
[0] = InterfaceCall 'dart:core::Object::==', ArgDesc num-args 2, num-type-args 0, names []
[1] = Reserved
}
Function 'main', static, reflectable, debuggable
parameters [] (required: 0)
return-type dynamic
Bytecode {
Entry 0
CheckStack 0
PushNull
ReturnTOS
}
ConstantPool {
}
}
]library #lib from "#lib" as #lib {
static method foo1(dart.core::int x) → dart.core::int {
dart.core::int y;
#L1:
switch(x) {
#L2:
case 1:
{
y = 11;
break #L1;
}
#L3:
case 2:
{
y = 22;
break #L1;
}
#L4:
case 3:
{
y = 33;
break #L1;
}
}
return y;
}
static method foo2(dart.core::int x) → dart.core::int {
dart.core::int y;
#L5:
switch(x) {
#L6:
case 1:
case 2:
case 3:
{
y = 11;
break #L5;
}
#L7:
case 4:
case 5:
case 6:
{
y = 22;
break #L5;
}
#L8:
default:
{
y = 33;
}
}
return y;
}
static method foo3(dart.core::int x) → dart.core::int {
dart.core::int y;
switch(x) {
#L9:
case 1:
case 2:
case 3:
{
y = 11;
continue #L10;
}
#L10:
case 4:
case 5:
case 6:
{
y = 22;
return 42;
}
#L11:
default:
{
y = 33;
}
}
return y;
}
static method main() → dynamic {}
}