Files
sdk/pkg/vm/testcases/bytecode/field_initializers.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

266 lines
6.8 KiB
Plaintext

main = #lib::main;
[@vm.bytecode=
BytecodeMetadata {
Bytecode (version: stable)
Main library: #lib
Library '#lib'
name '#lib'
script '#lib'
Class '', script = '#lib'
Function 'main', static, reflectable, debuggable
parameters [] (required: 0)
return-type dynamic
Bytecode {
Entry 0
CheckStack 0
PushNull
ReturnTOS
}
ConstantPool {
}
Class 'A', script = '#lib'
extends dart:core::Object
Field 'foo1', type = dart:core::int, getter = 'get:foo1', setter = 'set:foo1', reflectable
value = null
Field 'foo2', type = dart:core::int, getter = 'get:foo2', setter = 'set:foo2', reflectable
value = null
Field 'foo3', type = dart:core::int, getter = 'get:foo3', setter = 'set:foo3', reflectable
value = const 42
Field 'foo4', type = dart:core::int, getter = 'get:foo4', setter = 'set:foo4', reflectable
value = null
Field 'foo5', type = dart:core::int, getter = 'get:foo5', setter = 'set:foo5', reflectable
value = const 43
Function '', constructor, reflectable, debuggable
parameters [dart:core::int 'foo4'] (required: 1)
return-type #lib::A
Bytecode {
Entry 0
CheckStack 0
Push FP[-6]
PushInt 42
StoreFieldTOS CP#0
Push FP[-6]
PushInt 43
StoreFieldTOS CP#2
Push FP[-6]
Push FP[-5]
StoreFieldTOS CP#4
Push FP[-6]
PushInt 44
StoreFieldTOS CP#2
Push FP[-6]
DirectCall CP#6, 1
Drop1
PushNull
ReturnTOS
}
Nullable fields: [#lib::A::foo1 (field), #lib::A::foo2 (field)]
ConstantPool {
[0] = InstanceField #lib::A::foo3 (field)
[1] = Reserved
[2] = InstanceField #lib::A::foo5 (field)
[3] = Reserved
[4] = InstanceField #lib::A::foo4 (field)
[5] = Reserved
[6] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[7] = Reserved
}
Function 'constr2', constructor, reflectable, debuggable
parameters [dart:core::int 'x', dart:core::int 'y'] (required: 2)
return-type #lib::A
Bytecode {
Entry 0
CheckStack 0
Push FP[-7]
PushInt 42
StoreFieldTOS CP#0
Push FP[-7]
PushInt 43
StoreFieldTOS CP#2
Push FP[-7]
Push FP[-6]
StoreFieldTOS CP#4
Push FP[-7]
Push FP[-5]
PushInt 1
AddInt
StoreFieldTOS CP#2
Push FP[-7]
DirectCall CP#6, 1
Drop1
PushNull
ReturnTOS
}
Nullable fields: [#lib::A::foo2 (field), #lib::A::foo4 (field)]
ConstantPool {
[0] = InstanceField #lib::A::foo3 (field)
[1] = Reserved
[2] = InstanceField #lib::A::foo5 (field)
[3] = Reserved
[4] = InstanceField #lib::A::foo1 (field)
[5] = Reserved
[6] = DirectCall 'dart:core::Object:: (constructor)', ArgDesc num-args 1, num-type-args 0, names []
[7] = Reserved
}
Function 'redirecting1', constructor, reflectable, debuggable
parameters [] (required: 0)
return-type #lib::A
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
PushInt 45
DirectCall CP#0, 2
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall '#lib::A:: (constructor)', ArgDesc num-args 2, num-type-args 0, names []
[1] = Reserved
}
Function 'redirecting2', constructor, reflectable, debuggable
parameters [dart:core::int 'a', dart:core::int 'b', dart:core::int 'c'] (required: 3)
return-type #lib::A
Bytecode {
Entry 0
CheckStack 0
Push FP[-8]
Push FP[-7]
Push FP[-6]
Push FP[-5]
MulInt
DirectCall CP#0, 3
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = DirectCall '#lib::A::constr2 (constructor)', ArgDesc num-args 3, num-type-args 0, names []
[1] = Reserved
}
Class 'B', script = '#lib'
extends #lib::A
Field 'foo6', type = dart:core::int, getter = 'get:foo6', setter = 'set:foo6', reflectable
value = const 46
Field 'foo7', type = dart:core::int, reflectable, static
value = const 47
Field 'foo8', type = dart:core::int, reflectable, static, const, final
value = const 48
Function '', constructor, reflectable, debuggable
parameters [] (required: 0)
return-type #lib::B
Bytecode {
Entry 0
CheckStack 0
Push FP[-5]
PushInt 46
StoreFieldTOS CP#0
Push FP[-5]
PushInt 49
DirectCall CP#2, 2
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = InstanceField #lib::B::foo6 (field)
[1] = Reserved
[2] = DirectCall '#lib::A:: (constructor)', ArgDesc num-args 2, num-type-args 0, names []
[3] = Reserved
}
Function 'c2', constructor, reflectable, debuggable
parameters [dart:core::int 'i', dart:core::int 'j'] (required: 2)
return-type #lib::B
Bytecode {
Entry 0
CheckStack 0
Push FP[-7]
PushInt 46
StoreFieldTOS CP#0
Push FP[-7]
PushInt 50
StoreFieldTOS CP#0
Push FP[-7]
Push FP[-6]
Push FP[-5]
PushInt 51
DirectCall CP#2, 4
Drop1
PushNull
ReturnTOS
}
ConstantPool {
[0] = InstanceField #lib::B::foo6 (field)
[1] = Reserved
[2] = DirectCall '#lib::A::redirecting2 (constructor)', ArgDesc num-args 4, num-type-args 0, names []
[3] = Reserved
}
}
]library #lib from "#lib" as #lib {
class A extends dart.core::Object {
field dart.core::int foo1;
field dart.core::int foo2 = null;
field dart.core::int foo3 = 42;
field dart.core::int foo4;
field dart.core::int foo5 = 43;
constructor •(dart.core::int foo4) → #lib::A
: #lib::A::foo1 = null, #lib::A::foo4 = foo4, #lib::A::foo5 = 44, super dart.core::Object::•()
;
constructor constr2(dart.core::int x, dart.core::int y) → #lib::A
: #lib::A::foo4 = null, #lib::A::foo1 = x, #lib::A::foo5 = y.{dart.core::num::+}(1), super dart.core::Object::•()
;
constructor redirecting1() → #lib::A
: this #lib::A::•(45)
;
constructor redirecting2(dart.core::int a, dart.core::int b, dart.core::int c) → #lib::A
: this #lib::A::constr2(a, b.{dart.core::num::*}(c))
;
}
class B extends #lib::A {
field dart.core::int foo6 = 46;
static field dart.core::int foo7 = 47;
static const field dart.core::int foo8 = 48;
constructor •() → #lib::B
: super #lib::A::•(49)
;
constructor c2(dart.core::int i, dart.core::int j) → #lib::B
: #lib::B::foo6 = 50, super #lib::A::redirecting2(i, j, 51)
;
}
static method main() → dynamic {}
}