2012-02-29 02:14:18 +00:00
|
|
|
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
2011-10-05 05:20:07 +00:00
|
|
|
// 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.
|
|
|
|
|
2016-10-26 07:26:03 +00:00
|
|
|
#ifndef RUNTIME_VM_BOOTSTRAP_NATIVES_H_
|
|
|
|
#define RUNTIME_VM_BOOTSTRAP_NATIVES_H_
|
2011-10-05 05:20:07 +00:00
|
|
|
|
|
|
|
#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.
|
2019-08-28 23:11:21 +00:00
|
|
|
// V(function_name, argument_count)
|
2011-10-05 05:20:07 +00:00
|
|
|
#define BOOTSTRAP_NATIVE_LIST(V) \
|
2017-03-24 14:56:50 +00:00
|
|
|
V(AsyncStarMoveNext_debuggerStepCheck, 1) \
|
2017-02-20 10:52:52 +00:00
|
|
|
V(DartAsync_fatal, 1) \
|
2013-11-04 11:32:52 +00:00
|
|
|
V(Object_equals, 2) \
|
2013-07-08 21:41:05 +00:00
|
|
|
V(Object_getHash, 1) \
|
2011-10-05 05:20:07 +00:00
|
|
|
V(Object_toString, 1) \
|
2012-09-27 21:19:00 +00:00
|
|
|
V(Object_runtimeType, 1) \
|
2016-11-01 15:49:02 +00:00
|
|
|
V(Object_haveSameRuntimeType, 2) \
|
2020-03-03 20:30:32 +00:00
|
|
|
V(Object_instanceOf, 4) \
|
2016-07-14 18:11:17 +00:00
|
|
|
V(Object_simpleInstanceOf, 2) \
|
2012-12-14 19:04:01 +00:00
|
|
|
V(Function_apply, 2) \
|
2016-01-20 00:32:59 +00:00
|
|
|
V(Closure_equals, 2) \
|
2017-07-20 22:22:15 +00:00
|
|
|
V(Closure_computeHash, 1) \
|
2012-09-27 21:19:00 +00:00
|
|
|
V(AbstractType_toString, 1) \
|
2017-10-10 23:46:09 +00:00
|
|
|
V(Type_getHashCode, 1) \
|
2019-12-09 18:18:59 +00:00
|
|
|
V(Type_equality, 2) \
|
2021-01-07 23:45:37 +00:00
|
|
|
V(FunctionType_getHashCode, 1) \
|
|
|
|
V(FunctionType_equality, 2) \
|
2020-06-16 21:11:40 +00:00
|
|
|
V(LibraryPrefix_isLoaded, 1) \
|
|
|
|
V(LibraryPrefix_setLoaded, 1) \
|
[vm] Initial implementation of deferred loading.
(Assignment of libraries to loading units is already done in the kernel generation step.)
After compiling and before serializing, we walk the program and for each Code we assign its Instructions, CodeSourceMap and CompressedStackMap to the loading unit of that Code's defining library. Deduplication may cause Instructions, CodeSourceMaps and CompressedStackMaps to belong to more than one loading unit; in this case the objects are assigned to the root loading unit. Later they can be more precisely assigned to the dominating loading unit.
All objects except some Instructions, CodeSourceMaps and CompressedStackMaps belong to the root loading unit's snapshot. This snapshot is written like an unsplit snapshot, except that when serializing Code, we will write a reference to a stub or null when the Code's Instructions, CodeSourceMap or CompressedStackMap belongs to a non-root loading unit. The snapshots of non-root loading units contain these deferred objects and references to the corresponding Code objects to patch. The types of objects we defer (Instructions, CodeSourceMaps and CompressedStackMaps) usually represent 70+% of the snapshot size.
Bare instructions mode must be disabled when splitting because we cannot have PC-relative calls between loading units. Later we can re-enable this for calls within loading units.
Broken: Compactor probably crashes we can now have an unbounded number of image pages and the compactor assumes a fixed number.
Embedder's guide:
At compile-time, gen_snapshot should be passed --loading_unit_manifest with a path, which will enable splitting and output a mapping from loading unit ids to snapshot output paths.
At runtime, sometime during isolate startup, an embedder should call Dart_SetDeferredLoadHandler, probably near an existing call to Dart_SetLibraryTagHandler. The callback is given a loading unit id, and should eventually call Dart_DeferredLoadComplete[Error].
Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: Ib597eb87c8cd634416d5ee1f00629c5550aebb00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152427
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-07-17 19:29:47 +00:00
|
|
|
V(LibraryPrefix_loadingUnit, 1) \
|
|
|
|
V(LibraryPrefix_issueLoad, 1) \
|
2012-12-22 00:12:35 +00:00
|
|
|
V(Identical_comparison, 2) \
|
2011-10-05 05:20:07 +00:00
|
|
|
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) \
|
2013-10-31 05:46:57 +00:00
|
|
|
V(Integer_fromEnvironment, 3) \
|
2012-11-16 19:42:02 +00:00
|
|
|
V(Integer_parse, 1) \
|
2018-06-18 18:16:51 +00:00
|
|
|
V(Integer_shlFromInteger, 2) \
|
|
|
|
V(Integer_shrFromInteger, 2) \
|
2021-02-24 00:14:57 +00:00
|
|
|
V(Integer_ushrFromInteger, 2) \
|
2013-10-31 05:46:57 +00:00
|
|
|
V(Bool_fromEnvironment, 3) \
|
2020-03-16 11:17:58 +00:00
|
|
|
V(Bool_hasEnvironment, 2) \
|
2014-04-23 19:44:03 +00:00
|
|
|
V(CapabilityImpl_factory, 1) \
|
2014-12-04 12:17:48 +00:00
|
|
|
V(CapabilityImpl_equals, 2) \
|
|
|
|
V(CapabilityImpl_get_hashcode, 1) \
|
2020-10-29 02:52:03 +00:00
|
|
|
V(RawReceivePortImpl_factory, 2) \
|
2014-04-23 19:44:03 +00:00
|
|
|
V(RawReceivePortImpl_get_id, 1) \
|
|
|
|
V(RawReceivePortImpl_get_sendport, 1) \
|
2013-10-25 19:23:00 +00:00
|
|
|
V(RawReceivePortImpl_closeInternal, 1) \
|
2020-11-11 23:42:12 +00:00
|
|
|
V(RawReceivePortImpl_setActive, 2) \
|
2014-04-23 19:44:03 +00:00
|
|
|
V(SendPortImpl_get_id, 1) \
|
|
|
|
V(SendPortImpl_get_hashcode, 1) \
|
2013-11-15 11:28:23 +00:00
|
|
|
V(SendPortImpl_sendInternal_, 2) \
|
2011-10-05 05:20:07 +00:00
|
|
|
V(Smi_bitNegate, 1) \
|
2013-09-06 22:22:26 +00:00
|
|
|
V(Smi_bitLength, 1) \
|
2022-06-30 22:53:24 +00:00
|
|
|
V(SuspendState_instantiateClosureWithFutureTypeArgument, 2) \
|
2011-10-05 05:20:07 +00:00
|
|
|
V(Mint_bitNegate, 1) \
|
2013-09-06 22:22:26 +00:00
|
|
|
V(Mint_bitLength, 1) \
|
2015-05-08 22:18:43 +00:00
|
|
|
V(Developer_debugger, 2) \
|
2016-12-01 20:48:49 +00:00
|
|
|
V(Developer_getIsolateIDFromSendPort, 1) \
|
2016-10-31 19:32:23 +00:00
|
|
|
V(Developer_getServerInfo, 1) \
|
|
|
|
V(Developer_getServiceMajorVersion, 0) \
|
|
|
|
V(Developer_getServiceMinorVersion, 0) \
|
2015-05-08 22:18:43 +00:00
|
|
|
V(Developer_inspect, 1) \
|
2015-08-27 18:23:39 +00:00
|
|
|
V(Developer_lookupExtension, 1) \
|
|
|
|
V(Developer_registerExtension, 2) \
|
2015-07-21 14:54:46 +00:00
|
|
|
V(Developer_log, 8) \
|
2015-12-17 17:34:52 +00:00
|
|
|
V(Developer_postEvent, 2) \
|
2020-08-21 19:32:40 +00:00
|
|
|
V(Developer_webServerControl, 3) \
|
2017-10-23 06:47:20 +00:00
|
|
|
V(Double_hashCode, 1) \
|
2012-10-23 16:15:36 +00:00
|
|
|
V(Double_getIsNegative, 1) \
|
|
|
|
V(Double_getIsInfinite, 1) \
|
|
|
|
V(Double_getIsNaN, 1) \
|
2011-10-05 05:20:07 +00:00
|
|
|
V(Double_add, 2) \
|
|
|
|
V(Double_sub, 2) \
|
|
|
|
V(Double_mul, 2) \
|
|
|
|
V(Double_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) \
|
2014-07-01 11:59:31 +00:00
|
|
|
V(Double_parse, 3) \
|
2016-04-08 23:25:52 +00:00
|
|
|
V(Double_toString, 1) \
|
2011-12-22 22:03:35 +00:00
|
|
|
V(Double_toStringAsFixed, 2) \
|
|
|
|
V(Double_toStringAsExponential, 2) \
|
|
|
|
V(Double_toStringAsPrecision, 2) \
|
2015-06-03 18:00:28 +00:00
|
|
|
V(Double_flipSignBit, 1) \
|
2019-04-29 09:11:48 +00:00
|
|
|
V(RegExp_factory, 6) \
|
2016-03-22 00:21:05 +00:00
|
|
|
V(RegExp_getPattern, 1) \
|
|
|
|
V(RegExp_getIsMultiLine, 1) \
|
|
|
|
V(RegExp_getIsCaseSensitive, 1) \
|
2019-04-29 09:11:48 +00:00
|
|
|
V(RegExp_getIsUnicode, 1) \
|
|
|
|
V(RegExp_getIsDotAll, 1) \
|
2016-03-22 00:21:05 +00:00
|
|
|
V(RegExp_getGroupCount, 1) \
|
2019-03-19 10:40:15 +00:00
|
|
|
V(RegExp_getGroupNameMap, 1) \
|
2016-03-22 00:21:05 +00:00
|
|
|
V(RegExp_ExecuteMatch, 3) \
|
2016-11-17 16:46:21 +00:00
|
|
|
V(RegExp_ExecuteMatchSticky, 3) \
|
2018-05-30 13:44:43 +00:00
|
|
|
V(List_new, 2) \
|
2013-10-03 00:15:14 +00:00
|
|
|
V(List_allocate, 2) \
|
|
|
|
V(List_getIndexed, 2) \
|
|
|
|
V(List_setIndexed, 3) \
|
|
|
|
V(List_getLength, 1) \
|
2014-09-03 20:36:01 +00:00
|
|
|
V(List_slice, 4) \
|
2014-01-15 19:14:45 +00:00
|
|
|
V(ImmutableList_from, 4) \
|
2014-09-25 10:45:24 +00:00
|
|
|
V(StringBase_createFromCodePoints, 3) \
|
2012-08-23 21:48:40 +00:00
|
|
|
V(StringBase_substringUnchecked, 3) \
|
2015-01-22 08:27:42 +00:00
|
|
|
V(StringBase_joinReplaceAllResult, 4) \
|
2013-03-08 10:21:52 +00:00
|
|
|
V(StringBuffer_createStringFromUint16Array, 3) \
|
2012-11-29 22:55:09 +00:00
|
|
|
V(OneByteString_substringUnchecked, 3) \
|
2014-09-25 10:45:24 +00:00
|
|
|
V(OneByteString_allocateFromOneByteList, 3) \
|
2015-01-28 12:44:44 +00:00
|
|
|
V(TwoByteString_allocateFromTwoByteList, 3) \
|
2012-10-22 12:41:04 +00:00
|
|
|
V(String_getHashCode, 1) \
|
2011-10-05 05:20:07 +00:00
|
|
|
V(String_getLength, 1) \
|
|
|
|
V(String_charAt, 2) \
|
2013-02-25 10:48:09 +00:00
|
|
|
V(String_codeUnitAt, 2) \
|
2011-10-05 05:20:07 +00:00
|
|
|
V(String_concat, 2) \
|
2013-10-31 05:46:57 +00:00
|
|
|
V(String_fromEnvironment, 3) \
|
2011-10-21 20:33:29 +00:00
|
|
|
V(String_toLowerCase, 1) \
|
|
|
|
V(String_toUpperCase, 1) \
|
2013-10-29 18:18:40 +00:00
|
|
|
V(String_concatRange, 3) \
|
2013-08-20 08:13:13 +00:00
|
|
|
V(Math_doublePow, 2) \
|
2014-03-14 17:30:05 +00:00
|
|
|
V(Random_initialSeed, 0) \
|
2015-10-15 17:16:03 +00:00
|
|
|
V(SecureRandom_getBytes, 1) \
|
2015-12-08 23:46:46 +00:00
|
|
|
V(DateTime_currentTimeMicros, 0) \
|
|
|
|
V(DateTime_timeZoneName, 1) \
|
|
|
|
V(DateTime_timeZoneOffsetInSeconds, 1) \
|
2016-12-14 19:05:19 +00:00
|
|
|
V(AssertionError_throwNew, 3) \
|
2020-06-18 20:02:42 +00:00
|
|
|
V(AssertionError_throwNewSource, 4) \
|
2021-11-08 15:51:32 +00:00
|
|
|
V(Error_throwWithStackTrace, 2) \
|
2015-11-24 07:26:03 +00:00
|
|
|
V(StackTrace_current, 0) \
|
2018-12-10 23:15:27 +00:00
|
|
|
V(TypeError_throwNew, 4) \
|
2012-08-15 12:06:17 +00:00
|
|
|
V(Stopwatch_now, 0) \
|
|
|
|
V(Stopwatch_frequency, 0) \
|
2022-07-22 19:13:47 +00:00
|
|
|
V(Timeline_getNextTaskId, 0) \
|
2015-10-01 16:30:47 +00:00
|
|
|
V(Timeline_getTraceClock, 0) \
|
2016-05-17 16:45:28 +00:00
|
|
|
V(Timeline_isDartStreamEnabled, 0) \
|
2020-01-02 23:13:06 +00:00
|
|
|
V(Timeline_reportFlowEvent, 5) \
|
|
|
|
V(Timeline_reportInstantEvent, 3) \
|
|
|
|
V(Timeline_reportTaskEvent, 5) \
|
2016-03-10 08:38:08 +00:00
|
|
|
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) \
|
2021-06-08 19:15:38 +00:00
|
|
|
V(TypedDataBase_length, 1) \
|
|
|
|
V(TypedDataBase_setRange, 7) \
|
2013-03-07 21:50:33 +00:00
|
|
|
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) \
|
2013-03-27 14:44:15 +00:00
|
|
|
V(TypedData_GetFloat32x4, 2) \
|
|
|
|
V(TypedData_SetFloat32x4, 3) \
|
2014-01-07 00:48:46 +00:00
|
|
|
V(TypedData_GetInt32x4, 2) \
|
|
|
|
V(TypedData_SetInt32x4, 3) \
|
2014-01-31 15:28:05 +00:00
|
|
|
V(TypedData_GetFloat64x2, 2) \
|
|
|
|
V(TypedData_SetFloat64x2, 3) \
|
2019-03-15 21:24:15 +00:00
|
|
|
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_offsetInBytes, 1) \
|
|
|
|
V(TypedDataView_typedData, 1) \
|
2019-12-09 15:29:27 +00:00
|
|
|
V(Float32x4_fromDoubles, 4) \
|
|
|
|
V(Float32x4_splat, 1) \
|
2014-01-07 00:48:46 +00:00
|
|
|
V(Float32x4_fromInt32x4Bits, 2) \
|
2014-01-31 15:28:05 +00:00
|
|
|
V(Float32x4_fromFloat64x2, 2) \
|
2013-03-27 14:44:15 +00:00
|
|
|
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) \
|
2013-08-20 21:35:53 +00:00
|
|
|
V(Float32x4_getSignMask, 1) \
|
2013-07-19 17:03:09 +00:00
|
|
|
V(Float32x4_shuffle, 2) \
|
2013-11-01 07:09:54 +00:00
|
|
|
V(Float32x4_shuffleMix, 3) \
|
2013-03-27 14:44:15 +00:00
|
|
|
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) \
|
2019-12-09 15:29:27 +00:00
|
|
|
V(Float64x2_fromDoubles, 2) \
|
|
|
|
V(Float64x2_splat, 1) \
|
2014-01-31 15:28:05 +00:00
|
|
|
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) \
|
2019-12-09 15:29:27 +00:00
|
|
|
V(Int32x4_fromInts, 4) \
|
|
|
|
V(Int32x4_fromBools, 4) \
|
2014-01-07 00:48:46 +00:00
|
|
|
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) \
|
2021-09-30 20:20:24 +00:00
|
|
|
V(Isolate_exit_, 2) \
|
2016-01-13 02:19:04 +00:00
|
|
|
V(Isolate_getCurrentRootUriStr, 0) \
|
2019-03-28 16:39:50 +00:00
|
|
|
V(Isolate_getDebugName, 1) \
|
2021-09-30 20:20:24 +00:00
|
|
|
V(Isolate_getPortAndCapabilitiesOfCurrentIsolate, 0) \
|
2022-02-23 16:55:52 +00:00
|
|
|
V(Isolate_registerKernelBlob, 1) \
|
|
|
|
V(Isolate_unregisterKernelBlob, 1) \
|
2021-09-30 20:20:24 +00:00
|
|
|
V(Isolate_sendOOB, 2) \
|
|
|
|
V(Isolate_spawnFunction, 10) \
|
|
|
|
V(Isolate_spawnUri, 12) \
|
2016-02-22 17:55:20 +00:00
|
|
|
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) \
|
2018-08-20 13:25:10 +00:00
|
|
|
V(Internal_unsafeCast, 1) \
|
[vm] Native effects
Adds a way to express native effects in Dart expressions in kernel.
This CL adds a `void _nativeEffect(Object)` to `dart:internal`.
The semantics of `_nativeEffect` are to not execute its arguments and
return `null`.
This CL uses this `_nativeEffect` to make sure that we never execute
the struct constructor invocations used to simulate the native behavior
of FFI trampolines.
Closes: https://github.com/dart-lang/sdk/issues/45607
TEST=tests/ffi(_2)/native_effect_test.dart
Change-Id: Ie06de145e49f8b1cae9e148c2d5d97d5cd8e6878
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,dart-sdk-linux-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194421
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-09 16:45:13 +00:00
|
|
|
V(Internal_nativeEffect, 1) \
|
2020-05-18 11:30:57 +00:00
|
|
|
V(Internal_collectAllGarbage, 0) \
|
2016-02-22 17:55:20 +00:00
|
|
|
V(Internal_makeListFixedLength, 1) \
|
|
|
|
V(Internal_makeFixedListUnmodifiable, 1) \
|
2018-01-12 21:32:20 +00:00
|
|
|
V(Internal_extractTypeArguments, 2) \
|
2018-05-03 23:51:36 +00:00
|
|
|
V(Internal_prependTypeArguments, 4) \
|
2018-08-31 10:13:51 +00:00
|
|
|
V(Internal_boundsCheckForPartialInstantiation, 2) \
|
2020-05-12 17:33:50 +00:00
|
|
|
V(Internal_allocateOneByteString, 1) \
|
|
|
|
V(Internal_allocateTwoByteString, 1) \
|
|
|
|
V(Internal_writeIntoOneByteString, 3) \
|
|
|
|
V(Internal_writeIntoTwoByteString, 3) \
|
2021-07-13 07:30:18 +00:00
|
|
|
V(Internal_deoptimizeFunctionsOnStack, 0) \
|
Reland "[pkg/native_stack_traces] Support Mach-O dSYM debugging information."
This is a reland of commit 08c13f173c3715fd768d768566eeccf1f9f14c3b
Fixes test failures on non-x64 architectures, both in the test
harness and due to DWARF5 line number program headers having a
non-backwards compatible format. (We generate DWARF2 in the
ELF snapshot writer, but the assembler used for assembly snapshots
may generate DWARF5.)
TEST=vm/dart{,_2}/use_dwarf_stack_traces_flag
Original change's description:
> [pkg/native_stack_traces] Support Mach-O dSYM debugging information.
>
> TEST=vm/dart{,_2}/use_dwarf_stack_traces_flag
>
> Bug: https://github.com/dart-lang/sdk/issues/43612
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-mac-product-x64-try,pkg-mac-release-arm64-try,vm-kernel-mac-release-arm64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
> Change-Id: Icda21bb14dcc0cf4784cea118e6ba7dd4edd35aa
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250381
> Commit-Queue: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
Bug: https://github.com/dart-lang/sdk/issues/43612
Change-Id: I8a9cb70e78bc8594bcae004809c5a1be778d691d
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-mac-product-x64-try,pkg-mac-release-arm64-try,vm-kernel-mac-release-arm64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-nnbd-mac-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251464
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-07-22 07:05:26 +00:00
|
|
|
V(Internal_randomInstructionsOffsetInsideAllocateObjectStub, 0) \
|
2018-05-10 17:06:42 +00:00
|
|
|
V(InvocationMirror_unpackTypeArguments, 2) \
|
2017-09-28 00:27:24 +00:00
|
|
|
V(NoSuchMethodError_existingMethodSignature, 3) \
|
2016-02-22 17:55:20 +00:00
|
|
|
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(VMService_SendIsolateServiceMessage, 2) \
|
|
|
|
V(VMService_SendRootServiceMessage, 1) \
|
2016-06-10 19:33:50 +00:00
|
|
|
V(VMService_SendObjectRootServiceMessage, 1) \
|
2016-02-22 17:55:20 +00:00
|
|
|
V(VMService_OnStart, 0) \
|
|
|
|
V(VMService_OnExit, 0) \
|
|
|
|
V(VMService_OnServerAddressChange, 1) \
|
2022-01-11 23:35:28 +00:00
|
|
|
V(VMService_ListenStream, 2) \
|
2016-02-22 17:55:20 +00:00
|
|
|
V(VMService_CancelStream, 1) \
|
|
|
|
V(VMService_RequestAssets, 0) \
|
|
|
|
V(VMService_DecodeAssets, 1) \
|
2021-12-17 00:15:09 +00:00
|
|
|
V(VMService_AddUserTagsToStreamableSampleList, 1) \
|
|
|
|
V(VMService_RemoveUserTagsFromStreamableSampleList, 1) \
|
[vm/ffi] Pointer optimize indexed load and store
Follow up of https://dart-review.googlesource.com/c/sdk/+/117547
This gets rid of unnecessary allocations in hot loops with indexed loads and stores.
Issue: https://github.com/dart-lang/sdk/issues/38172
Change-Id: I37a4b1aba00084e465d47cce79bb9963e1afc104
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119645
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-11 15:54:01 +00:00
|
|
|
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_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_storeFloat, 3) \
|
|
|
|
V(Ffi_storeDouble, 3) \
|
|
|
|
V(Ffi_storePointer, 3) \
|
2019-02-13 12:42:47 +00:00
|
|
|
V(Ffi_address, 1) \
|
|
|
|
V(Ffi_fromAddress, 1) \
|
[VM/FFI] Adds FFI leaf calls.
This CL adds FFI leaf calls by adding `lookupFunction(.., isLeaf)`
and `_asFunctionInternal(.., isLeaf)`, which generate FFI leaf calls.
These calls skip a lot of the usual frame building and generated <->
native transition overhead.
`benchmark/FfiCall/` shows a 1.1x - 4.3x speed-up between the regular
FFI calls and their leaf call counterparts (JIT, x64, release).
TEST=Adds `tests/ffi{,_2}/vmspecific_leaf_call_test.dart`. Tested FFI tests.
Closes: https://github.com/dart-lang/sdk/issues/36707
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-release-arm64-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm64-try,vm-ffi-android-product-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-precomp-nnbd-mac-release-simarm64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Bug: https://github.com/dart-lang/sdk/issues/36707
Change-Id: Id8824f36b0006bf09951207bd004356fe6e9f46e
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179768
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-05-21 11:12:02 +00:00
|
|
|
V(Ffi_asFunctionInternal, 2) \
|
2019-09-18 14:56:27 +00:00
|
|
|
V(Ffi_nativeCallbackFunction, 2) \
|
|
|
|
V(Ffi_pointerFromFunction, 1) \
|
2019-02-13 12:42:47 +00:00
|
|
|
V(Ffi_dl_open, 1) \
|
|
|
|
V(Ffi_dl_lookup, 2) \
|
2019-06-06 19:49:07 +00:00
|
|
|
V(Ffi_dl_getHandle, 1) \
|
2021-06-02 16:01:43 +00:00
|
|
|
V(Ffi_dl_providesSymbol, 2) \
|
[vm/ffi] Optimize `Pointer<T>.asTypedList()`
This change refactors `_asExternalTypedData` into multiple functions,
which are data type specific, e.g `_asExternalTypedDataInt8`.
These functions are implemented as recognized methods.
Argument checks have previously been performed in the removed
runtime entry implementation of `_asExternalTypedData.` These are
now handled in Dart.
TEST=tests/ffi/external_typed_data_test.dart
Closes https://github.com/dart-lang/sdk/issues/39843
Closes https://github.com/dart-lang/sdk/pull/47780
https://github.com/dart-lang/sdk/pull/47780
GitOrigin-RevId: 65763bddd06c633583b4adbf920c32c5a7a3720f
Change-Id: I703b350d89004ebe36e70eaa44dda1d9ebb050c7
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,app-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221360
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-11-29 17:38:04 +00:00
|
|
|
V(Ffi_asExternalTypedDataInt8, 2) \
|
|
|
|
V(Ffi_asExternalTypedDataInt16, 2) \
|
|
|
|
V(Ffi_asExternalTypedDataInt32, 2) \
|
|
|
|
V(Ffi_asExternalTypedDataInt64, 2) \
|
|
|
|
V(Ffi_asExternalTypedDataUint8, 2) \
|
|
|
|
V(Ffi_asExternalTypedDataUint16, 2) \
|
|
|
|
V(Ffi_asExternalTypedDataUint32, 2) \
|
|
|
|
V(Ffi_asExternalTypedDataUint64, 2) \
|
|
|
|
V(Ffi_asExternalTypedDataFloat, 2) \
|
|
|
|
V(Ffi_asExternalTypedDataDouble, 2) \
|
2019-08-19 14:24:01 +00:00
|
|
|
V(Ffi_dl_processLibrary, 0) \
|
|
|
|
V(Ffi_dl_executableLibrary, 0) \
|
2021-06-15 05:58:39 +00:00
|
|
|
V(Ffi_GetFfiNativeResolver, 0) \
|
[vm/ffi] Expose a subset of dart_(native_)api.h for dynamic linking.
This CL introduces dart_api_dl.h which exposes a subset of dart_api.h
and dart_native_api.h for dynamic linking at runtime through the FFI.
Dynamic linking is done through including dart_api_dl.cc in a shared
library and passing NativeApi.initializeApiDLData to the init function.
This CL also includes Native API versioning to deal with possible
version skew between native api version against which native libraries
are compiled and the version in the DartVM the code is run on.
The subset of symbols in the CL includes handle related symbols, error
related symbols, handle scope symbols, and native port sumbols.
Design: http://go/dart-ffi-expose-dart-api
Closes: https://github.com/dart-lang/sdk/issues/40607
Closes: https://github.com/dart-lang/sdk/issues/36858
Closes: https://github.com/dart-lang/sdk/issues/41319
Closes: https://github.com/flutter/flutter/issues/46887
Closes: https://github.com/flutter/flutter/issues/47061
Misc:
Closes: https://github.com/dart-lang/sdk/issues/42260
Change-Id: I9e557808dbc99b341f23964cbddbb05f26d7a6c5
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145592
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-18 07:30:43 +00:00
|
|
|
V(DartApiDLInitializeData, 0) \
|
|
|
|
V(DartApiDLMajorVersion, 0) \
|
|
|
|
V(DartApiDLMinorVersion, 0) \
|
|
|
|
V(DartNativeApiFunctionPointer, 1) \
|
2019-06-06 19:49:07 +00:00
|
|
|
V(TransferableTypedData_factory, 2) \
|
2020-11-13 20:40:24 +00:00
|
|
|
V(TransferableTypedData_materialize, 1)
|
2016-02-22 17:55:20 +00:00
|
|
|
|
|
|
|
// List of bootstrap native entry points used in the dart:mirror library.
|
|
|
|
#define MIRRORS_BOOTSTRAP_NATIVE_LIST(V) \
|
2013-06-14 21:12:58 +00:00
|
|
|
V(Mirrors_makeLocalClassMirror, 1) \
|
2013-08-08 20:06:56 +00:00
|
|
|
V(Mirrors_makeLocalTypeMirror, 1) \
|
2017-01-10 14:53:21 +00:00
|
|
|
V(Mirrors_instantiateGenericType, 2) \
|
2013-10-11 20:56:14 +00:00
|
|
|
V(Mirrors_mangleName, 2) \
|
2013-08-01 16:40:10 +00:00
|
|
|
V(MirrorReference_equals, 2) \
|
2015-04-28 23:47:45 +00:00
|
|
|
V(MirrorSystem_libraries, 0) \
|
|
|
|
V(MirrorSystem_isolate, 0) \
|
2018-05-29 22:01:01 +00:00
|
|
|
V(IsolateMirror_loadUri, 1) \
|
2013-09-04 17:12:28 +00:00
|
|
|
V(InstanceMirror_invoke, 5) \
|
2013-07-15 21:14:43 +00:00
|
|
|
V(InstanceMirror_invokeGetter, 3) \
|
|
|
|
V(InstanceMirror_invokeSetter, 4) \
|
2013-10-04 22:08:55 +00:00
|
|
|
V(InstanceMirror_computeType, 1) \
|
2013-07-29 23:57:31 +00:00
|
|
|
V(ClosureMirror_function, 1) \
|
2014-02-11 20:41:32 +00:00
|
|
|
V(TypeMirror_subtypeTest, 2) \
|
2015-04-22 17:51:49 +00:00
|
|
|
V(ClassMirror_libraryUri, 1) \
|
2013-07-25 22:45:07 +00:00
|
|
|
V(ClassMirror_supertype, 1) \
|
2013-10-11 01:51:11 +00:00
|
|
|
V(ClassMirror_supertype_instantiated, 1) \
|
2013-07-30 00:29:52 +00:00
|
|
|
V(ClassMirror_interfaces, 1) \
|
2013-10-17 00:16:34 +00:00
|
|
|
V(ClassMirror_interfaces_instantiated, 1) \
|
2013-08-28 22:55:53 +00:00
|
|
|
V(ClassMirror_mixin, 1) \
|
2013-10-17 00:16:34 +00:00
|
|
|
V(ClassMirror_mixin_instantiated, 2) \
|
2015-04-08 21:40:51 +00:00
|
|
|
V(ClassMirror_members, 3) \
|
|
|
|
V(ClassMirror_constructors, 3) \
|
2013-07-24 23:51:15 +00:00
|
|
|
V(LibraryMirror_members, 2) \
|
2014-03-07 19:00:20 +00:00
|
|
|
V(LibraryMirror_libraryDependencies, 2) \
|
2013-09-04 17:12:28 +00:00
|
|
|
V(ClassMirror_invoke, 5) \
|
2013-07-15 21:14:43 +00:00
|
|
|
V(ClassMirror_invokeGetter, 3) \
|
|
|
|
V(ClassMirror_invokeSetter, 4) \
|
2013-09-12 00:48:16 +00:00
|
|
|
V(ClassMirror_invokeConstructor, 5) \
|
2013-07-30 22:57:59 +00:00
|
|
|
V(ClassMirror_type_variables, 1) \
|
2013-08-08 20:06:56 +00:00
|
|
|
V(ClassMirror_type_arguments, 1) \
|
2015-04-28 23:47:45 +00:00
|
|
|
V(LibraryMirror_fromPrefix, 1) \
|
2013-09-04 17:12:28 +00:00
|
|
|
V(LibraryMirror_invoke, 5) \
|
2013-07-15 21:14:43 +00:00
|
|
|
V(LibraryMirror_invokeGetter, 3) \
|
|
|
|
V(LibraryMirror_invokeSetter, 4) \
|
2013-08-08 20:06:56 +00:00
|
|
|
V(TypeVariableMirror_owner, 1) \
|
|
|
|
V(TypeVariableMirror_upper_bound, 1) \
|
2015-02-13 23:32:20 +00:00
|
|
|
V(DeclarationMirror_location, 1) \
|
2013-07-17 21:50:54 +00:00
|
|
|
V(DeclarationMirror_metadata, 1) \
|
2013-08-08 20:25:46 +00:00
|
|
|
V(FunctionTypeMirror_call_method, 2) \
|
2013-08-13 21:38:36 +00:00
|
|
|
V(FunctionTypeMirror_parameters, 2) \
|
2017-04-06 19:28:48 +00:00
|
|
|
V(FunctionTypeMirror_return_type, 1) \
|
2015-04-08 21:40:51 +00:00
|
|
|
V(MethodMirror_owner, 2) \
|
2013-08-13 21:38:36 +00:00
|
|
|
V(MethodMirror_parameters, 2) \
|
2013-11-08 17:54:59 +00:00
|
|
|
V(MethodMirror_return_type, 2) \
|
2013-08-26 17:14:07 +00:00
|
|
|
V(MethodMirror_source, 1) \
|
2013-11-08 17:54:59 +00:00
|
|
|
V(ParameterMirror_type, 3) \
|
2016-11-08 21:54:47 +00:00
|
|
|
V(VariableMirror_type, 2)
|
2011-10-05 05:20:07 +00:00
|
|
|
|
[vm] Implement `NativeFinalizer`
This CL implements `NativeFinalizer` in the GC.
`FinalizerEntry`s are extended to track `external_size` and in which
`Heap::Space` the finalizable value is.
On attaching a native finalizer, the external size is added to the
relevant heap. When the finalizable value is promoted from new to old
space, the external size is promoted as well. And when a native
finalizer is run or is detached, the external size is removed from the
relevant heap again.
In contrast to Dart `Finalizer`s, `NativeFinalizer`s are run on isolate
shutdown.
When the `NativeFinalizer`s themselves are collected, the finalizers are
not run. Users should stick the native finalizer in a global variable to
ensure finalization. We will revisit this design when we add send and
exit support, because there is a design space to explore what to do in
that case. This current solution promises the least to users.
In this implementation native finalizers have a Dart entry to clean up
the entries from the `all_entries` field of the finalizer. We should
consider using another data structure that avoids the need for this Dart
entry. See the TODO left in the code.
Bug: https://github.com/dart-lang/sdk/issues/47777
TEST=runtime/tests/vm/dart(_2)/isolates/fast_object_copy_test.dart
TEST=runtime/vm/object_test.cc
TEST=tests/ffi(_2)/vmspecific_native_finalizer_*
Change-Id: I8f594c80c3c344ad83e1f2de10de028eb8456121
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64c-try,dart-sdk-mac-arm64-try,vm-kernel-mac-release-arm64-try,pkg-mac-release-arm64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-nnbd-win-release-ia32-try,vm-ffi-android-debug-arm-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,benchmark-linux-try,flutter-frontend-try,pkg-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236320
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-03-26 09:41:21 +00:00
|
|
|
#define BOOTSTRAP_FFI_NATIVE_LIST(V) \
|
|
|
|
V(FinalizerEntry_SetExternalSize, void, (Dart_Handle, intptr_t))
|
|
|
|
|
2012-08-30 17:41:19 +00:00
|
|
|
class BootstrapNatives : public AllStatic {
|
|
|
|
public:
|
2013-12-19 17:47:56 +00:00
|
|
|
static Dart_NativeFunction Lookup(Dart_Handle name,
|
|
|
|
int argument_count,
|
|
|
|
bool* auto_setup_scope);
|
2012-08-30 17:41:19 +00:00
|
|
|
|
[vm] Implement `NativeFinalizer`
This CL implements `NativeFinalizer` in the GC.
`FinalizerEntry`s are extended to track `external_size` and in which
`Heap::Space` the finalizable value is.
On attaching a native finalizer, the external size is added to the
relevant heap. When the finalizable value is promoted from new to old
space, the external size is promoted as well. And when a native
finalizer is run or is detached, the external size is removed from the
relevant heap again.
In contrast to Dart `Finalizer`s, `NativeFinalizer`s are run on isolate
shutdown.
When the `NativeFinalizer`s themselves are collected, the finalizers are
not run. Users should stick the native finalizer in a global variable to
ensure finalization. We will revisit this design when we add send and
exit support, because there is a design space to explore what to do in
that case. This current solution promises the least to users.
In this implementation native finalizers have a Dart entry to clean up
the entries from the `all_entries` field of the finalizer. We should
consider using another data structure that avoids the need for this Dart
entry. See the TODO left in the code.
Bug: https://github.com/dart-lang/sdk/issues/47777
TEST=runtime/tests/vm/dart(_2)/isolates/fast_object_copy_test.dart
TEST=runtime/vm/object_test.cc
TEST=tests/ffi(_2)/vmspecific_native_finalizer_*
Change-Id: I8f594c80c3c344ad83e1f2de10de028eb8456121
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64c-try,dart-sdk-mac-arm64-try,vm-kernel-mac-release-arm64-try,pkg-mac-release-arm64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-nnbd-win-release-ia32-try,vm-ffi-android-debug-arm-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,benchmark-linux-try,flutter-frontend-try,pkg-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236320
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-03-26 09:41:21 +00:00
|
|
|
// For use with @FfiNative.
|
|
|
|
static void* LookupFfiNative(const char* name, uintptr_t argument_count);
|
|
|
|
|
2020-05-07 16:16:08 +00:00
|
|
|
static const uint8_t* Symbol(Dart_NativeFunction nf);
|
2014-04-10 20:26:45 +00:00
|
|
|
|
2012-08-31 18:06:42 +00:00
|
|
|
#define DECLARE_BOOTSTRAP_NATIVE(name, ignored) \
|
2020-04-25 05:21:27 +00:00
|
|
|
static ObjectPtr DN_##name(Thread* thread, Zone* zone, \
|
|
|
|
NativeArguments* arguments);
|
2012-08-30 17:41:19 +00:00
|
|
|
|
|
|
|
BOOTSTRAP_NATIVE_LIST(DECLARE_BOOTSTRAP_NATIVE)
|
2017-07-12 19:55:55 +00:00
|
|
|
#if !defined(DART_PRECOMPILED_RUNTIME)
|
2016-02-22 17:55:20 +00:00
|
|
|
MIRRORS_BOOTSTRAP_NATIVE_LIST(DECLARE_BOOTSTRAP_NATIVE)
|
|
|
|
#endif
|
2012-08-30 17:41:19 +00:00
|
|
|
#undef DECLARE_BOOTSTRAP_NATIVE
|
[vm] Implement `NativeFinalizer`
This CL implements `NativeFinalizer` in the GC.
`FinalizerEntry`s are extended to track `external_size` and in which
`Heap::Space` the finalizable value is.
On attaching a native finalizer, the external size is added to the
relevant heap. When the finalizable value is promoted from new to old
space, the external size is promoted as well. And when a native
finalizer is run or is detached, the external size is removed from the
relevant heap again.
In contrast to Dart `Finalizer`s, `NativeFinalizer`s are run on isolate
shutdown.
When the `NativeFinalizer`s themselves are collected, the finalizers are
not run. Users should stick the native finalizer in a global variable to
ensure finalization. We will revisit this design when we add send and
exit support, because there is a design space to explore what to do in
that case. This current solution promises the least to users.
In this implementation native finalizers have a Dart entry to clean up
the entries from the `all_entries` field of the finalizer. We should
consider using another data structure that avoids the need for this Dart
entry. See the TODO left in the code.
Bug: https://github.com/dart-lang/sdk/issues/47777
TEST=runtime/tests/vm/dart(_2)/isolates/fast_object_copy_test.dart
TEST=runtime/vm/object_test.cc
TEST=tests/ffi(_2)/vmspecific_native_finalizer_*
Change-Id: I8f594c80c3c344ad83e1f2de10de028eb8456121
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64c-try,dart-sdk-mac-arm64-try,vm-kernel-mac-release-arm64-try,pkg-mac-release-arm64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-nnbd-win-release-ia32-try,vm-ffi-android-debug-arm-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,benchmark-linux-try,flutter-frontend-try,pkg-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236320
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-03-26 09:41:21 +00:00
|
|
|
|
|
|
|
#define DECLARE_BOOTSTRAP_FFI_NATIVE(name, return_type, argument_types) \
|
|
|
|
static return_type FN_##name argument_types;
|
|
|
|
BOOTSTRAP_FFI_NATIVE_LIST(DECLARE_BOOTSTRAP_FFI_NATIVE)
|
|
|
|
#undef DECLARE_BOOTSTRAP_FFI_NATIVE
|
2012-08-30 17:41:19 +00:00
|
|
|
};
|
2011-10-05 05:20:07 +00:00
|
|
|
|
|
|
|
} // namespace dart
|
|
|
|
|
2016-10-26 07:26:03 +00:00
|
|
|
#endif // RUNTIME_VM_BOOTSTRAP_NATIVES_H_
|