mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 23:51:47 +00:00
Revert "[vm] Adds a benchmark for Dart_LoadLibraryFromKernel"
This reverts commit fee8efa3d6
.
Reason for revert: Breaks many VM bots.
Original change's description:
> [vm] Adds a benchmark for Dart_LoadLibraryFromKernel
>
> Change-Id: I71c9d6a1cd9d07f554bbeb02c682de2c771ddb3e
> Reviewed-on: https://dart-review.googlesource.com/75787
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
TBR=alexmarkov@google.com,zra@google.com,asiva@google.com
Change-Id: If8c3f3aca36f1a65c57592961e7adc449c4c7e78
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/75860
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
This commit is contained in:
parent
762a14e139
commit
82c784a60f
|
@ -1121,43 +1121,6 @@ action("generate_snapshot_test_dat_file") {
|
|||
]
|
||||
}
|
||||
|
||||
prebuilt_dart_action("gen_kernel_bytecode_dill") {
|
||||
if (target_os == "fuchsia") {
|
||||
testonly = true
|
||||
}
|
||||
|
||||
deps = [
|
||||
"../vm:vm_platform",
|
||||
]
|
||||
platform_dill = "$root_out_dir/vm_platform_strong.dill"
|
||||
|
||||
output = "$root_out_dir/gen_kernel_bytecode.dill"
|
||||
outputs = [
|
||||
output,
|
||||
]
|
||||
|
||||
script = "../../pkg/vm/bin/gen_kernel.dart"
|
||||
|
||||
depfile = "$target_gen_dir/gen_kernel_bytecode.dill.d"
|
||||
abs_depfile = rebase_path(depfile)
|
||||
rebased_output = rebase_path(output, root_out_dir)
|
||||
vm_args = [
|
||||
"--depfile=$abs_depfile",
|
||||
"--depfile_output_filename=$rebased_output",
|
||||
]
|
||||
|
||||
args = [
|
||||
"--gen-bytecode",
|
||||
"--no-embed-sources",
|
||||
"--drop-ast",
|
||||
"--platform",
|
||||
rebase_path(platform_dill),
|
||||
"--output",
|
||||
rebase_path(output),
|
||||
rebase_path(script),
|
||||
]
|
||||
}
|
||||
|
||||
executable("run_vm_tests") {
|
||||
if (target_os == "fuchsia") {
|
||||
testonly = true
|
||||
|
@ -1176,7 +1139,6 @@ executable("run_vm_tests") {
|
|||
deps = [
|
||||
":dart_kernel_platform_cc",
|
||||
":dart_snapshot_cc",
|
||||
":gen_kernel_bytecode_dill",
|
||||
":generate_snapshot_test_dat_file",
|
||||
":libdart_builtin",
|
||||
":standalone_dart_io",
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "bin/file.h"
|
||||
#include "bin/isolate_data.h"
|
||||
#include "bin/process.h"
|
||||
#include "bin/reference_counting.h"
|
||||
|
||||
#include "platform/assert.h"
|
||||
#include "platform/globals.h"
|
||||
|
@ -178,60 +177,6 @@ BENCHMARK(Dart2JSCompilerStats) {
|
|||
free(script);
|
||||
}
|
||||
|
||||
// This file is created by the target //runtime/bin:gen_kernel_bytecode_dill
|
||||
// which is depended on by run_vm_tests.
|
||||
static char* ComputeGenKernelKernelPath(const char* arg) {
|
||||
char buffer[2048];
|
||||
char* gen_kernel_path = strdup(File::GetCanonicalPath(NULL, arg));
|
||||
EXPECT(gen_kernel_path != NULL);
|
||||
const char* compiler_path = "%s%sgen_kernel_bytecode.dill";
|
||||
const char* path_separator = File::PathSeparator();
|
||||
ASSERT(path_separator != NULL && strlen(path_separator) == 1);
|
||||
char* ptr = strrchr(gen_kernel_path, *path_separator);
|
||||
while (ptr != NULL) {
|
||||
*ptr = '\0';
|
||||
Utils::SNPrint(buffer, ARRAY_SIZE(buffer), compiler_path, gen_kernel_path,
|
||||
path_separator);
|
||||
if (File::Exists(NULL, buffer)) {
|
||||
break;
|
||||
}
|
||||
ptr = strrchr(gen_kernel_path, *path_separator);
|
||||
}
|
||||
free(gen_kernel_path);
|
||||
if (ptr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return strdup(buffer);
|
||||
}
|
||||
|
||||
BENCHMARK(GenKernelKernelLoadKernel) {
|
||||
char* dill_path = ComputeGenKernelKernelPath(Benchmark::Executable());
|
||||
fprintf(stderr, "dill_path = '%s'\n", dill_path);
|
||||
File* file = File::Open(NULL, dill_path, File::kRead);
|
||||
EXPECT(file != NULL);
|
||||
bin::RefCntReleaseScope<File> rs(file);
|
||||
intptr_t kernel_buffer_size = file->Length();
|
||||
uint8_t* kernel_buffer =
|
||||
reinterpret_cast<uint8_t*>(malloc(kernel_buffer_size));
|
||||
EXPECT(kernel_buffer != NULL);
|
||||
bool read_fully = file->ReadFully(kernel_buffer, kernel_buffer_size);
|
||||
EXPECT(read_fully);
|
||||
|
||||
Timer timer(true, "GenKernelKernelLoadKernel benchmark");
|
||||
timer.Start();
|
||||
|
||||
Dart_Handle result =
|
||||
Dart_LoadLibraryFromKernel(kernel_buffer, kernel_buffer_size);
|
||||
EXPECT_VALID(result);
|
||||
|
||||
result = Dart_FinalizeLoading(false);
|
||||
EXPECT_VALID(result);
|
||||
|
||||
timer.Stop();
|
||||
int64_t elapsed_time = timer.TotalElapsedTime();
|
||||
benchmark->set_score(elapsed_time);
|
||||
}
|
||||
|
||||
#endif // !PRODUCT
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue