diff --git a/runtime/vm/compiler/aot/aot_call_specializer.h b/runtime/vm/compiler/aot/aot_call_specializer.h index 44ea0c2fa6f..a14acd2dbf9 100644 --- a/runtime/vm/compiler/aot/aot_call_specializer.h +++ b/runtime/vm/compiler/aot/aot_call_specializer.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_AOT_AOT_CALL_SPECIALIZER_H_ #define RUNTIME_VM_COMPILER_AOT_AOT_CALL_SPECIALIZER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/call_specializer.h" namespace dart { diff --git a/runtime/vm/compiler/aot/dispatch_table_generator.h b/runtime/vm/compiler/aot/dispatch_table_generator.h index 830e12270e4..f9876069e87 100644 --- a/runtime/vm/compiler/aot/dispatch_table_generator.h +++ b/runtime/vm/compiler/aot/dispatch_table_generator.h @@ -5,11 +5,13 @@ #ifndef RUNTIME_VM_COMPILER_AOT_DISPATCH_TABLE_GENERATOR_H_ #define RUNTIME_VM_COMPILER_AOT_DISPATCH_TABLE_GENERATOR_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/frontend/kernel_translation_helper.h" #include "vm/object.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { class ClassTable; @@ -109,6 +111,4 @@ class DispatchTableGenerator { } // namespace compiler } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) - #endif // RUNTIME_VM_COMPILER_AOT_DISPATCH_TABLE_GENERATOR_H_ diff --git a/runtime/vm/compiler/aot/precompiler.cc b/runtime/vm/compiler/aot/precompiler.cc index 08543250300..836ae49a07f 100644 --- a/runtime/vm/compiler/aot/precompiler.cc +++ b/runtime/vm/compiler/aot/precompiler.cc @@ -4,8 +4,6 @@ #include "vm/compiler/aot/precompiler.h" -#ifndef DART_PRECOMPILED_RUNTIME - #include "platform/unicode.h" #include "vm/class_finalizer.h" #include "vm/code_patcher.h" @@ -3127,5 +3125,3 @@ const char** Obfuscator::SerializeMap(Thread* thread) { #endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32) } // namespace dart - -#endif // DART_PRECOMPILED_RUNTIME diff --git a/runtime/vm/compiler/aot/precompiler.h b/runtime/vm/compiler/aot/precompiler.h index 8de467a4331..24d8c8ca148 100644 --- a/runtime/vm/compiler/aot/precompiler.h +++ b/runtime/vm/compiler/aot/precompiler.h @@ -5,7 +5,9 @@ #ifndef RUNTIME_VM_COMPILER_AOT_PRECOMPILER_H_ #define RUNTIME_VM_COMPILER_AOT_PRECOMPILER_H_ -#ifndef DART_PRECOMPILED_RUNTIME +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) #include "vm/allocation.h" #include "vm/compiler/aot/dispatch_table_generator.h" @@ -563,6 +565,4 @@ class Obfuscator { } // namespace dart -#endif // DART_PRECOMPILED_RUNTIME - #endif // RUNTIME_VM_COMPILER_AOT_PRECOMPILER_H_ diff --git a/runtime/vm/compiler/asm_intrinsifier.cc b/runtime/vm/compiler/asm_intrinsifier.cc index 0886fe4c187..3e3957fa930 100644 --- a/runtime/vm/compiler/asm_intrinsifier.cc +++ b/runtime/vm/compiler/asm_intrinsifier.cc @@ -2,9 +2,6 @@ // 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. // Class for intrinsifying functions. - -#if !defined(DART_PRECOMPILED_RUNTIME) - #define SHOULD_NOT_INCLUDE_RUNTIME #include "vm/compiler/asm_intrinsifier.h" @@ -36,5 +33,3 @@ void AsmIntrinsifier::RegExp_ExecuteMatchSticky(Assembler* assembler, } // namespace compiler } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/asm_intrinsifier.h b/runtime/vm/compiler/asm_intrinsifier.h index 59b3f63f67e..01fd20d422e 100644 --- a/runtime/vm/compiler/asm_intrinsifier.h +++ b/runtime/vm/compiler/asm_intrinsifier.h @@ -6,6 +6,10 @@ #ifndef RUNTIME_VM_COMPILER_ASM_INTRINSIFIER_H_ #define RUNTIME_VM_COMPILER_ASM_INTRINSIFIER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" #include "vm/compiler/recognized_methods_list.h" diff --git a/runtime/vm/compiler/asm_intrinsifier_arm.cc b/runtime/vm/compiler/asm_intrinsifier_arm.cc index 6fe378e917a..b6cc494af67 100644 --- a/runtime/vm/compiler/asm_intrinsifier_arm.cc +++ b/runtime/vm/compiler/asm_intrinsifier_arm.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. -#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM) #define SHOULD_NOT_INCLUDE_RUNTIME @@ -2345,4 +2345,4 @@ void AsmIntrinsifier::SetAsyncThreadStackTrace(Assembler* assembler, } // namespace compiler } // namespace dart -#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM) diff --git a/runtime/vm/compiler/asm_intrinsifier_arm64.cc b/runtime/vm/compiler/asm_intrinsifier_arm64.cc index db838eede59..92e75c3ca52 100644 --- a/runtime/vm/compiler/asm_intrinsifier_arm64.cc +++ b/runtime/vm/compiler/asm_intrinsifier_arm64.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. -#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM64) #define SHOULD_NOT_INCLUDE_RUNTIME @@ -2418,4 +2418,4 @@ void AsmIntrinsifier::SetAsyncThreadStackTrace(Assembler* assembler, } // namespace compiler } // namespace dart -#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM64) diff --git a/runtime/vm/compiler/asm_intrinsifier_ia32.cc b/runtime/vm/compiler/asm_intrinsifier_ia32.cc index c4fb55ba706..baafb48856d 100644 --- a/runtime/vm/compiler/asm_intrinsifier_ia32.cc +++ b/runtime/vm/compiler/asm_intrinsifier_ia32.cc @@ -9,7 +9,7 @@ // Dart method was intrinsified. #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. -#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_IA32) #define SHOULD_NOT_INCLUDE_RUNTIME @@ -2355,4 +2355,4 @@ void AsmIntrinsifier::SetAsyncThreadStackTrace(Assembler* assembler, } // namespace compiler } // namespace dart -#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_IA32) diff --git a/runtime/vm/compiler/asm_intrinsifier_x64.cc b/runtime/vm/compiler/asm_intrinsifier_x64.cc index 09b3e10d5b7..5f92afb9d7d 100644 --- a/runtime/vm/compiler/asm_intrinsifier_x64.cc +++ b/runtime/vm/compiler/asm_intrinsifier_x64.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. -#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_X64) #define SHOULD_NOT_INCLUDE_RUNTIME @@ -2386,4 +2386,4 @@ void AsmIntrinsifier::SetAsyncThreadStackTrace(Assembler* assembler, } // namespace compiler } // namespace dart -#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_X64) diff --git a/runtime/vm/compiler/assembler/assembler.h b/runtime/vm/compiler/assembler/assembler.h index f702109a04f..336640a2bdb 100644 --- a/runtime/vm/compiler/assembler/assembler.h +++ b/runtime/vm/compiler/assembler/assembler.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_ #define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "platform/assert.h" #include "vm/allocation.h" #include "vm/compiler/assembler/object_pool_builder.h" diff --git a/runtime/vm/compiler/assembler/assembler_arm.cc b/runtime/vm/compiler/assembler/assembler_arm.cc index 9c0caf91019..d250053ebbc 100644 --- a/runtime/vm/compiler/assembler/assembler_arm.cc +++ b/runtime/vm/compiler/assembler/assembler_arm.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // NOLINT -#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM) #define SHOULD_NOT_INCLUDE_RUNTIME @@ -3806,4 +3806,4 @@ void Assembler::StoreWordUnaligned(Register src, Register addr, Register tmp) { } // namespace compiler } // namespace dart -#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM) diff --git a/runtime/vm/compiler/assembler/assembler_arm.h b/runtime/vm/compiler/assembler/assembler_arm.h index 81ed9f612c6..f7ce00f477b 100644 --- a/runtime/vm/compiler/assembler/assembler_arm.h +++ b/runtime/vm/compiler/assembler/assembler_arm.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_ARM_H_ #define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_ARM_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_ #error Do not include assembler_arm.h directly; use assembler.h instead. #endif diff --git a/runtime/vm/compiler/assembler/assembler_arm64.cc b/runtime/vm/compiler/assembler/assembler_arm64.cc index 422ba5a8f64..169f476eec2 100644 --- a/runtime/vm/compiler/assembler/assembler_arm64.cc +++ b/runtime/vm/compiler/assembler/assembler_arm64.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // NOLINT -#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM64) #define SHOULD_NOT_INCLUDE_RUNTIME @@ -1985,4 +1985,4 @@ void Assembler::GenerateXCbzTbz(Register rn, Condition cond, Label* label) { } // namespace dart -#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM64) diff --git a/runtime/vm/compiler/assembler/assembler_arm64.h b/runtime/vm/compiler/assembler/assembler_arm64.h index 071bb36912f..d2b5e2876ff 100644 --- a/runtime/vm/compiler/assembler/assembler_arm64.h +++ b/runtime/vm/compiler/assembler/assembler_arm64.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_ARM64_H_ #define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_ARM64_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_ #error Do not include assembler_arm64.h directly; use assembler.h instead. #endif diff --git a/runtime/vm/compiler/assembler/assembler_base.cc b/runtime/vm/compiler/assembler/assembler_base.cc index 7ad426d6cbf..9f00096f04d 100644 --- a/runtime/vm/compiler/assembler/assembler_base.cc +++ b/runtime/vm/compiler/assembler/assembler_base.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/assembler/assembler_base.h" #include "platform/utils.h" @@ -389,5 +387,3 @@ bool ObjectPoolBuilder::TryCommitToParent() { } // namespace compiler } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/assembler/assembler_base.h b/runtime/vm/compiler/assembler/assembler_base.h index 11f587c2da7..419ec7d1ea6 100644 --- a/runtime/vm/compiler/assembler/assembler_base.h +++ b/runtime/vm/compiler/assembler/assembler_base.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_BASE_H_ #define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_BASE_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "platform/assert.h" #include "vm/allocation.h" #include "vm/compiler/assembler/object_pool_builder.h" diff --git a/runtime/vm/compiler/assembler/assembler_ia32.cc b/runtime/vm/compiler/assembler/assembler_ia32.cc index 74d33169400..b2e91a537e1 100644 --- a/runtime/vm/compiler/assembler/assembler_ia32.cc +++ b/runtime/vm/compiler/assembler/assembler_ia32.cc @@ -14,15 +14,11 @@ namespace dart { -#if !defined(DART_PRECOMPILED_RUNTIME) DECLARE_FLAG(bool, inline_alloc); DECLARE_FLAG(bool, use_slow_path); -#endif namespace compiler { -#if !defined(DART_PRECOMPILED_RUNTIME) - class DirectCallRelocation : public AssemblerFixup { public: void Process(const MemoryRegion& region, intptr_t position) { @@ -2795,8 +2791,6 @@ Address Assembler::ElementAddressForRegIndex(bool is_external, } } -#endif // !defined(DART_PRECOMPILED_RUNTIME) - } // namespace compiler } // namespace dart diff --git a/runtime/vm/compiler/assembler/assembler_ia32.h b/runtime/vm/compiler/assembler/assembler_ia32.h index 286b6f935e4..b4875483a92 100644 --- a/runtime/vm/compiler/assembler/assembler_ia32.h +++ b/runtime/vm/compiler/assembler/assembler_ia32.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_IA32_H_ #define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_IA32_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_ #error Do not include assembler_ia32.h directly; use assembler.h instead. #endif diff --git a/runtime/vm/compiler/assembler/assembler_x64.cc b/runtime/vm/compiler/assembler/assembler_x64.cc index 60802f9263b..68248ff0946 100644 --- a/runtime/vm/compiler/assembler/assembler_x64.cc +++ b/runtime/vm/compiler/assembler/assembler_x64.cc @@ -14,17 +14,13 @@ namespace dart { -#if !defined(DART_PRECOMPILED_RUNTIME) DECLARE_FLAG(bool, check_code_pointer); DECLARE_FLAG(bool, inline_alloc); DECLARE_FLAG(bool, precompiled_mode); DECLARE_FLAG(bool, use_slow_path); -#endif namespace compiler { -#if !defined(DART_PRECOMPILED_RUNTIME) - Assembler::Assembler(ObjectPoolBuilder* object_pool_builder, bool use_far_branches) : AssemblerBase(object_pool_builder), constant_pool_allowed_(false) { @@ -2300,8 +2296,6 @@ Address Assembler::ElementAddressForRegIndex(bool is_external, } } -#endif // !defined(DART_PRECOMPILED_RUNTIME) - } // namespace compiler } // namespace dart diff --git a/runtime/vm/compiler/assembler/assembler_x64.h b/runtime/vm/compiler/assembler/assembler_x64.h index 42a17d8cb7d..e39a7f23972 100644 --- a/runtime/vm/compiler/assembler/assembler_x64.h +++ b/runtime/vm/compiler/assembler/assembler_x64.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_X64_H_ #define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_X64_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_ #error Do not include assembler_x64.h directly; use assembler.h instead. #endif diff --git a/runtime/vm/compiler/backend/block_builder.h b/runtime/vm/compiler/backend/block_builder.h index afca0e82cbc..7cf8b86f81a 100644 --- a/runtime/vm/compiler/backend/block_builder.h +++ b/runtime/vm/compiler/backend/block_builder.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_BLOCK_BUILDER_H_ #define RUNTIME_VM_COMPILER_BACKEND_BLOCK_BUILDER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/flow_graph.h" #include "vm/compiler/backend/il.h" diff --git a/runtime/vm/compiler/backend/block_scheduler.cc b/runtime/vm/compiler/backend/block_scheduler.cc index 0d8472593b8..9807a19b6c4 100644 --- a/runtime/vm/compiler/backend/block_scheduler.cc +++ b/runtime/vm/compiler/backend/block_scheduler.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/block_scheduler.h" #include "vm/allocation.h" @@ -304,5 +302,3 @@ void BlockScheduler::ReorderBlocksAOT(FlowGraph* flow_graph) { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/block_scheduler.h b/runtime/vm/compiler/backend/block_scheduler.h index 4bcdf1516f7..305cbf34091 100644 --- a/runtime/vm/compiler/backend/block_scheduler.h +++ b/runtime/vm/compiler/backend/block_scheduler.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_BLOCK_SCHEDULER_H_ #define RUNTIME_VM_COMPILER_BACKEND_BLOCK_SCHEDULER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" namespace dart { diff --git a/runtime/vm/compiler/backend/branch_optimizer.cc b/runtime/vm/compiler/backend/branch_optimizer.cc index 1f9e9f3d6f8..3c586358a76 100644 --- a/runtime/vm/compiler/backend/branch_optimizer.cc +++ b/runtime/vm/compiler/backend/branch_optimizer.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/branch_optimizer.h" #include "vm/compiler/backend/flow_graph.h" @@ -349,5 +347,3 @@ void IfConverter::Simplify(FlowGraph* flow_graph) { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/branch_optimizer.h b/runtime/vm/compiler/backend/branch_optimizer.h index 8d8136ddebe..ca91b164f4f 100644 --- a/runtime/vm/compiler/backend/branch_optimizer.h +++ b/runtime/vm/compiler/backend/branch_optimizer.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_BRANCH_OPTIMIZER_H_ #define RUNTIME_VM_COMPILER_BACKEND_BRANCH_OPTIMIZER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" namespace dart { diff --git a/runtime/vm/compiler/backend/code_statistics.h b/runtime/vm/compiler/backend/code_statistics.h index cfc4cd95ebc..75d3274035b 100644 --- a/runtime/vm/compiler/backend/code_statistics.h +++ b/runtime/vm/compiler/backend/code_statistics.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_CODE_STATISTICS_H_ #define RUNTIME_VM_COMPILER_BACKEND_CODE_STATISTICS_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/assembler/assembler.h" #include "vm/compiler/backend/il.h" #include "vm/object.h" diff --git a/runtime/vm/compiler/backend/compile_type.h b/runtime/vm/compiler/backend/compile_type.h index d6477b108b8..f72eb5239ff 100644 --- a/runtime/vm/compiler/backend/compile_type.h +++ b/runtime/vm/compiler/backend/compile_type.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_COMPILE_TYPE_H_ #define RUNTIME_VM_COMPILER_BACKEND_COMPILE_TYPE_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" #include "vm/class_id.h" #include "vm/compiler/runtime_api.h" diff --git a/runtime/vm/compiler/backend/constant_propagator.cc b/runtime/vm/compiler/backend/constant_propagator.cc index 42382a8ca16..77c9acadc41 100644 --- a/runtime/vm/compiler/backend/constant_propagator.cc +++ b/runtime/vm/compiler/backend/constant_propagator.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/constant_propagator.h" #include "vm/bit_vector.h" @@ -1627,5 +1625,3 @@ bool ConstantPropagator::TransformDefinition(Definition* defn) { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/constant_propagator.h b/runtime/vm/compiler/backend/constant_propagator.h index eda356bba78..a5b939ae793 100644 --- a/runtime/vm/compiler/backend/constant_propagator.h +++ b/runtime/vm/compiler/backend/constant_propagator.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_CONSTANT_PROPAGATOR_H_ #define RUNTIME_VM_COMPILER_BACKEND_CONSTANT_PROPAGATOR_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/flow_graph.h" #include "vm/compiler/backend/il.h" diff --git a/runtime/vm/compiler/backend/evaluator.cc b/runtime/vm/compiler/backend/evaluator.cc index f6adab3aa38..e61c9d7b820 100644 --- a/runtime/vm/compiler/backend/evaluator.cc +++ b/runtime/vm/compiler/backend/evaluator.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/evaluator.h" namespace dart { @@ -237,5 +235,3 @@ bool Evaluator::ToIntegerConstant(Value* value, int64_t* result) { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/evaluator.h b/runtime/vm/compiler/backend/evaluator.h index 8c8e814585b..13590f9c563 100644 --- a/runtime/vm/compiler/backend/evaluator.h +++ b/runtime/vm/compiler/backend/evaluator.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_EVALUATOR_H_ #define RUNTIME_VM_COMPILER_BACKEND_EVALUATOR_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" #include "vm/compiler/backend/flow_graph.h" #include "vm/compiler/backend/il.h" diff --git a/runtime/vm/compiler/backend/flow_graph.cc b/runtime/vm/compiler/backend/flow_graph.cc index 5cde5851967..2ad41c62669 100644 --- a/runtime/vm/compiler/backend/flow_graph.cc +++ b/runtime/vm/compiler/backend/flow_graph.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/flow_graph.h" #include "vm/bit_vector.h" @@ -2703,5 +2701,3 @@ void FlowGraph::InsertPushArguments() { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/flow_graph.h b/runtime/vm/compiler/backend/flow_graph.h index 03a2239e2b3..67c1fedcee3 100644 --- a/runtime/vm/compiler/backend/flow_graph.h +++ b/runtime/vm/compiler/backend/flow_graph.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_H_ #define RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/bit_vector.h" #include "vm/compiler/backend/il.h" #include "vm/growable_array.h" @@ -156,11 +160,10 @@ class FlowGraph : public ZoneAllocated { } intptr_t CurrentContextEnvIndex() const { -#if !defined(DART_PRECOMPILED_RUNTIME) if (function().HasBytecode()) { return -1; } -#endif // !defined(DART_PRECOMPILED_RUNTIME) + return EnvIndex(parsed_function().current_context_var()); } diff --git a/runtime/vm/compiler/backend/flow_graph_checker.cc b/runtime/vm/compiler/backend/flow_graph_checker.cc index 7814dd13cce..5b753ce0f61 100644 --- a/runtime/vm/compiler/backend/flow_graph_checker.cc +++ b/runtime/vm/compiler/backend/flow_graph_checker.cc @@ -2,7 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) #if defined(DEBUG) #include "vm/compiler/backend/flow_graph_checker.h" @@ -474,4 +473,3 @@ void FlowGraphChecker::Check(const char* pass_name) { } // namespace dart #endif // defined(DEBUG) -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/flow_graph_checker.h b/runtime/vm/compiler/backend/flow_graph_checker.h index c86fab8b179..0079d9841f8 100644 --- a/runtime/vm/compiler/backend/flow_graph_checker.h +++ b/runtime/vm/compiler/backend/flow_graph_checker.h @@ -5,7 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_CHECKER_H_ #define RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_CHECKER_H_ -#if !defined(DART_PRECOMPILED_RUNTIME) +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #if defined(DEBUG) #include "vm/compiler/backend/flow_graph.h" @@ -69,6 +72,5 @@ class FlowGraphChecker : public FlowGraphVisitor { } // namespace dart #endif // defined(DEBUG) -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_CHECKER_H_ diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.cc b/runtime/vm/compiler/backend/flow_graph_compiler.cc index f9f22baac7b..fafcb9771ad 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler.cc +++ b/runtime/vm/compiler/backend/flow_graph_compiler.cc @@ -44,8 +44,6 @@ DEFINE_FLAG(bool, DEFINE_FLAG(bool, enable_peephole, true, "Enable peephole optimization"); -#if !defined(DART_PRECOMPILED_RUNTIME) - DEFINE_FLAG(bool, enable_simd_inline, true, @@ -2788,6 +2786,5 @@ void FlowGraphCompiler::EmitMoveConst(const compiler::ffi::NativeLocation& dst, } #undef __ -#endif // !defined(DART_PRECOMPILED_RUNTIME) } // namespace dart diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.h b/runtime/vm/compiler/backend/flow_graph_compiler.h index 0097fcddd40..836f5b7c8c3 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler.h +++ b/runtime/vm/compiler/backend/flow_graph_compiler.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_COMPILER_H_ #define RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_COMPILER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include #include "vm/allocation.h" diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc index 2d5388c1eff..2f8ff0bb489 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc +++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. -#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM) #include "vm/compiler/backend/flow_graph_compiler.h" @@ -1871,4 +1871,4 @@ void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { } // namespace dart -#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM) diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc index 051740fb202..9a3b745e0d7 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc +++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. -#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM64) #include "vm/compiler/backend/flow_graph_compiler.h" @@ -1794,4 +1794,4 @@ void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { } // namespace dart -#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM64) diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc b/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc index d982292d477..2c7eac4788e 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc +++ b/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. -#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_IA32) #include "vm/compiler/backend/flow_graph_compiler.h" @@ -1602,4 +1602,4 @@ void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { } // namespace dart -#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_IA32) diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc b/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc index cade733d324..42b19a8ce32 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc +++ b/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. -#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_X64) #include "vm/compiler/backend/flow_graph_compiler.h" @@ -1763,4 +1763,4 @@ void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { } // namespace dart -#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_X64) diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc index eca6a6c600f..8b9836aefab 100644 --- a/runtime/vm/compiler/backend/il.cc +++ b/runtime/vm/compiler/backend/il.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/il.h" #include "vm/bit_vector.h" @@ -6152,5 +6150,3 @@ bool SimdOpInstr::HasMask() const { #undef __ } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/il.h b/runtime/vm/compiler/backend/il.h index 85a4cb2ddca..9ee1ce5198d 100644 --- a/runtime/vm/compiler/backend/il.h +++ b/runtime/vm/compiler/backend/il.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_IL_H_ #define RUNTIME_VM_COMPILER_BACKEND_IL_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include #include diff --git a/runtime/vm/compiler/backend/il_arm.cc b/runtime/vm/compiler/backend/il_arm.cc index 5e3faea98fb..71bb295fea8 100644 --- a/runtime/vm/compiler/backend/il_arm.cc +++ b/runtime/vm/compiler/backend/il_arm.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. -#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM) #include "vm/compiler/backend/il.h" @@ -7491,4 +7491,4 @@ void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { } // namespace dart -#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM) diff --git a/runtime/vm/compiler/backend/il_arm64.cc b/runtime/vm/compiler/backend/il_arm64.cc index 73930590bb2..10bac83e46a 100644 --- a/runtime/vm/compiler/backend/il_arm64.cc +++ b/runtime/vm/compiler/backend/il_arm64.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. -#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM64) #include "vm/compiler/backend/il.h" @@ -6434,4 +6434,4 @@ void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { } // namespace dart -#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM64) diff --git a/runtime/vm/compiler/backend/il_deserializer.cc b/runtime/vm/compiler/backend/il_deserializer.cc index 9901da479b8..fe184e96772 100644 --- a/runtime/vm/compiler/backend/il_deserializer.cc +++ b/runtime/vm/compiler/backend/il_deserializer.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/il_deserializer.h" #include "vm/compiler/backend/il_serializer.h" @@ -2489,5 +2487,3 @@ void FlowGraphDeserializer::ReportError() const { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/il_deserializer.h b/runtime/vm/compiler/backend/il_deserializer.h index 9e8d40b8c44..3959d37904b 100644 --- a/runtime/vm/compiler/backend/il_deserializer.h +++ b/runtime/vm/compiler/backend/il_deserializer.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_IL_DESERIALIZER_H_ #define RUNTIME_VM_COMPILER_BACKEND_IL_DESERIALIZER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "platform/assert.h" #include "vm/allocation.h" diff --git a/runtime/vm/compiler/backend/il_ia32.cc b/runtime/vm/compiler/backend/il_ia32.cc index 745c44ea515..57c00dbe5b6 100644 --- a/runtime/vm/compiler/backend/il_ia32.cc +++ b/runtime/vm/compiler/backend/il_ia32.cc @@ -4,7 +4,7 @@ #include "platform/globals.h" #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. -#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_IA32) #include "vm/compiler/backend/il.h" @@ -6340,4 +6340,4 @@ void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { #undef __ -#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_IA32) diff --git a/runtime/vm/compiler/backend/il_printer.h b/runtime/vm/compiler/backend/il_printer.h index becdf59c6b7..96268c8eabe 100644 --- a/runtime/vm/compiler/backend/il_printer.h +++ b/runtime/vm/compiler/backend/il_printer.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_IL_PRINTER_H_ #define RUNTIME_VM_COMPILER_BACKEND_IL_PRINTER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "platform/text_buffer.h" #include "vm/compiler/backend/flow_graph.h" #include "vm/compiler/backend/il.h" diff --git a/runtime/vm/compiler/backend/il_serializer.cc b/runtime/vm/compiler/backend/il_serializer.cc index f2e5cf94beb..d4480730e18 100644 --- a/runtime/vm/compiler/backend/il_serializer.cc +++ b/runtime/vm/compiler/backend/il_serializer.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/il_serializer.h" #include "vm/compiler/backend/flow_graph.h" @@ -1487,5 +1485,3 @@ SExpression* Environment::ToSExpression(FlowGraphSerializer* s) const { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/il_serializer.h b/runtime/vm/compiler/backend/il_serializer.h index 0e02cd2e6bd..eb7795e6a0a 100644 --- a/runtime/vm/compiler/backend/il_serializer.h +++ b/runtime/vm/compiler/backend/il_serializer.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_IL_SERIALIZER_H_ #define RUNTIME_VM_COMPILER_BACKEND_IL_SERIALIZER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "platform/assert.h" #include "platform/text_buffer.h" diff --git a/runtime/vm/compiler/backend/il_x64.cc b/runtime/vm/compiler/backend/il_x64.cc index 0ab1b747299..1109aff0ccc 100644 --- a/runtime/vm/compiler/backend/il_x64.cc +++ b/runtime/vm/compiler/backend/il_x64.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. -#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_X64) #include "vm/compiler/backend/il.h" @@ -6720,4 +6720,4 @@ void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { #undef __ -#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_X64) diff --git a/runtime/vm/compiler/backend/inliner.cc b/runtime/vm/compiler/backend/inliner.cc index c124196666f..1daefa07b9d 100644 --- a/runtime/vm/compiler/backend/inliner.cc +++ b/runtime/vm/compiler/backend/inliner.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/inliner.h" #include "vm/compiler/aot/aot_call_specializer.h" @@ -4267,5 +4265,3 @@ bool FlowGraphInliner::TryInlineRecognizedMethod( } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/inliner.h b/runtime/vm/compiler/backend/inliner.h index 5aa3c1acf74..c31a95498e3 100644 --- a/runtime/vm/compiler/backend/inliner.h +++ b/runtime/vm/compiler/backend/inliner.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_INLINER_H_ #define RUNTIME_VM_COMPILER_BACKEND_INLINER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" #include "vm/growable_array.h" #include "vm/token_position.h" diff --git a/runtime/vm/compiler/backend/linearscan.cc b/runtime/vm/compiler/backend/linearscan.cc index 402954d8eb0..21c2bfef170 100644 --- a/runtime/vm/compiler/backend/linearscan.cc +++ b/runtime/vm/compiler/backend/linearscan.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/linearscan.h" #include "vm/bit_vector.h" @@ -2989,5 +2987,3 @@ void FlowGraphAllocator::AllocateRegisters() { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/linearscan.h b/runtime/vm/compiler/backend/linearscan.h index 541bd2cc1d5..2fc72ef7dc0 100644 --- a/runtime/vm/compiler/backend/linearscan.h +++ b/runtime/vm/compiler/backend/linearscan.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_LINEARSCAN_H_ #define RUNTIME_VM_COMPILER_BACKEND_LINEARSCAN_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/flow_graph.h" #include "vm/compiler/backend/il.h" #include "vm/growable_array.h" diff --git a/runtime/vm/compiler/backend/locations.cc b/runtime/vm/compiler/backend/locations.cc index 2153facdc60..f5853c2774d 100644 --- a/runtime/vm/compiler/backend/locations.cc +++ b/runtime/vm/compiler/backend/locations.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/locations.h" #include "vm/compiler/assembler/assembler.h" @@ -394,5 +392,3 @@ void LocationSummary::CheckWritableInputs() { #endif } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/locations.h b/runtime/vm/compiler/backend/locations.h index 117092ab1c3..a270ad82625 100644 --- a/runtime/vm/compiler/backend/locations.h +++ b/runtime/vm/compiler/backend/locations.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_H_ #define RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" #include "vm/bitfield.h" #include "vm/bitmap.h" diff --git a/runtime/vm/compiler/backend/locations_helpers.h b/runtime/vm/compiler/backend/locations_helpers.h index 5e7969a358f..6b62e40feb0 100644 --- a/runtime/vm/compiler/backend/locations_helpers.h +++ b/runtime/vm/compiler/backend/locations_helpers.h @@ -43,6 +43,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_HELPERS_H_ #define RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_HELPERS_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/locations.h" namespace dart { diff --git a/runtime/vm/compiler/backend/locations_helpers_arm.h b/runtime/vm/compiler/backend/locations_helpers_arm.h index 6eecc9f20d6..4a651cc1bb3 100644 --- a/runtime/vm/compiler/backend/locations_helpers_arm.h +++ b/runtime/vm/compiler/backend/locations_helpers_arm.h @@ -9,6 +9,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_HELPERS_ARM_H_ #define RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_HELPERS_ARM_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + namespace dart { // QRegisterView is a wrapper around QRegister that provides helpers for diff --git a/runtime/vm/compiler/backend/loops.cc b/runtime/vm/compiler/backend/loops.cc index b8edbc005a8..21a4a7734fd 100644 --- a/runtime/vm/compiler/backend/loops.cc +++ b/runtime/vm/compiler/backend/loops.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/loops.h" #include "vm/bit_vector.h" @@ -1192,5 +1190,3 @@ void LoopHierarchy::ComputeInduction() const { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/loops.h b/runtime/vm/compiler/backend/loops.h index 26875abb950..704508b84a7 100644 --- a/runtime/vm/compiler/backend/loops.h +++ b/runtime/vm/compiler/backend/loops.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_LOOPS_H_ #define RUNTIME_VM_COMPILER_BACKEND_LOOPS_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include #include "vm/allocation.h" diff --git a/runtime/vm/compiler/backend/range_analysis.cc b/runtime/vm/compiler/backend/range_analysis.cc index 7ab4dc259ce..f81e017f11d 100644 --- a/runtime/vm/compiler/backend/range_analysis.cc +++ b/runtime/vm/compiler/backend/range_analysis.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/range_analysis.h" #include "vm/bit_vector.h" @@ -3045,5 +3043,3 @@ bool CheckBoundBase::IsRedundant(bool use_loops) { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/range_analysis.h b/runtime/vm/compiler/backend/range_analysis.h index 720103bc037..0ed49366388 100644 --- a/runtime/vm/compiler/backend/range_analysis.h +++ b/runtime/vm/compiler/backend/range_analysis.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_RANGE_ANALYSIS_H_ #define RUNTIME_VM_COMPILER_BACKEND_RANGE_ANALYSIS_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/flow_graph.h" #include "vm/compiler/backend/il.h" diff --git a/runtime/vm/compiler/backend/redundancy_elimination.cc b/runtime/vm/compiler/backend/redundancy_elimination.cc index 05596626195..f363a15dba8 100644 --- a/runtime/vm/compiler/backend/redundancy_elimination.cc +++ b/runtime/vm/compiler/backend/redundancy_elimination.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/redundancy_elimination.h" #include "vm/bit_vector.h" @@ -3816,5 +3814,3 @@ void CheckStackOverflowElimination::EliminateStackOverflow(FlowGraph* graph) { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/redundancy_elimination.h b/runtime/vm/compiler/backend/redundancy_elimination.h index fd9b9c8c184..84fc7d29c7b 100644 --- a/runtime/vm/compiler/backend/redundancy_elimination.h +++ b/runtime/vm/compiler/backend/redundancy_elimination.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_REDUNDANCY_ELIMINATION_H_ #define RUNTIME_VM_COMPILER_BACKEND_REDUNDANCY_ELIMINATION_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/flow_graph.h" #include "vm/compiler/backend/il.h" diff --git a/runtime/vm/compiler/backend/sexpression.cc b/runtime/vm/compiler/backend/sexpression.cc index 8b33ea5ae17..12006b42c75 100644 --- a/runtime/vm/compiler/backend/sexpression.cc +++ b/runtime/vm/compiler/backend/sexpression.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/sexpression.h" #include @@ -687,5 +685,3 @@ void SExpParser::ReportError() const { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/sexpression.h b/runtime/vm/compiler/backend/sexpression.h index 461e3eb2091..40b79a3d63b 100644 --- a/runtime/vm/compiler/backend/sexpression.h +++ b/runtime/vm/compiler/backend/sexpression.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_SEXPRESSION_H_ #define RUNTIME_VM_COMPILER_BACKEND_SEXPRESSION_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "platform/text_buffer.h" #include "vm/allocation.h" diff --git a/runtime/vm/compiler/backend/slot.cc b/runtime/vm/compiler/backend/slot.cc index 3ebb148f73f..79c147ba09a 100644 --- a/runtime/vm/compiler/backend/slot.cc +++ b/runtime/vm/compiler/backend/slot.cc @@ -4,8 +4,6 @@ #include "vm/compiler/backend/slot.h" -#ifndef DART_PRECOMPILED_RUNTIME - #include "vm/compiler/compiler_state.h" #include "vm/hash_map.h" #include "vm/parser.h" @@ -323,5 +321,3 @@ intptr_t Slot::Hashcode() const { } } // namespace dart - -#endif // DART_PRECOMPILED_RUNTIME diff --git a/runtime/vm/compiler/backend/slot.h b/runtime/vm/compiler/backend/slot.h index 6f6faa8c0aa..8115c6afe68 100644 --- a/runtime/vm/compiler/backend/slot.h +++ b/runtime/vm/compiler/backend/slot.h @@ -24,6 +24,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_SLOT_H_ #define RUNTIME_VM_COMPILER_BACKEND_SLOT_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/compile_type.h" #include "vm/thread.h" diff --git a/runtime/vm/compiler/backend/type_propagator.cc b/runtime/vm/compiler/backend/type_propagator.cc index 39e92e52b96..dc47a684b7f 100644 --- a/runtime/vm/compiler/backend/type_propagator.cc +++ b/runtime/vm/compiler/backend/type_propagator.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/backend/type_propagator.h" #include "platform/text_buffer.h" @@ -1750,5 +1748,3 @@ CompileType LoadIndexedInstr::ComputeType() const { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/backend/type_propagator.h b/runtime/vm/compiler/backend/type_propagator.h index 65ef9f4d6b8..5c274206c20 100644 --- a/runtime/vm/compiler/backend/type_propagator.h +++ b/runtime/vm/compiler/backend/type_propagator.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_BACKEND_TYPE_PROPAGATOR_H_ #define RUNTIME_VM_COMPILER_BACKEND_TYPE_PROPAGATOR_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/flow_graph.h" #include "vm/compiler/backend/il.h" diff --git a/runtime/vm/compiler/call_specializer.cc b/runtime/vm/compiler/call_specializer.cc index e0741430d5f..9f1ef3652dd 100644 --- a/runtime/vm/compiler/call_specializer.cc +++ b/runtime/vm/compiler/call_specializer.cc @@ -2,7 +2,6 @@ // 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 DART_PRECOMPILED_RUNTIME #include "vm/compiler/call_specializer.h" #include "vm/compiler/backend/flow_graph_compiler.h" @@ -1794,4 +1793,3 @@ void CallSpecializer::ReplaceInstanceCallsWithDispatchTableCalls() { } } // namespace dart -#endif // DART_PRECOMPILED_RUNTIME diff --git a/runtime/vm/compiler/call_specializer.h b/runtime/vm/compiler/call_specializer.h index da606b03725..c1be9a2d1f1 100644 --- a/runtime/vm/compiler/call_specializer.h +++ b/runtime/vm/compiler/call_specializer.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_CALL_SPECIALIZER_H_ #define RUNTIME_VM_COMPILER_CALL_SPECIALIZER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/flow_graph.h" #include "vm/compiler/backend/il.h" diff --git a/runtime/vm/compiler/cha.cc b/runtime/vm/compiler/cha.cc index 53e2480b658..b7307f67077 100644 --- a/runtime/vm/compiler/cha.cc +++ b/runtime/vm/compiler/cha.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/cha.h" #include "vm/class_table.h" #include "vm/flags.h" @@ -173,5 +171,3 @@ void CHA::RegisterDependencies(const Code& code) const { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/cha.h b/runtime/vm/compiler/cha.h index c132f1094bb..dd1d5b35bee 100644 --- a/runtime/vm/compiler/cha.h +++ b/runtime/vm/compiler/cha.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_CHA_H_ #define RUNTIME_VM_COMPILER_CHA_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" #include "vm/growable_array.h" #include "vm/thread.h" diff --git a/runtime/vm/compiler/compiler_pass.cc b/runtime/vm/compiler/compiler_pass.cc index ed13b59fa30..9bef093c1fe 100644 --- a/runtime/vm/compiler/compiler_pass.cc +++ b/runtime/vm/compiler/compiler_pass.cc @@ -4,8 +4,6 @@ #include "vm/compiler/compiler_pass.h" -#ifndef DART_PRECOMPILED_RUNTIME - #include "vm/compiler/backend/block_scheduler.h" #include "vm/compiler/backend/branch_optimizer.h" #include "vm/compiler/backend/constant_propagator.h" @@ -575,5 +573,3 @@ COMPILER_PASS(RoundTripSerialization, { }) } // namespace dart - -#endif // DART_PRECOMPILED_RUNTIME diff --git a/runtime/vm/compiler/compiler_pass.h b/runtime/vm/compiler/compiler_pass.h index f3333b91a28..0f84e7fb2d1 100644 --- a/runtime/vm/compiler/compiler_pass.h +++ b/runtime/vm/compiler/compiler_pass.h @@ -5,7 +5,9 @@ #ifndef RUNTIME_VM_COMPILER_COMPILER_PASS_H_ #define RUNTIME_VM_COMPILER_COMPILER_PASS_H_ -#ifndef DART_PRECOMPILED_RUNTIME +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) #include @@ -201,6 +203,4 @@ class CompilerPass { } // namespace dart -#endif - #endif // RUNTIME_VM_COMPILER_COMPILER_PASS_H_ diff --git a/runtime/vm/compiler/compiler_state.h b/runtime/vm/compiler/compiler_state.h index 619f25bde57..9baaceb371c 100644 --- a/runtime/vm/compiler/compiler_state.h +++ b/runtime/vm/compiler/compiler_state.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_COMPILER_STATE_H_ #define RUNTIME_VM_COMPILER_COMPILER_STATE_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/api/deopt_id.h" #include "vm/compiler/cha.h" #include "vm/heap/safepoint.h" diff --git a/runtime/vm/compiler/ffi/abi.h b/runtime/vm/compiler/ffi/abi.h index 623374f02c0..fb6f937c5f3 100644 --- a/runtime/vm/compiler/ffi/abi.h +++ b/runtime/vm/compiler/ffi/abi.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_FFI_ABI_H_ #define RUNTIME_VM_COMPILER_FFI_ABI_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include namespace dart { diff --git a/runtime/vm/compiler/ffi/call.cc b/runtime/vm/compiler/ffi/call.cc index b13af64f461..40a4e6ea5f8 100644 --- a/runtime/vm/compiler/ffi/call.cc +++ b/runtime/vm/compiler/ffi/call.cc @@ -12,8 +12,6 @@ namespace compiler { namespace ffi { -#if !defined(DART_PRECOMPILED_RUNTIME) - // TODO(dartbug.com/36607): Cache the trampolines. RawFunction* TrampolineFunction(const Function& dart_signature, const Function& c_signature) { @@ -55,8 +53,6 @@ RawFunction* TrampolineFunction(const Function& dart_signature, return function.raw(); } -#endif // !defined(DART_PRECOMPILED_RUNTIME) - } // namespace ffi } // namespace compiler diff --git a/runtime/vm/compiler/ffi/call.h b/runtime/vm/compiler/ffi/call.h index 36804815bf4..86a986bc02d 100644 --- a/runtime/vm/compiler/ffi/call.h +++ b/runtime/vm/compiler/ffi/call.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_FFI_CALL_H_ #define RUNTIME_VM_COMPILER_FFI_CALL_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include #include "vm/raw_object.h" diff --git a/runtime/vm/compiler/ffi/callback.cc b/runtime/vm/compiler/ffi/callback.cc index 94abfb88391..6bd722abf73 100644 --- a/runtime/vm/compiler/ffi/callback.cc +++ b/runtime/vm/compiler/ffi/callback.cc @@ -12,8 +12,6 @@ namespace compiler { namespace ffi { -#if !defined(DART_PRECOMPILED_RUNTIME) - RawFunction* NativeCallbackFunction(const Function& c_signature, const Function& dart_target, const Instance& exceptional_return) { @@ -66,8 +64,6 @@ RawFunction* NativeCallbackFunction(const Function& c_signature, return function.raw(); } -#endif // !defined(DART_PRECOMPILED_RUNTIME) - } // namespace ffi } // namespace compiler diff --git a/runtime/vm/compiler/ffi/callback.h b/runtime/vm/compiler/ffi/callback.h index ff432e678f6..4113ffab8b5 100644 --- a/runtime/vm/compiler/ffi/callback.h +++ b/runtime/vm/compiler/ffi/callback.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_FFI_CALLBACK_H_ #define RUNTIME_VM_COMPILER_FFI_CALLBACK_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include #include "vm/raw_object.h" diff --git a/runtime/vm/compiler/ffi/frame_rebase.cc b/runtime/vm/compiler/ffi/frame_rebase.cc index cc12a561f1a..ee035acacc1 100644 --- a/runtime/vm/compiler/ffi/frame_rebase.cc +++ b/runtime/vm/compiler/ffi/frame_rebase.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/ffi/frame_rebase.h" namespace dart { @@ -47,5 +45,3 @@ Location FrameRebase::Rebase(const Location loc) const { } // namespace compiler } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/ffi/frame_rebase.h b/runtime/vm/compiler/ffi/frame_rebase.h index 33d8683f4e8..ba58a5c8704 100644 --- a/runtime/vm/compiler/ffi/frame_rebase.h +++ b/runtime/vm/compiler/ffi/frame_rebase.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_FFI_FRAME_REBASE_H_ #define RUNTIME_VM_COMPILER_FFI_FRAME_REBASE_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/locations.h" #include "vm/compiler/ffi/native_location.h" #include "vm/compiler/ffi/native_type.h" diff --git a/runtime/vm/compiler/ffi/marshaller.cc b/runtime/vm/compiler/ffi/marshaller.cc index 53d1e21cfe0..009e0315f7b 100644 --- a/runtime/vm/compiler/ffi/marshaller.cc +++ b/runtime/vm/compiler/ffi/marshaller.cc @@ -17,8 +17,6 @@ namespace compiler { namespace ffi { -#if !defined(DART_PRECOMPILED_RUNTIME) - Location CallMarshaller::LocInFfiCall(intptr_t arg_index) const { if (arg_index == kResultIndex) { return Location(arg_index).AsLocation(); @@ -154,8 +152,6 @@ CallbackMarshaller::CallbackMarshaller(Zone* zone, CallbackArgumentTranslator::TranslateArgumentLocations(arg_locs_, zone_)) {} -#endif // !defined(DART_PRECOMPILED_RUNTIME) - } // namespace ffi } // namespace compiler diff --git a/runtime/vm/compiler/ffi/marshaller.h b/runtime/vm/compiler/ffi/marshaller.h index 19009bbb762..01704c7a4e4 100644 --- a/runtime/vm/compiler/ffi/marshaller.h +++ b/runtime/vm/compiler/ffi/marshaller.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_FFI_MARSHALLER_H_ #define RUNTIME_VM_COMPILER_FFI_MARSHALLER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include #include "vm/compiler/backend/locations.h" diff --git a/runtime/vm/compiler/ffi/native_calling_convention.cc b/runtime/vm/compiler/ffi/native_calling_convention.cc index 13b01f37fa5..032f58374e2 100644 --- a/runtime/vm/compiler/ffi/native_calling_convention.cc +++ b/runtime/vm/compiler/ffi/native_calling_convention.cc @@ -16,8 +16,6 @@ namespace compiler { namespace ffi { -#if !defined(DART_PRECOMPILED_RUNTIME) - // Argument #0 is the function pointer. const intptr_t kNativeParamsStartAt = 1; @@ -303,8 +301,6 @@ intptr_t NativeCallingConvention::StackTopInBytes() const { return Utils::RoundUp(max_height_in_bytes, compiler::target::kWordSize); } -#endif // !defined(DART_PRECOMPILED_RUNTIME) - } // namespace ffi } // namespace compiler diff --git a/runtime/vm/compiler/ffi/native_calling_convention.h b/runtime/vm/compiler/ffi/native_calling_convention.h index 459be7f45ce..1524b6f9a71 100644 --- a/runtime/vm/compiler/ffi/native_calling_convention.h +++ b/runtime/vm/compiler/ffi/native_calling_convention.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_FFI_NATIVE_CALLING_CONVENTION_H_ #define RUNTIME_VM_COMPILER_FFI_NATIVE_CALLING_CONVENTION_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include #include "vm/compiler/backend/locations.h" diff --git a/runtime/vm/compiler/ffi/native_location.cc b/runtime/vm/compiler/ffi/native_location.cc index 918f341bfb0..27c0388da53 100644 --- a/runtime/vm/compiler/ffi/native_location.cc +++ b/runtime/vm/compiler/ffi/native_location.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/ffi/native_location.h" #include "vm/compiler/backend/il_printer.h" @@ -340,5 +338,3 @@ bool NativeFpuRegistersLocation::IsLowestBits() const { } // namespace compiler } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/ffi/native_location.h b/runtime/vm/compiler/ffi/native_location.h index a50872f6af3..7db24e6b85d 100644 --- a/runtime/vm/compiler/ffi/native_location.h +++ b/runtime/vm/compiler/ffi/native_location.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_FFI_NATIVE_LOCATION_H_ #define RUNTIME_VM_COMPILER_FFI_NATIVE_LOCATION_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/locations.h" #include "vm/compiler/ffi/native_type.h" #include "vm/growable_array.h" diff --git a/runtime/vm/compiler/ffi/recognized_method.h b/runtime/vm/compiler/ffi/recognized_method.h index 0bd7dab59ef..8cbfca81af7 100644 --- a/runtime/vm/compiler/ffi/recognized_method.h +++ b/runtime/vm/compiler/ffi/recognized_method.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_FFI_RECOGNIZED_METHOD_H_ #define RUNTIME_VM_COMPILER_FFI_RECOGNIZED_METHOD_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include #include "vm/compiler/method_recognizer.h" diff --git a/runtime/vm/compiler/frontend/base_flow_graph_builder.cc b/runtime/vm/compiler/frontend/base_flow_graph_builder.cc index 53a60def68d..a60eb0790d5 100644 --- a/runtime/vm/compiler/frontend/base_flow_graph_builder.cc +++ b/runtime/vm/compiler/frontend/base_flow_graph_builder.cc @@ -11,8 +11,6 @@ #include "vm/growable_array.h" #include "vm/object_store.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { namespace kernel { @@ -1146,5 +1144,3 @@ Fragment BaseFlowGraphBuilder::InitConstantParameters() { } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/base_flow_graph_builder.h b/runtime/vm/compiler/frontend/base_flow_graph_builder.h index 8fed8b04657..67448f0547e 100644 --- a/runtime/vm/compiler/frontend/base_flow_graph_builder.h +++ b/runtime/vm/compiler/frontend/base_flow_graph_builder.h @@ -5,14 +5,16 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_BASE_FLOW_GRAPH_BUILDER_H_ #define RUNTIME_VM_COMPILER_FRONTEND_BASE_FLOW_GRAPH_BUILDER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include #include "vm/compiler/backend/flow_graph.h" #include "vm/compiler/backend/il.h" #include "vm/object.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { class InlineExitCollector; @@ -451,5 +453,4 @@ class BaseFlowGraphBuilder { } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_BASE_FLOW_GRAPH_BUILDER_H_ diff --git a/runtime/vm/compiler/frontend/bytecode_fingerprints.cc b/runtime/vm/compiler/frontend/bytecode_fingerprints.cc index 8a42a1e8d19..78d621e373a 100644 --- a/runtime/vm/compiler/frontend/bytecode_fingerprints.cc +++ b/runtime/vm/compiler/frontend/bytecode_fingerprints.cc @@ -8,8 +8,6 @@ #include "vm/constants_kbc.h" #include "vm/hash.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { namespace kernel { @@ -207,5 +205,3 @@ uint32_t BytecodeFingerprintHelper::CalculateFunctionFingerprint( } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/bytecode_fingerprints.h b/runtime/vm/compiler/frontend/bytecode_fingerprints.h index ea79a92d1e6..78dbcff6454 100644 --- a/runtime/vm/compiler/frontend/bytecode_fingerprints.h +++ b/runtime/vm/compiler/frontend/bytecode_fingerprints.h @@ -5,11 +5,13 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FINGERPRINTS_H_ #define RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FINGERPRINTS_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "platform/allocation.h" #include "vm/object.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { namespace kernel { @@ -21,5 +23,4 @@ class BytecodeFingerprintHelper : public AllStatic { } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FINGERPRINTS_H_ diff --git a/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.cc b/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.cc index 1d16d3be283..5bcc3d8b390 100644 --- a/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.cc +++ b/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.cc @@ -13,8 +13,6 @@ #include "vm/stack_frame.h" #include "vm/stack_frame_kbc.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - #define B (flow_graph_builder_) #define Z (zone_) @@ -2348,5 +2346,3 @@ FlowGraph* BytecodeFlowGraphBuilder::BuildGraph() { } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.h b/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.h index 822a55ebf8d..c98d743e536 100644 --- a/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.h +++ b/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.h @@ -5,13 +5,15 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FLOW_GRAPH_BUILDER_H_ #define RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FLOW_GRAPH_BUILDER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/il.h" #include "vm/compiler/frontend/base_flow_graph_builder.h" #include "vm/compiler/frontend/kernel_translation_helper.h" // For InferredTypeMetadata #include "vm/constants_kbc.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { namespace kernel { @@ -247,5 +249,4 @@ class BytecodeFlowGraphBuilder { } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FLOW_GRAPH_BUILDER_H_ diff --git a/runtime/vm/compiler/frontend/bytecode_reader.cc b/runtime/vm/compiler/frontend/bytecode_reader.cc index fbc1a7e293a..3f1de8551e6 100644 --- a/runtime/vm/compiler/frontend/bytecode_reader.cc +++ b/runtime/vm/compiler/frontend/bytecode_reader.cc @@ -24,8 +24,6 @@ #include "vm/stack_frame_kbc.h" #include "vm/timeline.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - #define Z (zone_) #define H (translation_helper_) #define I (translation_helper_.isolate()) @@ -3732,5 +3730,3 @@ bool IsStaticFieldGetterGeneratedAsInitializer(const Function& function, } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/bytecode_reader.h b/runtime/vm/compiler/frontend/bytecode_reader.h index 2afd9ddcdbc..81abc86f50c 100644 --- a/runtime/vm/compiler/frontend/bytecode_reader.h +++ b/runtime/vm/compiler/frontend/bytecode_reader.h @@ -5,12 +5,14 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_READER_H_ #define RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_READER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/frontend/kernel_translation_helper.h" #include "vm/constants_kbc.h" #include "vm/object.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { namespace kernel { @@ -582,5 +584,4 @@ bool IsStaticFieldGetterGeneratedAsInitializer(const Function& function, } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_READER_H_ diff --git a/runtime/vm/compiler/frontend/bytecode_scope_builder.cc b/runtime/vm/compiler/frontend/bytecode_scope_builder.cc index e7283f65238..af47f515915 100644 --- a/runtime/vm/compiler/frontend/bytecode_scope_builder.cc +++ b/runtime/vm/compiler/frontend/bytecode_scope_builder.cc @@ -6,8 +6,6 @@ #include "vm/compiler/frontend/bytecode_reader.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { namespace kernel { @@ -189,5 +187,3 @@ LocalVariable* BytecodeScopeBuilder::MakeReceiverVariable(bool is_parameter) { } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/bytecode_scope_builder.h b/runtime/vm/compiler/frontend/bytecode_scope_builder.h index 4436565ccab..8f96b87f92a 100644 --- a/runtime/vm/compiler/frontend/bytecode_scope_builder.h +++ b/runtime/vm/compiler/frontend/bytecode_scope_builder.h @@ -5,7 +5,9 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_SCOPE_BUILDER_H_ #define RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_SCOPE_BUILDER_H_ -#if !defined(DART_PRECOMPILED_RUNTIME) +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) #include "vm/object.h" #include "vm/parser.h" // For ParsedFunction. @@ -36,5 +38,4 @@ class BytecodeScopeBuilder : public ValueObject { } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_SCOPE_BUILDER_H_ diff --git a/runtime/vm/compiler/frontend/constant_reader.cc b/runtime/vm/compiler/frontend/constant_reader.cc index 23a30d3f564..08fd4202821 100644 --- a/runtime/vm/compiler/frontend/constant_reader.cc +++ b/runtime/vm/compiler/frontend/constant_reader.cc @@ -4,8 +4,6 @@ #include "vm/compiler/frontend/constant_reader.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { namespace kernel { @@ -328,5 +326,3 @@ RawInstance* ConstantReader::ReadConstantInternal(intptr_t constant_offset) { } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/constant_reader.h b/runtime/vm/compiler/frontend/constant_reader.h index c5a757497b2..8e7a5198c4a 100644 --- a/runtime/vm/compiler/frontend/constant_reader.h +++ b/runtime/vm/compiler/frontend/constant_reader.h @@ -5,7 +5,9 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_CONSTANT_READER_H_ #define RUNTIME_VM_COMPILER_FRONTEND_CONSTANT_READER_H_ -#if !defined(DART_PRECOMPILED_RUNTIME) +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) #include "vm/compiler/frontend/kernel_translation_helper.h" #include "vm/hash_table.h" @@ -80,5 +82,4 @@ typedef UnorderedHashMap KernelConstantsMap; } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_CONSTANT_READER_H_ diff --git a/runtime/vm/compiler/frontend/flow_graph_builder.cc b/runtime/vm/compiler/frontend/flow_graph_builder.cc index 9d8855f5702..4a13620512e 100644 --- a/runtime/vm/compiler/frontend/flow_graph_builder.cc +++ b/runtime/vm/compiler/frontend/flow_graph_builder.cc @@ -2,8 +2,6 @@ // 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. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/frontend/flow_graph_builder.h" #include "vm/compiler/backend/branch_optimizer.h" @@ -390,5 +388,3 @@ bool SimpleInstanceOfType(const AbstractType& type) { } } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/flow_graph_builder.h b/runtime/vm/compiler/frontend/flow_graph_builder.h index 71e573cd56c..f2d536461a2 100644 --- a/runtime/vm/compiler/frontend/flow_graph_builder.h +++ b/runtime/vm/compiler/frontend/flow_graph_builder.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_FLOW_GRAPH_BUILDER_H_ #define RUNTIME_VM_COMPILER_FRONTEND_FLOW_GRAPH_BUILDER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "platform/assert.h" #include "platform/globals.h" #include "vm/allocation.h" diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc index b0dd4142e65..61f3c73302b 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc @@ -13,8 +13,6 @@ #include "vm/object_store.h" #include "vm/stack_frame.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { DECLARE_FLAG(bool, enable_interpreter); @@ -5270,5 +5268,3 @@ Fragment StreamingFlowGraphBuilder::BuildFfiNativeCallbackFunction() { } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h index d782e5d94af..4a383ad8589 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h @@ -5,7 +5,9 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_KERNEL_BINARY_FLOWGRAPH_H_ #define RUNTIME_VM_COMPILER_FRONTEND_KERNEL_BINARY_FLOWGRAPH_H_ -#if !defined(DART_PRECOMPILED_RUNTIME) +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) #include "vm/compiler/frontend/bytecode_reader.h" #include "vm/compiler/frontend/constant_reader.h" @@ -382,5 +384,4 @@ class StreamingFlowGraphBuilder : public KernelReaderHelper { } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_KERNEL_BINARY_FLOWGRAPH_H_ diff --git a/runtime/vm/compiler/frontend/kernel_fingerprints.cc b/runtime/vm/compiler/frontend/kernel_fingerprints.cc index 4247dae6815..b20ba942c46 100644 --- a/runtime/vm/compiler/frontend/kernel_fingerprints.cc +++ b/runtime/vm/compiler/frontend/kernel_fingerprints.cc @@ -5,8 +5,6 @@ #include "vm/compiler/frontend/kernel_fingerprints.h" #include "vm/compiler/frontend/kernel_translation_helper.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - #define H (translation_helper_) #define I Isolate::Current() @@ -880,5 +878,3 @@ uint32_t KernelSourceFingerprintHelper::CalculateFunctionFingerprint( } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/kernel_fingerprints.h b/runtime/vm/compiler/frontend/kernel_fingerprints.h index 601a488ad6c..588d51f45d1 100644 --- a/runtime/vm/compiler/frontend/kernel_fingerprints.h +++ b/runtime/vm/compiler/frontend/kernel_fingerprints.h @@ -5,11 +5,13 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_KERNEL_FINGERPRINTS_H_ #define RUNTIME_VM_COMPILER_FRONTEND_KERNEL_FINGERPRINTS_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "platform/allocation.h" #include "vm/object.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { namespace kernel { @@ -23,5 +25,4 @@ class KernelSourceFingerprintHelper : public AllStatic { } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_KERNEL_FINGERPRINTS_H_ diff --git a/runtime/vm/compiler/frontend/kernel_to_il.cc b/runtime/vm/compiler/frontend/kernel_to_il.cc index 138d13dfe8b..7f0f7a1eed1 100644 --- a/runtime/vm/compiler/frontend/kernel_to_il.cc +++ b/runtime/vm/compiler/frontend/kernel_to_il.cc @@ -24,8 +24,6 @@ #include "vm/resolver.h" #include "vm/stack_frame.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { namespace kernel { @@ -3023,5 +3021,3 @@ void FlowGraphBuilder::SetCurrentTryCatchBlock(TryCatchBlock* try_catch_block) { } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/kernel_to_il.h b/runtime/vm/compiler/frontend/kernel_to_il.h index a61c5b175da..9e798c8c887 100644 --- a/runtime/vm/compiler/frontend/kernel_to_il.h +++ b/runtime/vm/compiler/frontend/kernel_to_il.h @@ -5,7 +5,9 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TO_IL_H_ #define RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TO_IL_H_ -#if !defined(DART_PRECOMPILED_RUNTIME) +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) #include "vm/growable_array.h" #include "vm/hash_map.h" @@ -669,5 +671,4 @@ class CatchBlock { } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TO_IL_H_ diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.cc b/runtime/vm/compiler/frontend/kernel_translation_helper.cc index c56e34aca38..c9aa6d878d9 100644 --- a/runtime/vm/compiler/frontend/kernel_translation_helper.cc +++ b/runtime/vm/compiler/frontend/kernel_translation_helper.cc @@ -14,8 +14,6 @@ #include "vm/parser.h" // for ParsedFunction #include "vm/symbols.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - #define Z (zone_) #define H (translation_helper_) #define T (type_translator_) @@ -3525,5 +3523,3 @@ void TypeTranslator::SetupFunctionParameters( } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.h b/runtime/vm/compiler/frontend/kernel_translation_helper.h index 9fb83016a05..6192f88843c 100644 --- a/runtime/vm/compiler/frontend/kernel_translation_helper.h +++ b/runtime/vm/compiler/frontend/kernel_translation_helper.h @@ -5,13 +5,15 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_ #define RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/backend/il.h" // For CompileType. #include "vm/kernel.h" #include "vm/kernel_binary.h" #include "vm/object.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { namespace kernel { @@ -1505,5 +1507,4 @@ class TypeTranslator { } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_ diff --git a/runtime/vm/compiler/frontend/prologue_builder.cc b/runtime/vm/compiler/frontend/prologue_builder.cc index 71fff6508f4..ea3375b5897 100644 --- a/runtime/vm/compiler/frontend/prologue_builder.cc +++ b/runtime/vm/compiler/frontend/prologue_builder.cc @@ -15,7 +15,6 @@ #include "vm/resolver.h" #include "vm/stack_frame.h" -#if !defined(DART_PRECOMPILED_RUNTIME) namespace dart { namespace kernel { @@ -530,5 +529,3 @@ void PrologueBuilder::SortOptionalNamedParametersInto(int* opt_param_position, } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/prologue_builder.h b/runtime/vm/compiler/frontend/prologue_builder.h index 3f58e132578..2d2d5025b5c 100644 --- a/runtime/vm/compiler/frontend/prologue_builder.h +++ b/runtime/vm/compiler/frontend/prologue_builder.h @@ -5,7 +5,9 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_PROLOGUE_BUILDER_H_ #define RUNTIME_VM_COMPILER_FRONTEND_PROLOGUE_BUILDER_H_ -#if !defined(DART_PRECOMPILED_RUNTIME) +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) #include "vm/compiler/frontend/base_flow_graph_builder.h" @@ -90,5 +92,4 @@ class PrologueBuilder : public BaseFlowGraphBuilder { } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_PROLOGUE_BUILDER_H_ diff --git a/runtime/vm/compiler/frontend/scope_builder.cc b/runtime/vm/compiler/frontend/scope_builder.cc index 81157c7424a..ed32087a357 100644 --- a/runtime/vm/compiler/frontend/scope_builder.cc +++ b/runtime/vm/compiler/frontend/scope_builder.cc @@ -7,8 +7,6 @@ #include "vm/compiler/backend/il.h" // For CompileType. #include "vm/compiler/frontend/kernel_translation_helper.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - namespace dart { namespace kernel { @@ -1858,5 +1856,3 @@ void ScopeBuilder::LookupCapturedVariableByName(LocalVariable** variable, } // namespace kernel } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/frontend/scope_builder.h b/runtime/vm/compiler/frontend/scope_builder.h index 391f9714c39..4f53fbd6231 100644 --- a/runtime/vm/compiler/frontend/scope_builder.h +++ b/runtime/vm/compiler/frontend/scope_builder.h @@ -5,7 +5,9 @@ #ifndef RUNTIME_VM_COMPILER_FRONTEND_SCOPE_BUILDER_H_ #define RUNTIME_VM_COMPILER_FRONTEND_SCOPE_BUILDER_H_ -#if !defined(DART_PRECOMPILED_RUNTIME) +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) #include "vm/compiler/frontend/constant_reader.h" #include "vm/compiler/frontend/kernel_translation_helper.h" @@ -237,5 +239,4 @@ bool MethodCanSkipTypeChecksForNonCovariantArguments( } // namespace kernel } // namespace dart -#endif // !defined(DART_PRECOMPILED_RUNTIME) #endif // RUNTIME_VM_COMPILER_FRONTEND_SCOPE_BUILDER_H_ diff --git a/runtime/vm/compiler/graph_intrinsifier.cc b/runtime/vm/compiler/graph_intrinsifier.cc index af792ff506d..994b5c743d0 100644 --- a/runtime/vm/compiler/graph_intrinsifier.cc +++ b/runtime/vm/compiler/graph_intrinsifier.cc @@ -3,8 +3,6 @@ // BSD-style license that can be found in the LICENSE file. // Class for intrinsifying functions. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/graph_intrinsifier.h" #include "vm/compiler/backend/block_builder.h" #include "vm/compiler/backend/flow_graph.h" @@ -1074,5 +1072,3 @@ bool GraphIntrinsifier::Build_DoubleRound(FlowGraph* flow_graph) { } // namespace compiler } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/graph_intrinsifier.h b/runtime/vm/compiler/graph_intrinsifier.h index 3e398f15dff..c122b5c7fe1 100644 --- a/runtime/vm/compiler/graph_intrinsifier.h +++ b/runtime/vm/compiler/graph_intrinsifier.h @@ -6,6 +6,10 @@ #ifndef RUNTIME_VM_COMPILER_GRAPH_INTRINSIFIER_H_ #define RUNTIME_VM_COMPILER_GRAPH_INTRINSIFIER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" #include "vm/compiler/recognized_methods_list.h" diff --git a/runtime/vm/compiler/graph_intrinsifier_arm.cc b/runtime/vm/compiler/graph_intrinsifier_arm.cc index 39b30c247ac..cc8dc4c1994 100644 --- a/runtime/vm/compiler/graph_intrinsifier_arm.cc +++ b/runtime/vm/compiler/graph_intrinsifier_arm.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. -#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM) #include "vm/compiler/assembler/assembler.h" #include "vm/compiler/graph_intrinsifier.h" @@ -42,4 +42,4 @@ void GraphIntrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { } // namespace compiler } // namespace dart -#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM) diff --git a/runtime/vm/compiler/graph_intrinsifier_arm64.cc b/runtime/vm/compiler/graph_intrinsifier_arm64.cc index 0dc98a7515c..9bd2ae58062 100644 --- a/runtime/vm/compiler/graph_intrinsifier_arm64.cc +++ b/runtime/vm/compiler/graph_intrinsifier_arm64.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. -#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM64) #include "vm/compiler/assembler/assembler.h" #include "vm/compiler/graph_intrinsifier.h" @@ -47,4 +47,4 @@ void GraphIntrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { } // namespace compiler } // namespace dart -#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM64) diff --git a/runtime/vm/compiler/graph_intrinsifier_ia32.cc b/runtime/vm/compiler/graph_intrinsifier_ia32.cc index e89c176c2c0..6e29ff53a27 100644 --- a/runtime/vm/compiler/graph_intrinsifier_ia32.cc +++ b/runtime/vm/compiler/graph_intrinsifier_ia32.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. -#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_IA32) #include "vm/compiler/assembler/assembler.h" #include "vm/compiler/graph_intrinsifier.h" @@ -34,4 +34,4 @@ void GraphIntrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { } // namespace compiler } // namespace dart -#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_IA32) diff --git a/runtime/vm/compiler/graph_intrinsifier_x64.cc b/runtime/vm/compiler/graph_intrinsifier_x64.cc index 46a80040a73..58c02b2de4a 100644 --- a/runtime/vm/compiler/graph_intrinsifier_x64.cc +++ b/runtime/vm/compiler/graph_intrinsifier_x64.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. -#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_X64) #include "vm/compiler/assembler/assembler.h" #include "vm/compiler/graph_intrinsifier.h" @@ -42,4 +42,4 @@ void GraphIntrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { } // namespace compiler } // namespace dart -#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_X64) diff --git a/runtime/vm/compiler/intrinsifier.cc b/runtime/vm/compiler/intrinsifier.cc index 73daa5becdd..7c6d7649695 100644 --- a/runtime/vm/compiler/intrinsifier.cc +++ b/runtime/vm/compiler/intrinsifier.cc @@ -3,8 +3,6 @@ // BSD-style license that can be found in the LICENSE file. // Class for intrinsifying functions. -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/intrinsifier.h" #include "vm/compiler/assembler/assembler.h" @@ -76,7 +74,6 @@ bool Intrinsifier::CanIntrinsify(const Function& function) { return true; } -#if !defined(DART_PRECOMPILED_RUNTIME) struct IntrinsicDesc { const char* class_name; const char* function_name; @@ -172,7 +169,6 @@ void Intrinsifier::InitializeState() { } #undef SETUP_FUNCTION } -#endif // !defined(DART_PRECOMPILED_RUNTIME) // Returns true if fall-through code can be omitted. bool Intrinsifier::Intrinsify(const ParsedFunction& parsed_function, @@ -238,5 +234,3 @@ bool Intrinsifier::Intrinsify(const ParsedFunction& parsed_function, } // namespace compiler } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/intrinsifier.h b/runtime/vm/compiler/intrinsifier.h index 3aa9148552c..f8895a43deb 100644 --- a/runtime/vm/compiler/intrinsifier.h +++ b/runtime/vm/compiler/intrinsifier.h @@ -6,6 +6,10 @@ #ifndef RUNTIME_VM_COMPILER_INTRINSIFIER_H_ #define RUNTIME_VM_COMPILER_INTRINSIFIER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" #include "vm/compiler/asm_intrinsifier.h" #include "vm/compiler/graph_intrinsifier.h" @@ -26,9 +30,8 @@ class Intrinsifier : public AllStatic { public: static bool Intrinsify(const ParsedFunction& parsed_function, FlowGraphCompiler* compiler); -#if !defined(DART_PRECOMPILED_RUNTIME) + static void InitializeState(); -#endif private: static bool CanIntrinsify(const Function& function); diff --git a/runtime/vm/compiler/jit/jit_call_specializer.cc b/runtime/vm/compiler/jit/jit_call_specializer.cc index cfff54201f4..688084b74c6 100644 --- a/runtime/vm/compiler/jit/jit_call_specializer.cc +++ b/runtime/vm/compiler/jit/jit_call_specializer.cc @@ -1,7 +1,6 @@ // Copyright (c) 2013, 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 DART_PRECOMPILED_RUNTIME #include "vm/compiler/jit/jit_call_specializer.h" #include "vm/bit_vector.h" @@ -279,4 +278,3 @@ void JitCallSpecializer::VisitCloneContext(CloneContextInstr* instr) { } } // namespace dart -#endif // DART_PRECOMPILED_RUNTIME diff --git a/runtime/vm/compiler/jit/jit_call_specializer.h b/runtime/vm/compiler/jit/jit_call_specializer.h index ea35fa9d92f..8c743ed26e0 100644 --- a/runtime/vm/compiler/jit/jit_call_specializer.h +++ b/runtime/vm/compiler/jit/jit_call_specializer.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_JIT_JIT_CALL_SPECIALIZER_H_ #define RUNTIME_VM_COMPILER_JIT_JIT_CALL_SPECIALIZER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/compiler/call_specializer.h" namespace dart { diff --git a/runtime/vm/compiler/method_recognizer.cc b/runtime/vm/compiler/method_recognizer.cc index 99d186fddd7..9fb302edcfa 100644 --- a/runtime/vm/compiler/method_recognizer.cc +++ b/runtime/vm/compiler/method_recognizer.cc @@ -194,7 +194,6 @@ const char* MethodRecognizer::KindToCString(Kind kind) { return "?"; } -#if !defined(DART_PRECOMPILED_RUNTIME) void MethodRecognizer::InitializeState() { GrowableArray libs(3); Libraries(&libs); @@ -257,7 +256,6 @@ void MethodRecognizer::Libraries(GrowableArray* libs) { libs->Add(&Library::ZoneHandle(Library::AsyncLibrary())); libs->Add(&Library::ZoneHandle(Library::FfiLibrary())); } -#endif // !defined(DART_PRECOMPILED_RUNTIME) Token::Kind MethodTokenRecognizer::RecognizeTokenKind(const String& name_) { Thread* thread = Thread::Current(); diff --git a/runtime/vm/compiler/method_recognizer.h b/runtime/vm/compiler/method_recognizer.h index 1cf5d5b2fa6..7a34c46a4a1 100644 --- a/runtime/vm/compiler/method_recognizer.h +++ b/runtime/vm/compiler/method_recognizer.h @@ -55,12 +55,10 @@ class MethodRecognizer : public AllStatic { static intptr_t MethodKindToReceiverCid(Kind kind); static const char* KindToCString(Kind kind); -#if !defined(DART_PRECOMPILED_RUNTIME) static void InitializeState(); private: static void Libraries(GrowableArray* libs); -#endif // !defined(DART_PRECOMPILED_RUNTIME) }; // Recognizes token corresponding to a method name. @@ -69,13 +67,11 @@ class MethodTokenRecognizer : public AllStatic { static Token::Kind RecognizeTokenKind(const String& name); }; -#if !defined(DART_PRECOMPILED_RUNTIME) #define CHECK_FINGERPRINT2(f, p0, p1, fp) \ ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1, fp)) #define CHECK_FINGERPRINT3(f, p0, p1, p2, fp) \ ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp)) -#endif // !defined(DART_PRECOMPILED_RUNTIME) // Class that recognizes factories and returns corresponding result cid. class FactoryRecognizer : public AllStatic { diff --git a/runtime/vm/compiler/relocation.h b/runtime/vm/compiler/relocation.h index b373989118f..55dce95f6e1 100644 --- a/runtime/vm/compiler/relocation.h +++ b/runtime/vm/compiler/relocation.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_RELOCATION_H_ #define RUNTIME_VM_COMPILER_RELOCATION_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" #include "vm/image_snapshot.h" #include "vm/intrusive_dlist.h" diff --git a/runtime/vm/compiler/stub_code_compiler.cc b/runtime/vm/compiler/stub_code_compiler.cc index bd3fdc47284..7d91690ba5a 100644 --- a/runtime/vm/compiler/stub_code_compiler.cc +++ b/runtime/vm/compiler/stub_code_compiler.cc @@ -9,8 +9,6 @@ #include "vm/compiler/stub_code_compiler.h" -#if !defined(DART_PRECOMPILED_RUNTIME) - #include "vm/compiler/assembler/assembler.h" #define __ assembler-> @@ -83,5 +81,3 @@ void StubCodeCompiler::GenerateInstanceOfStub(Assembler* assembler) { } // namespace compiler } // namespace dart - -#endif // !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/compiler/stub_code_compiler.h b/runtime/vm/compiler/stub_code_compiler.h index 35f23fd39af..9eb40984b61 100644 --- a/runtime/vm/compiler/stub_code_compiler.h +++ b/runtime/vm/compiler/stub_code_compiler.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_STUB_CODE_COMPILER_H_ #define RUNTIME_VM_COMPILER_STUB_CODE_COMPILER_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + #include "vm/allocation.h" #include "vm/compiler/runtime_api.h" #include "vm/constants.h" diff --git a/runtime/vm/compiler/stub_code_compiler_arm.cc b/runtime/vm/compiler/stub_code_compiler_arm.cc index 8a6858be378..3abd73bafac 100644 --- a/runtime/vm/compiler/stub_code_compiler_arm.cc +++ b/runtime/vm/compiler/stub_code_compiler_arm.cc @@ -12,7 +12,7 @@ #include "vm/compiler/stub_code_compiler.h" -#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM) #include "vm/class_id.h" #include "vm/code_entry_kind.h" @@ -1349,9 +1349,11 @@ void StubCodeCompiler::GenerateInvokeDartCodeStub(Assembler* assembler) { // R3 : current thread. void StubCodeCompiler::GenerateInvokeDartCodeFromBytecodeStub( Assembler* assembler) { -#if defined(DART_PRECOMPILED_RUNTIME) - __ Stop("Not using interpreter"); -#else + if (FLAG_precompiled_mode) { + __ Stop("Not using interpreter"); + return; + } + __ Push(LR); // Marker for the profiler. __ EnterFrame((1 << FP) | (1 << LR), 0); @@ -1482,7 +1484,6 @@ void StubCodeCompiler::GenerateInvokeDartCodeFromBytecodeStub( __ LeaveFrame((1 << FP) | (1 << LR)); __ Drop(1); __ Ret(); -#endif // defined(DART_PRECOMPILED_RUNTIME) } // Helper to generate space allocation of context stub. @@ -2712,9 +2713,10 @@ void StubCodeCompiler::GenerateLazyCompileStub(Assembler* assembler) { // R4: Arguments descriptor. // R0: Function. void StubCodeCompiler::GenerateInterpretCallStub(Assembler* assembler) { -#if defined(DART_PRECOMPILED_RUNTIME) - __ Stop("Not using interpreter") -#else + if (FLAG_precompiled_mode) { + __ Stop("Not using interpreter"); + return; + } __ EnterStubFrame(); #if defined(DEBUG) @@ -2780,7 +2782,6 @@ void StubCodeCompiler::GenerateInterpretCallStub(Assembler* assembler) { __ LeaveStubFrame(); __ Ret(); -#endif // defined(DART_PRECOMPILED_RUNTIME) } // R9: Contains an ICData. @@ -3772,4 +3773,4 @@ void StubCodeCompiler::GenerateInstantiateTypeArgumentsMayShareFunctionTAStub( } // namespace dart -#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM) diff --git a/runtime/vm/compiler/stub_code_compiler_arm64.cc b/runtime/vm/compiler/stub_code_compiler_arm64.cc index ced883542e0..f0107e06896 100644 --- a/runtime/vm/compiler/stub_code_compiler_arm64.cc +++ b/runtime/vm/compiler/stub_code_compiler_arm64.cc @@ -11,7 +11,7 @@ #include "vm/compiler/stub_code_compiler.h" -#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_ARM64) #include "vm/class_id.h" #include "vm/code_entry_kind.h" @@ -1446,9 +1446,11 @@ void StubCodeCompiler::GenerateInvokeDartCodeStub(Assembler* assembler) { // R3 : current thread. void StubCodeCompiler::GenerateInvokeDartCodeFromBytecodeStub( Assembler* assembler) { -#if defined(DART_PRECOMPILED_RUNTIME) - __ Stop("Not using interpreter"); -#else + if (FLAG_precompiled_mode) { + __ Stop("Not using interpreter"); + return; + } + // Copy the C stack pointer (CSP/R31) into the stack pointer we'll actually // use to access the stack (SP/R15) and set the C stack pointer to near the // stack limit, loaded from the Thread held in R3, to prevent signal handlers @@ -1576,7 +1578,6 @@ void StubCodeCompiler::GenerateInvokeDartCodeFromBytecodeStub( __ Drop(1); __ RestoreCSP(); __ ret(); -#endif // defined(DART_PRECOMPILED_RUNTIME) } // Helper to generate space allocation of context stub. @@ -2841,9 +2842,11 @@ void StubCodeCompiler::GenerateLazyCompileStub(Assembler* assembler) { // R4: Arguments descriptor. // R0: Function. void StubCodeCompiler::GenerateInterpretCallStub(Assembler* assembler) { -#if defined(DART_PRECOMPILED_RUNTIME) - __ Stop("Not using interpreter") -#else + if (FLAG_precompiled_mode) { + __ Stop("Not using interpreter"); + return; + } + __ SetPrologueOffset(); __ EnterStubFrame(); @@ -2919,7 +2922,6 @@ void StubCodeCompiler::GenerateInterpretCallStub(Assembler* assembler) { __ LeaveStubFrame(); __ ret(); -#endif // defined(DART_PRECOMPILED_RUNTIME) } // R5: Contains an ICData. @@ -3909,4 +3911,4 @@ void StubCodeCompiler::GenerateInstantiateTypeArgumentsMayShareFunctionTAStub( } // namespace dart -#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_ARM64) diff --git a/runtime/vm/compiler/stub_code_compiler_ia32.cc b/runtime/vm/compiler/stub_code_compiler_ia32.cc index 15a5c895ad6..1bfc1d50c3b 100644 --- a/runtime/vm/compiler/stub_code_compiler_ia32.cc +++ b/runtime/vm/compiler/stub_code_compiler_ia32.cc @@ -11,7 +11,7 @@ #include "vm/compiler/stub_code_compiler.h" -#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_IA32) #include "vm/class_id.h" #include "vm/code_entry_kind.h" @@ -3029,4 +3029,4 @@ void StubCodeCompiler::GenerateInstantiateTypeArgumentsMayShareFunctionTAStub( } // namespace dart -#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_IA32) diff --git a/runtime/vm/compiler/stub_code_compiler_x64.cc b/runtime/vm/compiler/stub_code_compiler_x64.cc index 9a2b2c74d76..1b1b809e9a7 100644 --- a/runtime/vm/compiler/stub_code_compiler_x64.cc +++ b/runtime/vm/compiler/stub_code_compiler_x64.cc @@ -13,7 +13,7 @@ #include "vm/compiler/backend/locations.h" #include "vm/compiler/stub_code_compiler.h" -#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME) +#if defined(TARGET_ARCH_X64) #include "vm/class_id.h" #include "vm/code_entry_kind.h" @@ -1338,9 +1338,11 @@ void StubCodeCompiler::GenerateInvokeDartCodeStub(Assembler* assembler) { // RCX : current thread. void StubCodeCompiler::GenerateInvokeDartCodeFromBytecodeStub( Assembler* assembler) { -#if defined(DART_PRECOMPILED_RUNTIME) - __ Stop("Not using interpreter"); -#else + if (FLAG_precompiled_mode) { + __ Stop("Not using interpreter"); + return; + } + __ pushq(Address(RSP, 0)); // Marker for the profiler. __ EnterFrame(0); @@ -1484,7 +1486,6 @@ void StubCodeCompiler::GenerateInvokeDartCodeFromBytecodeStub( __ popq(RCX); __ ret(); -#endif // defined(DART_PRECOMPILED_RUNTIME) } // Helper to generate space allocation of context stub. @@ -2761,9 +2762,11 @@ void StubCodeCompiler::GenerateLazyCompileStub(Assembler* assembler) { // R10: Arguments descriptor. // RAX: Function. void StubCodeCompiler::GenerateInterpretCallStub(Assembler* assembler) { -#if defined(DART_PRECOMPILED_RUNTIME) - __ Stop("Not using interpreter"); -#else + if (FLAG_precompiled_mode) { + __ Stop("Not using interpreter"); + return; + } + __ EnterStubFrame(); #if defined(DEBUG) @@ -2833,7 +2836,6 @@ void StubCodeCompiler::GenerateInterpretCallStub(Assembler* assembler) { __ LeaveStubFrame(); __ ret(); -#endif // defined(DART_PRECOMPILED_RUNTIME) } // RBX: Contains an ICData. @@ -3798,4 +3800,4 @@ void StubCodeCompiler::GenerateInstantiateTypeArgumentsMayShareFunctionTAStub( } // namespace dart -#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME) +#endif // defined(TARGET_ARCH_X64) diff --git a/runtime/vm/compiler/write_barrier_elimination.h b/runtime/vm/compiler/write_barrier_elimination.h index 88109e720f2..b4d200f3683 100644 --- a/runtime/vm/compiler/write_barrier_elimination.h +++ b/runtime/vm/compiler/write_barrier_elimination.h @@ -5,6 +5,10 @@ #ifndef RUNTIME_VM_COMPILER_WRITE_BARRIER_ELIMINATION_H_ #define RUNTIME_VM_COMPILER_WRITE_BARRIER_ELIMINATION_H_ +#if defined(DART_PRECOMPILED_RUNTIME) +#error "AOT runtime should not use compiler sources (including header files)" +#endif // defined(DART_PRECOMPILED_RUNTIME) + namespace dart { class FlowGraph;