17d7296a42
Type arguments should not be reused if type parameter has a nullability other than non-nullable or undertermined, as instantiating such type parameter may alter the type. Also, this change adds printing of nullability when dumping bytecode and updates expectations accordingly. Fixes language/nnbd/is_type_test/null_is_type_in_legacy_lib_test in bytecode mode. Change-Id: I4378a4e42fa0bf014840b9b1ef09a633c1825e20 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155560 Reviewed-by: Régis Crelier <regis@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
97 lines
2.3 KiB
Plaintext
97 lines
2.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 'test1', static, reflectable, debuggable
|
|
parameters [dart:core::bool* 'condition'] (required: 1)
|
|
return-type void
|
|
|
|
Bytecode {
|
|
Entry 0
|
|
CheckStack 0
|
|
JumpIfNoAsserts L1
|
|
Push FP[-5]
|
|
AssertBoolean 0
|
|
JumpIfTrue L1
|
|
PushInt 0
|
|
PushInt 0
|
|
PushNull
|
|
DirectCall CP#0, 3
|
|
Drop1
|
|
L1:
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = DirectCall 'dart:core::_AssertionError::_throwNew', ArgDesc num-args 3, num-type-args 0, names []
|
|
[1] = Reserved
|
|
}
|
|
|
|
|
|
Function 'test2', static, reflectable, debuggable
|
|
parameters [FunctionType ()* -> dart:core::bool* 'condition', FunctionType ()* -> dart:core::String* 'message'] (required: 2)
|
|
return-type void
|
|
|
|
Bytecode {
|
|
Entry 1
|
|
CheckStack 0
|
|
JumpIfNoAsserts L1
|
|
Push FP[-6]
|
|
StoreLocal r0
|
|
Push r0
|
|
UncheckedClosureCall CP#0, 1
|
|
AssertBoolean 0
|
|
JumpIfTrue L1
|
|
PushInt 0
|
|
PushInt 0
|
|
Push FP[-5]
|
|
StoreLocal r0
|
|
Push r0
|
|
UncheckedClosureCall CP#0, 1
|
|
DirectCall CP#1, 3
|
|
Drop1
|
|
L1:
|
|
PushNull
|
|
ReturnTOS
|
|
}
|
|
ConstantPool {
|
|
[0] = ObjectRef ArgDesc num-args 1, num-type-args 0, names []
|
|
[1] = DirectCall 'dart:core::_AssertionError::_throwNew', ArgDesc num-args 3, num-type-args 0, names []
|
|
[2] = 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 test1(dart.core::bool* condition) → void {
|
|
assert(condition);
|
|
}
|
|
static method test2(() →* dart.core::bool* condition, () →* dart.core::String* message) → void {
|
|
assert([@vm.call-site-attributes.metadata=receiverType:dart.core::bool* Function()*] condition.call(), [@vm.call-site-attributes.metadata=receiverType:dart.core::String* Function()*] message.call());
|
|
}
|
|
static method main() → dynamic {}
|
|
}
|