Remove compilation trace saving. (flutter/engine#26642)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,6 @@ namespace flutter {
|
||||
#define BUILTIN_NATIVE_LIST(V) \
|
||||
V(Logger_PrintString, 1) \
|
||||
V(Logger_PrintDebugString, 1) \
|
||||
V(SaveCompilationTrace, 0) \
|
||||
V(ScheduleMicrotask, 1) \
|
||||
V(GetCallbackHandle, 1) \
|
||||
V(GetCallbackFromHandle, 1)
|
||||
@@ -202,35 +201,6 @@ void Logger_PrintString(Dart_NativeArguments args) {
|
||||
}
|
||||
}
|
||||
|
||||
void SaveCompilationTrace(Dart_NativeArguments args) {
|
||||
uint8_t* buffer = nullptr;
|
||||
intptr_t length = 0;
|
||||
Dart_Handle result = Dart_SaveCompilationTrace(&buffer, &length);
|
||||
if (Dart_IsError(result)) {
|
||||
Dart_SetReturnValue(args, result);
|
||||
return;
|
||||
}
|
||||
|
||||
result = Dart_NewTypedData(Dart_TypedData_kUint8, length);
|
||||
if (Dart_IsError(result)) {
|
||||
Dart_SetReturnValue(args, result);
|
||||
return;
|
||||
}
|
||||
|
||||
Dart_TypedData_Type type;
|
||||
void* data = nullptr;
|
||||
intptr_t size = 0;
|
||||
Dart_Handle status = Dart_TypedDataAcquireData(result, &type, &data, &size);
|
||||
if (Dart_IsError(status)) {
|
||||
Dart_SetReturnValue(args, status);
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(data, buffer, length);
|
||||
Dart_TypedDataReleaseData(result);
|
||||
Dart_SetReturnValue(args, result);
|
||||
}
|
||||
|
||||
void ScheduleMicrotask(Dart_NativeArguments args) {
|
||||
Dart_Handle closure = Dart_GetNativeArgument(args, 0);
|
||||
UIDartState::Current()->ScheduleMicrotask(closure);
|
||||
|
||||
@@ -70,14 +70,9 @@ void _setupHooks() { // ignore: unused_element
|
||||
///
|
||||
/// This function is only effective in debug and dynamic modes, and will throw in AOT mode.
|
||||
List<int> saveCompilationTrace() {
|
||||
final dynamic result = _saveCompilationTrace();
|
||||
if (result is Error)
|
||||
throw result;
|
||||
return result as List<int>;
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
dynamic _saveCompilationTrace() native 'SaveCompilationTrace';
|
||||
|
||||
void _scheduleMicrotask(void Function() callback) native 'ScheduleMicrotask';
|
||||
|
||||
int? _getCallbackHandle(Function closure) native 'GetCallbackHandle';
|
||||
|
||||
@@ -270,37 +270,6 @@ TEST_F(DartIsolateTest, CanRegisterNativeCallback) {
|
||||
Wait();
|
||||
}
|
||||
|
||||
TEST_F(DartIsolateTest, CanSaveCompilationTrace) {
|
||||
if (DartVM::IsRunningPrecompiledCode()) {
|
||||
// Can only save compilation traces in JIT modes.
|
||||
GTEST_SKIP();
|
||||
return;
|
||||
}
|
||||
AddNativeCallback("NotifyNative",
|
||||
CREATE_NATIVE_ENTRY(([this](Dart_NativeArguments args) {
|
||||
ASSERT_TRUE(tonic::DartConverter<bool>::FromDart(
|
||||
Dart_GetNativeArgument(args, 0)));
|
||||
Signal();
|
||||
})));
|
||||
|
||||
const auto settings = CreateSettingsForFixture();
|
||||
auto vm_ref = DartVMRef::Create(settings);
|
||||
auto thread = CreateNewThread();
|
||||
TaskRunners task_runners(GetCurrentTestName(), //
|
||||
thread, //
|
||||
thread, //
|
||||
thread, //
|
||||
thread //
|
||||
);
|
||||
auto isolate = RunDartCodeInIsolate(vm_ref, settings, task_runners,
|
||||
"testCanSaveCompilationTrace", {},
|
||||
GetDefaultKernelFilePath());
|
||||
ASSERT_TRUE(isolate);
|
||||
ASSERT_EQ(isolate->get()->GetPhase(), DartIsolate::Phase::Running);
|
||||
|
||||
Wait();
|
||||
}
|
||||
|
||||
class DartSecondaryIsolateTest : public FixtureTest {
|
||||
public:
|
||||
DartSecondaryIsolateTest() : latch_(3) {}
|
||||
|
||||
@@ -51,11 +51,6 @@ void notifyNative() native 'NotifyNative';
|
||||
@pragma('vm:entry-point')
|
||||
void testIsolateShutdown() { }
|
||||
|
||||
@pragma('vm:entry-point')
|
||||
void testCanSaveCompilationTrace() {
|
||||
notifyResult(saveCompilationTrace().isNotEmpty);
|
||||
}
|
||||
|
||||
void notifyResult(bool success) native 'NotifyNative';
|
||||
void passMessage(String message) native 'PassMessage';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user