diff --git a/pkg/front_end/tool/_fasta/entry_points.dart b/pkg/front_end/tool/_fasta/entry_points.dart index f9178e3d087..4fb21ccf5fe 100644 --- a/pkg/front_end/tool/_fasta/entry_points.dart +++ b/pkg/front_end/tool/_fasta/entry_points.dart @@ -18,7 +18,9 @@ import 'package:kernel/target/targets.dart' show Target, TargetFlags, getTarget; import 'package:kernel/type_environment.dart' show SubtypeTester; -import 'package:vm/bytecode/gen_bytecode.dart' show generateBytecode; +import 'package:vm/bytecode/gen_bytecode.dart' + show createFreshComponentWithBytecode, generateBytecode; + import 'package:vm/bytecode/options.dart' show BytecodeOptions; import 'package:front_end/src/api_prototype/compiler_options.dart' @@ -330,16 +332,18 @@ Future compilePlatformInternal(CompilerContext c, Uri fullOutput, new File.fromUri(outlineOutput).writeAsBytesSync(result.summary); c.options.ticker.logMs("Wrote outline to ${outlineOutput.toFilePath()}"); + Component component = result.component; if (c.options.bytecode) { - generateBytecode(result.component, + generateBytecode(component, options: new BytecodeOptions( enableAsserts: true, emitSourceFiles: true, emitSourcePositions: true, environmentDefines: c.options.environmentDefines)); + component = createFreshComponentWithBytecode(component); } - await writeComponentToFile(result.component, fullOutput, + await writeComponentToFile(component, fullOutput, filter: (lib) => !lib.isExternal); c.options.ticker.logMs("Wrote component to ${fullOutput.toFilePath()}"); diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn index 5850a9720de..92233277fc7 100644 --- a/runtime/vm/BUILD.gn +++ b/runtime/vm/BUILD.gn @@ -140,14 +140,13 @@ template("gen_vm_platform") { "-Ddart.developer.causal_async_stacks=$allow_causal_async_stacks", "-Ddart.isVM=true", ] - if (defined(invoker.exclude_source) && invoker.exclude_source) { args += [ "--exclude-source" ] } - outline = "vm_outline" + output_postfix + ".dill" - if (dart_platform_bytecode) { + if (defined(invoker.bytecode) && invoker.bytecode) { args += [ "--bytecode" ] } + outline = "vm_outline" + output_postfix + ".dill" } } @@ -161,6 +160,10 @@ gen_vm_platform("vm_platform_stripped") { add_implicit_vm_platform_dependency = false exclude_source = true output_postfix = "_strong_stripped" + + if (dart_platform_bytecode) { + bytecode = true + } } group("kernel_platform_files") {