dart-sdk/runtime/vm/bootstrap_natives.h

504 lines
38 KiB
C
Raw Normal View History

// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef RUNTIME_VM_BOOTSTRAP_NATIVES_H_
#define RUNTIME_VM_BOOTSTRAP_NATIVES_H_
#include "vm/native_entry.h"
// bootstrap dart natives used in the core dart library.
namespace dart {
// List of bootstrap native entry points used in the core dart library.
Reland "Scaffolding for dart:wasm" This reverts commit 9198813a553c6ce230c8c545d33fbad14ffef340. Reason for revert: Relanding with a fix Original change's description: > Revert "Scaffolding for dart:wasm" > > This reverts commit f39a3f188e3bd259d4d7e41c48516e507c1303f1. > > Reason for revert: https://golem.corp.goog/BuildInfo?target=flutter-profile&machine-type=android-armv7&revision=84750 > > Original change's description: > > Scaffolding for dart:wasm > > > > This CL doesn't have any tests because it's just boilerplate. I'll > > add a test in the follow up CLs where I add actual functionality. > > > > Bug: https://github.com/dart-lang/sdk/issues/37882 > > Change-Id: I47c81f5f1be724f8226e756ba5d01880a45f1ac7 > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112841 > > Reviewed-by: Siva Annamalai <asiva@google.com> > > Reviewed-by: Liam Appelbe <liama@google.com> > > Commit-Queue: Liam Appelbe <liama@google.com> > > TBR=asiva@google.com,liama@google.com > > Change-Id: I0fd0f29d66a07fc29e840ddaec2d4161c8d599cb > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: https://github.com/dart-lang/sdk/issues/37882 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114044 > Reviewed-by: Liam Appelbe <liama@google.com> > Commit-Queue: Liam Appelbe <liama@google.com> TBR=asiva@google.com,liama@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: https://github.com/dart-lang/sdk/issues/37882 Change-Id: Idb43cbd3a0521776ac420bfef91c8a9a4362f18e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114757 Reviewed-by: Liam Appelbe <liama@google.com> Commit-Queue: Liam Appelbe <liama@google.com>
2019-08-28 23:11:21 +00:00
// V(function_name, argument_count)
#define BOOTSTRAP_NATIVE_LIST(V) \
V(AsyncStarMoveNext_debuggerStepCheck, 1) \
V(DartAsync_fatal, 1) \
V(Object_equals, 2) \
V(Object_getHash, 1) \
V(Object_setHash, 2) \
V(Object_toString, 1) \
V(Object_runtimeType, 1) \
V(Object_haveSameRuntimeType, 2) \
V(Object_instanceOf, 4) \
V(Object_simpleInstanceOf, 2) \
V(Function_apply, 2) \
V(Closure_equals, 2) \
Reapply "Improve hashCode for closure objects" with fixes. This CL includes the following fixes: * Fix for incorrect non-nullable assumption about _Closure._hash field. * Add error handling into BecomeMapTraits::Hash. * Correct assertions for validating layout of Closure objects. * Add identityHashCode to the list of VM entry points in precompiler. Closes #30211. Original code review: https://codereview.chromium.org/2983823002/ Original CL description: This performance improvement is inspired by Flutter listeners stored in the HashSet (see ObserverList) and frequently checked using HashSet.contains(). If there are many such listeners and they are implicit instance closures (for example, created by 'new Listenable.merge(...)'), HashSet.contains() becomes very slow. It spends a lot of time in Closure_equals native method due to hash collisions between closure objects with same function but different receivers. This CL improves hashCode() calculation for implicit instance closures by mixing function hashcode with identity hashcode of the receiver. For explicit closures and static implicit closures hashCode() is improved by using identityHashCode() of a closure object. Also, hashcode is calculated once and cached in each closure instance. The size of a closure instance doesn't grow up because there was unused word-size padding both on 32-bit and 64-bit architectures. The execution time of the following micro-benchmark is reduced from 47665ms to 135ms on my Linux/x64 box. ------------------------------------- import "dart:collection"; class Foo { int _a; Foo(this._a); void bar() {} } main() { HashSet hs = new HashSet(); for (int i = 0; i < 1000; ++i) { hs.add(new Foo(i).bar); } var watch = new Stopwatch()..start(); for (int i = 0; i < 1000; ++i) { for (var c in hs) { hs.contains(c); } } int time = watch.elapsedMilliseconds; print("Time: ${time}ms\n"); } ------------------------------------- R=zra@google.com Review-Url: https://codereview.chromium.org/2988493002 .
2017-07-20 22:22:15 +00:00
V(Closure_computeHash, 1) \
V(Closure_clone, 1) \
V(AbstractType_toString, 1) \
V(Type_getHashCode, 1) \
V(Type_equality, 2) \
V(Identical_comparison, 2) \
V(Integer_bitAndFromInteger, 2) \
V(Integer_bitOrFromInteger, 2) \
V(Integer_bitXorFromInteger, 2) \
V(Integer_addFromInteger, 2) \
V(Integer_subFromInteger, 2) \
V(Integer_mulFromInteger, 2) \
V(Integer_truncDivFromInteger, 2) \
V(Integer_moduloFromInteger, 2) \
V(Integer_greaterThanFromInteger, 2) \
V(Integer_equalToInteger, 2) \
V(Integer_fromEnvironment, 3) \
V(Integer_parse, 1) \
V(Integer_shlFromInteger, 2) \
V(Integer_shrFromInteger, 2) \
V(Bool_fromEnvironment, 3) \
V(Bool_hasEnvironment, 2) \
V(CapabilityImpl_factory, 1) \
V(CapabilityImpl_equals, 2) \
V(CapabilityImpl_get_hashcode, 1) \
V(RawReceivePortImpl_factory, 1) \
V(RawReceivePortImpl_get_id, 1) \
V(RawReceivePortImpl_get_sendport, 1) \
V(RawReceivePortImpl_closeInternal, 1) \
V(SendPortImpl_get_id, 1) \
V(SendPortImpl_get_hashcode, 1) \
V(SendPortImpl_sendInternal_, 2) \
[vm/isolates] Introduce sendAndExit. sendAndExit allows for fast data passing from worker isolate back to parent. ``` | linux x64 | spawnIsolate | sendAndExit | |us per iter | over sync | over send | +------------+--------------+-------------+ IsolateJson.Decode50KBx1(RunTime): 43,175.000 339.83% IsolateJson.SendAndExit_Decode50KBx1(RunTime): 22,070.000 124.83% -48.88% IsolateJson.SyncDecode50KBx1(RunTime): 9,816.284 IsolateJson.Decode50KBx4(RunTime): 77,630.000 104.56% IsolateJson.SendAndExit_Decode50KBx4(RunTime): 46,307.000 22.02% -40.35% IsolateJson.SyncDecode50KBx4(RunTime): 37,949.528 IsolateJson.Decode100KBx1(RunTime): 71,035.000 270.42% IsolateJson.SendAndExit_Decode100KBx1(RunTime): 43,056.000 124.52% -39.39% IsolateJson.SyncDecode100KBx1(RunTime): 19,176.733 IsolateJson.Decode100KBx4(RunTime): 120,915.000 54.66% IsolateJson.SendAndExit_Decode100KBx4(RunTime): 67,101.000 -14.17% -44.51% IsolateJson.SyncDecode100KBx4(RunTime): 78,179.731 IsolateJson.Decode250KBx1(RunTime): 173,574.000 202.52% IsolateJson.SendAndExit_Decode250KBx1(RunTime): 103,334.000 80.10% -40.47% IsolateJson.SyncDecode250KBx1(RunTime): 57,375.314 IsolateJson.Decode250KBx4(RunTime): 292,118.000 20.30% IsolateJson.SendAndExit_Decode250KBx4(RunTime): 168,444.000 -30.63% -42.34% IsolateJson.SyncDecode250KBx4(RunTime): 242,831.000 IsolateJson.Decode1MBx1(RunTime): 631,578.000 166.34% IsolateJson.SendAndExit_Decode1MBx1(RunTime): 371,127.000 56.50% -41.24% IsolateJson.SyncDecode1MBx1(RunTime): 237,135.778 IsolateJson.Decode1MBx4(RunTime): 1,322,789.000 36.16% IsolateJson.SendAndExit_Decode1MBx4(RunTime): 657,179.000 -32.35% -50.32% IsolateJson.SyncDecode1MBx4(RunTime): 971,473.333 ``` Bug: https://github.com/dart-lang/sdk/issues/37835 Bug: https://github.com/dart-lang/sdk/issues/36097 Change-Id: I386641e1431ed9f2e34fac36f562607a666ee4a8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142823 Commit-Queue: Alexander Aprelev <aam@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-04-22 17:34:09 +00:00
V(SendPortImpl_sendAndExitInternal_, 2) \
V(Smi_bitAndFromSmi, 2) \
V(Smi_bitNegate, 1) \
V(Smi_bitLength, 1) \
V(Mint_bitNegate, 1) \
V(Mint_bitLength, 1) \
V(Developer_debugger, 2) \
V(Developer_getIsolateIDFromSendPort, 1) \
V(Developer_getServerInfo, 1) \
V(Developer_getServiceMajorVersion, 0) \
V(Developer_getServiceMinorVersion, 0) \
V(Developer_inspect, 1) \
V(Developer_lookupExtension, 1) \
V(Developer_registerExtension, 2) \
V(Developer_log, 8) \
V(Developer_postEvent, 2) \
V(Developer_webServerControl, 2) \
V(Double_hashCode, 1) \
V(Double_getIsNegative, 1) \
V(Double_getIsInfinite, 1) \
V(Double_getIsNaN, 1) \
V(Double_add, 2) \
V(Double_sub, 2) \
V(Double_mul, 2) \
V(Double_div, 2) \
V(Double_trunc_div, 2) \
V(Double_remainder, 2) \
V(Double_modulo, 2) \
V(Double_greaterThanFromInteger, 2) \
V(Double_equalToInteger, 2) \
V(Double_greaterThan, 2) \
V(Double_equal, 2) \
V(Double_doubleFromInteger, 2) \
V(Double_round, 1) \
V(Double_floor, 1) \
V(Double_ceil, 1) \
V(Double_truncate, 1) \
V(Double_toInt, 1) \
V(Double_parse, 3) \
V(Double_toString, 1) \
V(Double_toStringAsFixed, 2) \
V(Double_toStringAsExponential, 2) \
V(Double_toStringAsPrecision, 2) \
V(Double_flipSignBit, 1) \
Reland "[vm] Finish adding support for ECMAScript 2018 features." This work pulls in v8 support for these features with appropriate changes for Dart and closes https://github.com/dart-lang/sdk/issues/34935. This adds support for the following features: * Interpreting patterns as Unicode patterns instead of BMP patterns * the dotAll flag (`/s`) for changing the behavior of '.' to also match line terminators * Escapes for character classes described by Unicode property groups (e.g., \p{Greek} to match all Greek characters, or \P{Greek} for all non-Greek characters). The following TC39 proposals describe some of the added features: * https://github.com/tc39/proposal-regexp-dotall-flag * https://github.com/tc39/proposal-regexp-unicode-property-escapes These additional changes are included: * Extends named capture group names to include the full range of identifier characters supported by ECMAScript, not just ASCII. * Changing the RegExp interface to return RegExpMatch objects, not Match objects, so that downcasting is not necessary to use named capture groups from Dart **Note**: The changes to the RegExp interface are a breaking change for implementers of the RegExp interface. Current users of the RegExp interface (i.e., code using Dart RegExp objects) will not be affected. Change-Id: Ie62e6082a0e2fedc1680ef2576ce0c6db80fc19a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100641 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Stevie Strickland <sstrickl@google.com>
2019-04-29 09:11:48 +00:00
V(RegExp_factory, 6) \
V(RegExp_getPattern, 1) \
V(RegExp_getIsMultiLine, 1) \
V(RegExp_getIsCaseSensitive, 1) \
Reland "[vm] Finish adding support for ECMAScript 2018 features." This work pulls in v8 support for these features with appropriate changes for Dart and closes https://github.com/dart-lang/sdk/issues/34935. This adds support for the following features: * Interpreting patterns as Unicode patterns instead of BMP patterns * the dotAll flag (`/s`) for changing the behavior of '.' to also match line terminators * Escapes for character classes described by Unicode property groups (e.g., \p{Greek} to match all Greek characters, or \P{Greek} for all non-Greek characters). The following TC39 proposals describe some of the added features: * https://github.com/tc39/proposal-regexp-dotall-flag * https://github.com/tc39/proposal-regexp-unicode-property-escapes These additional changes are included: * Extends named capture group names to include the full range of identifier characters supported by ECMAScript, not just ASCII. * Changing the RegExp interface to return RegExpMatch objects, not Match objects, so that downcasting is not necessary to use named capture groups from Dart **Note**: The changes to the RegExp interface are a breaking change for implementers of the RegExp interface. Current users of the RegExp interface (i.e., code using Dart RegExp objects) will not be affected. Change-Id: Ie62e6082a0e2fedc1680ef2576ce0c6db80fc19a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100641 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Stevie Strickland <sstrickl@google.com>
2019-04-29 09:11:48 +00:00
V(RegExp_getIsUnicode, 1) \
V(RegExp_getIsDotAll, 1) \
V(RegExp_getGroupCount, 1) \
V(RegExp_getGroupNameMap, 1) \
V(RegExp_ExecuteMatch, 3) \
V(RegExp_ExecuteMatchSticky, 3) \
V(List_new, 2) \
V(List_allocate, 2) \
V(List_getIndexed, 2) \
V(List_setIndexed, 3) \
V(List_getLength, 1) \
V(List_slice, 4) \
V(ImmutableList_from, 4) \
V(StringBase_createFromCodePoints, 3) \
V(StringBase_substringUnchecked, 3) \
V(StringBase_joinReplaceAllResult, 4) \
V(StringBuffer_createStringFromUint16Array, 3) \
V(OneByteString_substringUnchecked, 3) \
V(OneByteString_splitWithCharCode, 2) \
V(OneByteString_allocate, 1) \
V(OneByteString_allocateFromOneByteList, 3) \
V(OneByteString_setAt, 3) \
V(TwoByteString_allocateFromTwoByteList, 3) \
V(String_getHashCode, 1) \
V(String_getLength, 1) \
V(String_charAt, 2) \
V(String_codeUnitAt, 2) \
V(String_concat, 2) \
V(String_fromEnvironment, 3) \
V(String_toLowerCase, 1) \
V(String_toUpperCase, 1) \
V(String_concatRange, 3) \
V(Math_sqrt, 1) \
V(Math_sin, 1) \
V(Math_cos, 1) \
V(Math_tan, 1) \
V(Math_asin, 1) \
V(Math_acos, 1) \
V(Math_atan, 1) \
V(Math_atan2, 2) \
V(Math_exp, 1) \
V(Math_log, 1) \
V(Math_doublePow, 2) \
V(Random_nextState, 1) \
V(Random_setupSeed, 1) \
V(Random_initialSeed, 0) \
V(SecureRandom_getBytes, 1) \
V(DateTime_currentTimeMicros, 0) \
V(DateTime_timeZoneName, 1) \
V(DateTime_timeZoneOffsetInSeconds, 1) \
V(DateTime_localTimeZoneAdjustmentInSeconds, 0) \
V(AssertionError_throwNew, 3) \
V(Async_rethrow, 2) \
V(StackTrace_asyncStackTraceHelper, 1) \
V(StackTrace_clearAsyncThreadStackTrace, 0) \
V(StackTrace_setAsyncThreadStackTrace, 1) \
V(StackTrace_current, 0) \
V(TypeError_throwNew, 4) \
V(FallThroughError_throwNew, 1) \
V(AbstractClassInstantiationError_throwNew, 2) \
V(Stopwatch_now, 0) \
V(Stopwatch_frequency, 0) \
V(Timeline_getNextAsyncId, 0) \
V(Timeline_getTraceClock, 0) \
V(Timeline_isDartStreamEnabled, 0) \
V(Timeline_reportFlowEvent, 5) \
V(Timeline_reportInstantEvent, 3) \
V(Timeline_reportTaskEvent, 5) \
V(TypedData_Int8Array_new, 2) \
V(TypedData_Uint8Array_new, 2) \
V(TypedData_Uint8ClampedArray_new, 2) \
V(TypedData_Int16Array_new, 2) \
V(TypedData_Uint16Array_new, 2) \
V(TypedData_Int32Array_new, 2) \
V(TypedData_Uint32Array_new, 2) \
V(TypedData_Int64Array_new, 2) \
V(TypedData_Uint64Array_new, 2) \
V(TypedData_Float32Array_new, 2) \
V(TypedData_Float64Array_new, 2) \
V(TypedData_Float32x4Array_new, 2) \
V(TypedData_Int32x4Array_new, 2) \
V(TypedData_Float64x2Array_new, 2) \
V(TypedData_length, 1) \
V(TypedData_setRange, 7) \
V(TypedData_GetInt8, 2) \
V(TypedData_SetInt8, 3) \
V(TypedData_GetUint8, 2) \
V(TypedData_SetUint8, 3) \
V(TypedData_GetInt16, 2) \
V(TypedData_SetInt16, 3) \
V(TypedData_GetUint16, 2) \
V(TypedData_SetUint16, 3) \
V(TypedData_GetInt32, 2) \
V(TypedData_SetInt32, 3) \
V(TypedData_GetUint32, 2) \
V(TypedData_SetUint32, 3) \
V(TypedData_GetInt64, 2) \
V(TypedData_SetInt64, 3) \
V(TypedData_GetUint64, 2) \
V(TypedData_SetUint64, 3) \
V(TypedData_GetFloat32, 2) \
V(TypedData_SetFloat32, 3) \
V(TypedData_GetFloat64, 2) \
V(TypedData_SetFloat64, 3) \
V(TypedData_GetFloat32x4, 2) \
V(TypedData_SetFloat32x4, 3) \
V(TypedData_GetInt32x4, 2) \
V(TypedData_SetInt32x4, 3) \
V(TypedData_GetFloat64x2, 2) \
V(TypedData_SetFloat64x2, 3) \
V(TypedDataView_ByteDataView_new, 4) \
V(TypedDataView_Int8ArrayView_new, 4) \
V(TypedDataView_Uint8ArrayView_new, 4) \
V(TypedDataView_Uint8ClampedArrayView_new, 4) \
V(TypedDataView_Int16ArrayView_new, 4) \
V(TypedDataView_Uint16ArrayView_new, 4) \
V(TypedDataView_Int32ArrayView_new, 4) \
V(TypedDataView_Uint32ArrayView_new, 4) \
V(TypedDataView_Int64ArrayView_new, 4) \
V(TypedDataView_Uint64ArrayView_new, 4) \
V(TypedDataView_Float32ArrayView_new, 4) \
V(TypedDataView_Float64ArrayView_new, 4) \
V(TypedDataView_Float32x4ArrayView_new, 4) \
V(TypedDataView_Int32x4ArrayView_new, 4) \
V(TypedDataView_Float64x2ArrayView_new, 4) \
V(TypedDataView_length, 1) \
V(TypedDataView_offsetInBytes, 1) \
V(TypedDataView_typedData, 1) \
V(Float32x4_fromDoubles, 4) \
V(Float32x4_splat, 1) \
V(Float32x4_fromInt32x4Bits, 2) \
V(Float32x4_fromFloat64x2, 2) \
V(Float32x4_zero, 1) \
V(Float32x4_add, 2) \
V(Float32x4_negate, 1) \
V(Float32x4_sub, 2) \
V(Float32x4_mul, 2) \
V(Float32x4_div, 2) \
V(Float32x4_cmplt, 2) \
V(Float32x4_cmplte, 2) \
V(Float32x4_cmpgt, 2) \
V(Float32x4_cmpgte, 2) \
V(Float32x4_cmpequal, 2) \
V(Float32x4_cmpnequal, 2) \
V(Float32x4_scale, 2) \
V(Float32x4_abs, 1) \
V(Float32x4_clamp, 3) \
V(Float32x4_getX, 1) \
V(Float32x4_getY, 1) \
V(Float32x4_getZ, 1) \
V(Float32x4_getW, 1) \
V(Float32x4_getSignMask, 1) \
V(Float32x4_shuffle, 2) \
V(Float32x4_shuffleMix, 3) \
V(Float32x4_setX, 2) \
V(Float32x4_setY, 2) \
V(Float32x4_setZ, 2) \
V(Float32x4_setW, 2) \
V(Float32x4_min, 2) \
V(Float32x4_max, 2) \
V(Float32x4_sqrt, 1) \
V(Float32x4_reciprocal, 1) \
V(Float32x4_reciprocalSqrt, 1) \
V(Float64x2_fromDoubles, 2) \
V(Float64x2_splat, 1) \
V(Float64x2_zero, 1) \
V(Float64x2_fromFloat32x4, 2) \
V(Float64x2_add, 2) \
V(Float64x2_negate, 1) \
V(Float64x2_sub, 2) \
V(Float64x2_mul, 2) \
V(Float64x2_div, 2) \
V(Float64x2_scale, 2) \
V(Float64x2_abs, 1) \
V(Float64x2_clamp, 3) \
V(Float64x2_getX, 1) \
V(Float64x2_getY, 1) \
V(Float64x2_getSignMask, 1) \
V(Float64x2_setX, 2) \
V(Float64x2_setY, 2) \
V(Float64x2_min, 2) \
V(Float64x2_max, 2) \
V(Float64x2_sqrt, 1) \
V(Int32x4_fromInts, 4) \
V(Int32x4_fromBools, 4) \
V(Int32x4_fromFloat32x4Bits, 2) \
V(Int32x4_or, 2) \
V(Int32x4_and, 2) \
V(Int32x4_xor, 2) \
V(Int32x4_add, 2) \
V(Int32x4_sub, 2) \
V(Int32x4_getX, 1) \
V(Int32x4_getY, 1) \
V(Int32x4_getZ, 1) \
V(Int32x4_getW, 1) \
V(Int32x4_setX, 2) \
V(Int32x4_setY, 2) \
V(Int32x4_setZ, 2) \
V(Int32x4_setW, 2) \
V(Int32x4_getSignMask, 1) \
V(Int32x4_shuffle, 2) \
V(Int32x4_shuffleMix, 3) \
V(Int32x4_getFlagX, 1) \
V(Int32x4_getFlagY, 1) \
V(Int32x4_getFlagZ, 1) \
V(Int32x4_getFlagW, 1) \
V(Int32x4_setFlagX, 2) \
V(Int32x4_setFlagY, 2) \
V(Int32x4_setFlagZ, 2) \
V(Int32x4_setFlagW, 2) \
V(Int32x4_select, 3) \
V(Isolate_spawnFunction, 11) \
V(Isolate_spawnUri, 12) \
V(Isolate_getPortAndCapabilitiesOfCurrentIsolate, 0) \
V(Isolate_getCurrentRootUriStr, 0) \
V(Isolate_sendOOB, 2) \
V(Isolate_getDebugName, 1) \
V(GrowableList_allocate, 2) \
V(GrowableList_getIndexed, 2) \
V(GrowableList_setIndexed, 3) \
V(GrowableList_getLength, 1) \
V(GrowableList_getCapacity, 1) \
V(GrowableList_setLength, 2) \
V(GrowableList_setData, 2) \
V(Internal_unsafeCast, 1) \
V(Internal_reachabilityFence, 1) \
V(Internal_makeListFixedLength, 1) \
V(Internal_makeFixedListUnmodifiable, 1) \
V(Internal_inquireIs64Bit, 0) \
V(Internal_extractTypeArguments, 2) \
V(Internal_prependTypeArguments, 4) \
V(Internal_boundsCheckForPartialInstantiation, 2) \
V(InvocationMirror_unpackTypeArguments, 2) \
V(NoSuchMethodError_existingMethodSignature, 3) \
V(LinkedHashMap_getIndex, 1) \
V(LinkedHashMap_setIndex, 2) \
V(LinkedHashMap_getData, 1) \
V(LinkedHashMap_setData, 2) \
V(LinkedHashMap_getHashMask, 1) \
V(LinkedHashMap_setHashMask, 2) \
V(LinkedHashMap_getUsedData, 1) \
V(LinkedHashMap_setUsedData, 2) \
V(LinkedHashMap_getDeletedKeys, 1) \
V(LinkedHashMap_setDeletedKeys, 2) \
V(WeakProperty_new, 2) \
V(WeakProperty_getKey, 1) \
V(WeakProperty_getValue, 1) \
V(WeakProperty_setValue, 2) \
V(Uri_isWindowsPlatform, 0) \
V(UserTag_new, 2) \
V(UserTag_label, 1) \
V(UserTag_defaultTag, 0) \
V(UserTag_makeCurrent, 1) \
V(Profiler_getCurrentTag, 0) \
V(ClassID_getID, 1) \
V(VMService_SendIsolateServiceMessage, 2) \
V(VMService_SendRootServiceMessage, 1) \
V(VMService_SendObjectRootServiceMessage, 1) \
V(VMService_OnStart, 0) \
V(VMService_OnExit, 0) \
V(VMService_OnServerAddressChange, 1) \
V(VMService_ListenStream, 1) \
V(VMService_CancelStream, 1) \
V(VMService_RequestAssets, 0) \
V(VMService_DecodeAssets, 1) \
V(Ffi_loadInt8, 2) \
V(Ffi_loadInt16, 2) \
V(Ffi_loadInt32, 2) \
V(Ffi_loadInt64, 2) \
V(Ffi_loadUint8, 2) \
V(Ffi_loadUint16, 2) \
V(Ffi_loadUint32, 2) \
V(Ffi_loadUint64, 2) \
V(Ffi_loadIntPtr, 2) \
V(Ffi_loadFloat, 2) \
V(Ffi_loadDouble, 2) \
V(Ffi_loadPointer, 2) \
V(Ffi_loadStruct, 2) \
V(Ffi_storeInt8, 3) \
V(Ffi_storeInt16, 3) \
V(Ffi_storeInt32, 3) \
V(Ffi_storeInt64, 3) \
V(Ffi_storeUint8, 3) \
V(Ffi_storeUint16, 3) \
V(Ffi_storeUint32, 3) \
V(Ffi_storeUint64, 3) \
V(Ffi_storeIntPtr, 3) \
V(Ffi_storeFloat, 3) \
V(Ffi_storeDouble, 3) \
V(Ffi_storePointer, 3) \
V(Ffi_address, 1) \
V(Ffi_fromAddress, 1) \
V(Ffi_sizeOf, 0) \
V(Ffi_asFunctionInternal, 1) \
V(Ffi_nativeCallbackFunction, 2) \
V(Ffi_pointerFromFunction, 1) \
V(Ffi_dl_open, 1) \
V(Ffi_dl_lookup, 2) \
[vm/isolate] Add TransferableTypedData class that allows low-cost passing of Uint8List between isolates. TransferableTypedData instances are one-use kind of thing: once receiver materializes it, it can't be used again, once sender sends it out to an isolate, sender can't send it to different isolate. Example of use: sender isolate: ``` Future<TransferableTypedData> consolidateHttpClientResponseBytes(HttpClientResponse response) { final completer = Completer<TransferableTypedData>(); final chunks = <Uint8List>[]; response.listen((List<int> chunk) { chunks.add(chunk); }, onDone: () { completer.complete(TransferableTypedData.fromList(chunks)); }); return completer.future; } ... sendPort.send(await consolidateHttpClientResponseBytes(response)); ``` receiver isolate: ``` RawReceivePort port = RawReceivePort((TransferableTypedData transferable) { Uint8List content = transferable.materialize().asUint8List(); ... }); ``` 31959[tr] and 31960[tr] tests were inspired by dartbug.com/31959, dartbug.com/31960 that this CL attempts to address: ``` ╰─➤ out/ReleaseX64/dart 31960.dart sending... 163ms for round-trip sending... 81ms for round-trip sending... 20ms for round-trip sending... 14ms for round-trip sending... 20ms for round-trip sending... 14ms for round-trip ``` (notice no "since last checking" pauses") vs ``` ╰─➤ out/ReleaseX64/dart 31960.dart sending... 154ms since last checkin 174ms for round-trip sending... 68ms since last checkin 9ms since last checkin 171ms for round-trip sending... 13ms since last checkin 108ms for round-trip sending... 14ms since last checkin 108ms for round-trip sending... 14ms since last checkin 107ms for round-trip ``` Change-Id: I0fcb5ce285394f498c3f1db4414204531f98199d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99623 Commit-Queue: Alexander Aprelev <aam@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-06 19:49:07 +00:00
V(Ffi_dl_getHandle, 1) \
V(Ffi_asExternalTypedData, 2) \
V(Ffi_dl_processLibrary, 0) \
V(Ffi_dl_executableLibrary, 0) \
V(NativeApiFunctionPointer, 1) \
[vm/isolate] Add TransferableTypedData class that allows low-cost passing of Uint8List between isolates. TransferableTypedData instances are one-use kind of thing: once receiver materializes it, it can't be used again, once sender sends it out to an isolate, sender can't send it to different isolate. Example of use: sender isolate: ``` Future<TransferableTypedData> consolidateHttpClientResponseBytes(HttpClientResponse response) { final completer = Completer<TransferableTypedData>(); final chunks = <Uint8List>[]; response.listen((List<int> chunk) { chunks.add(chunk); }, onDone: () { completer.complete(TransferableTypedData.fromList(chunks)); }); return completer.future; } ... sendPort.send(await consolidateHttpClientResponseBytes(response)); ``` receiver isolate: ``` RawReceivePort port = RawReceivePort((TransferableTypedData transferable) { Uint8List content = transferable.materialize().asUint8List(); ... }); ``` 31959[tr] and 31960[tr] tests were inspired by dartbug.com/31959, dartbug.com/31960 that this CL attempts to address: ``` ╰─➤ out/ReleaseX64/dart 31960.dart sending... 163ms for round-trip sending... 81ms for round-trip sending... 20ms for round-trip sending... 14ms for round-trip sending... 20ms for round-trip sending... 14ms for round-trip ``` (notice no "since last checking" pauses") vs ``` ╰─➤ out/ReleaseX64/dart 31960.dart sending... 154ms since last checkin 174ms for round-trip sending... 68ms since last checkin 9ms since last checkin 171ms for round-trip sending... 13ms since last checkin 108ms for round-trip sending... 14ms since last checkin 108ms for round-trip sending... 14ms since last checkin 107ms for round-trip ``` Change-Id: I0fcb5ce285394f498c3f1db4414204531f98199d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99623 Commit-Queue: Alexander Aprelev <aam@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-06 19:49:07 +00:00
V(TransferableTypedData_factory, 2) \
Reland "Scaffolding for dart:wasm" This reverts commit 9198813a553c6ce230c8c545d33fbad14ffef340. Reason for revert: Relanding with a fix Original change's description: > Revert "Scaffolding for dart:wasm" > > This reverts commit f39a3f188e3bd259d4d7e41c48516e507c1303f1. > > Reason for revert: https://golem.corp.goog/BuildInfo?target=flutter-profile&machine-type=android-armv7&revision=84750 > > Original change's description: > > Scaffolding for dart:wasm > > > > This CL doesn't have any tests because it's just boilerplate. I'll > > add a test in the follow up CLs where I add actual functionality. > > > > Bug: https://github.com/dart-lang/sdk/issues/37882 > > Change-Id: I47c81f5f1be724f8226e756ba5d01880a45f1ac7 > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112841 > > Reviewed-by: Siva Annamalai <asiva@google.com> > > Reviewed-by: Liam Appelbe <liama@google.com> > > Commit-Queue: Liam Appelbe <liama@google.com> > > TBR=asiva@google.com,liama@google.com > > Change-Id: I0fd0f29d66a07fc29e840ddaec2d4161c8d599cb > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: https://github.com/dart-lang/sdk/issues/37882 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114044 > Reviewed-by: Liam Appelbe <liama@google.com> > Commit-Queue: Liam Appelbe <liama@google.com> TBR=asiva@google.com,liama@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: https://github.com/dart-lang/sdk/issues/37882 Change-Id: Idb43cbd3a0521776ac420bfef91c8a9a4362f18e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114757 Reviewed-by: Liam Appelbe <liama@google.com> Commit-Queue: Liam Appelbe <liama@google.com>
2019-08-28 23:11:21 +00:00
V(TransferableTypedData_materialize, 1) \
V(Wasm_initModule, 2) \
V(Wasm_describeModule, 1) \
V(Wasm_initImports, 1) \
V(Wasm_addMemoryImport, 4) \
V(Wasm_addGlobalImport, 6) \
V(Wasm_addFunctionImport, 5) \
V(Wasm_initMemory, 3) \
V(Wasm_growMemory, 2) \
V(Wasm_initInstance, 3) \
V(Wasm_initMemoryFromInstance, 2) \
V(Wasm_getMemoryPages, 1) \
V(Wasm_initFunction, 4) \
Reland "Scaffolding for dart:wasm" This reverts commit 9198813a553c6ce230c8c545d33fbad14ffef340. Reason for revert: Relanding with a fix Original change's description: > Revert "Scaffolding for dart:wasm" > > This reverts commit f39a3f188e3bd259d4d7e41c48516e507c1303f1. > > Reason for revert: https://golem.corp.goog/BuildInfo?target=flutter-profile&machine-type=android-armv7&revision=84750 > > Original change's description: > > Scaffolding for dart:wasm > > > > This CL doesn't have any tests because it's just boilerplate. I'll > > add a test in the follow up CLs where I add actual functionality. > > > > Bug: https://github.com/dart-lang/sdk/issues/37882 > > Change-Id: I47c81f5f1be724f8226e756ba5d01880a45f1ac7 > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112841 > > Reviewed-by: Siva Annamalai <asiva@google.com> > > Reviewed-by: Liam Appelbe <liama@google.com> > > Commit-Queue: Liam Appelbe <liama@google.com> > > TBR=asiva@google.com,liama@google.com > > Change-Id: I0fd0f29d66a07fc29e840ddaec2d4161c8d599cb > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: https://github.com/dart-lang/sdk/issues/37882 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114044 > Reviewed-by: Liam Appelbe <liama@google.com> > Commit-Queue: Liam Appelbe <liama@google.com> TBR=asiva@google.com,liama@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: https://github.com/dart-lang/sdk/issues/37882 Change-Id: Idb43cbd3a0521776ac420bfef91c8a9a4362f18e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114757 Reviewed-by: Liam Appelbe <liama@google.com> Commit-Queue: Liam Appelbe <liama@google.com>
2019-08-28 23:11:21 +00:00
V(Wasm_callFunction, 2)
// List of bootstrap native entry points used in the dart:mirror library.
#define MIRRORS_BOOTSTRAP_NATIVE_LIST(V) \
V(Mirrors_makeLocalClassMirror, 1) \
V(Mirrors_makeLocalTypeMirror, 1) \
V(Mirrors_instantiateGenericType, 2) \
V(Mirrors_mangleName, 2) \
V(MirrorReference_equals, 2) \
V(MirrorSystem_libraries, 0) \
V(MirrorSystem_isolate, 0) \
V(IsolateMirror_loadUri, 1) \
V(InstanceMirror_invoke, 5) \
V(InstanceMirror_invokeGetter, 3) \
V(InstanceMirror_invokeSetter, 4) \
V(InstanceMirror_computeType, 1) \
V(ClosureMirror_function, 1) \
V(TypeMirror_subtypeTest, 2) \
V(ClassMirror_libraryUri, 1) \
V(ClassMirror_supertype, 1) \
V(ClassMirror_supertype_instantiated, 1) \
V(ClassMirror_interfaces, 1) \
V(ClassMirror_interfaces_instantiated, 1) \
V(ClassMirror_mixin, 1) \
V(ClassMirror_mixin_instantiated, 2) \
V(ClassMirror_members, 3) \
V(ClassMirror_constructors, 3) \
V(LibraryMirror_members, 2) \
V(LibraryMirror_libraryDependencies, 2) \
V(ClassMirror_invoke, 5) \
V(ClassMirror_invokeGetter, 3) \
V(ClassMirror_invokeSetter, 4) \
V(ClassMirror_invokeConstructor, 5) \
V(ClassMirror_type_variables, 1) \
V(ClassMirror_type_arguments, 1) \
V(LibraryMirror_fromPrefix, 1) \
V(LibraryMirror_invoke, 5) \
V(LibraryMirror_invokeGetter, 3) \
V(LibraryMirror_invokeSetter, 4) \
V(TypeVariableMirror_owner, 1) \
V(TypeVariableMirror_upper_bound, 1) \
V(DeclarationMirror_location, 1) \
V(DeclarationMirror_metadata, 1) \
V(FunctionTypeMirror_call_method, 2) \
V(FunctionTypeMirror_parameters, 2) \
V(FunctionTypeMirror_return_type, 1) \
V(MethodMirror_owner, 2) \
V(MethodMirror_parameters, 2) \
V(MethodMirror_return_type, 2) \
V(MethodMirror_source, 1) \
V(ParameterMirror_type, 3) \
V(TypedefMirror_referent, 1) \
V(TypedefMirror_declaration, 1) \
V(VariableMirror_type, 2)
class BootstrapNatives : public AllStatic {
public:
static Dart_NativeFunction Lookup(Dart_Handle name,
int argument_count,
bool* auto_setup_scope);
static const uint8_t* Symbol(Dart_NativeFunction nf);
#define DECLARE_BOOTSTRAP_NATIVE(name, ignored) \
static ObjectPtr DN_##name(Thread* thread, Zone* zone, \
NativeArguments* arguments);
BOOTSTRAP_NATIVE_LIST(DECLARE_BOOTSTRAP_NATIVE)
#if !defined(DART_PRECOMPILED_RUNTIME)
MIRRORS_BOOTSTRAP_NATIVE_LIST(DECLARE_BOOTSTRAP_NATIVE)
#endif
#undef DECLARE_BOOTSTRAP_NATIVE
};
} // namespace dart
#endif // RUNTIME_VM_BOOTSTRAP_NATIVES_H_