|
|
|
|
|
by spankalee
4218 days ago
|
|
This is a very misguided comment. Dart and JavaScript are both completely dynamically typed. The Dart VM and V8 both use inline caches to remember what types are flowing to what call sites. Both optimize monomorphic call sites the best and megamorphic call sites the worst. I know of no "blacklist" in the Dart VM. |
|
V8 VM optimized for that (type dynamics).
Dart VM has a lot problem with performance with this dynamics because Dart VM is a truly object-oriented VM and each value has its own type (including a user defined types and a lot types in the Dart SDK, also internal witt hidden implementation, and all their members).
About "blacklists" and "whitelists".
===================================
Method recognizer and [while/black]list
VM: Improve performance of method recognizer and unify the it with the intrinsifier.
https://codereview.chromium.org/468793004/
===================================
https://github.com/dart-lang/bleeding_edge/blob/master/dart/...
INLINE_WHITE_LIST(SET_IS_ALWAYS_INLINE);
INLINE_BLACK_LIST(SET_IS_NEVER_INLINE);
SET_IS_ALWAYS_INLINE(class_name, function_name, dest, fp)
SET_IS_NEVER_INLINE(class_name, function_name, dest, fp)
===================================
https://github.com/dart-lang/bleeding_edge/blob/master/dart/...
===================================
A lot of (problematic) method in these list. Dart VM code generators and optimizers is unable to optimize usage of them by the Dart VM intelligence.
Hundreds of methods in these lists.
OTHER_RECOGNIZED_LIST(V) over 100 methods
CORE_LIB_INTRINSIC_LIST(V) over 50 methods
CORE_INTEGER_LIB_INTRINSIC_LIST(V) over 30 methods
MATH_LIB_INTRINSIC_LIST(V) 2 methods
TYPED_DATA_LIB_INTRINSIC_LIST(V) over 30 methods
GRAPH_TYPED_DATA_INTRINSICS_LIST(V) 9 methods
GRAPH_CORE_INTRINSICS_LIST(V) 10 methods
INLINE_WHITE_LIST(V) over 60 methods
INLINE_BLACK_LIST(V) 8 methods
POLYMORPHIC_TARGET_LIST(V) about 20 methods
Most of them cannot be optimized due the wrong architecture (which states that the type system is unsound).
Most of them cannot be optimized due the other problems in architecture.
P.S.
All mentions about them are hardcoded (added in special lists by humans) because VM has a problems with performance because it cannot optimize code in some cases due the fact that the normal running mode in Dart VM is an (unchecked) production mode.
Normal mode when (types system unsound) means that Dart VM cannot to guarantee that it has possibility correctly recognize a members (of internally implemented types) that are critical for performance.