Skip to content

Commit

Permalink
Make JIT work on iPhone armv7 (flutter#11038)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnfield authored Aug 16, 2019
1 parent 4b7a552 commit c29c9bc
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions runtime/dart_vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ static const char* kDartWriteProtectCodeArgs[] = {
"--no_write_protect_code",
};

FML_ALLOW_UNUSED_TYPE
static const char* kDartDisableIntegerDivisionArgs[] = {
"--no_use_integer_division",
};

static const char* kDartAssertArgs[] = {
// clang-format off
"--enable_asserts",
Expand Down Expand Up @@ -324,8 +329,16 @@ DartVM::DartVM(std::shared_ptr<const DartVMData> vm_data,
fml::size(kDartWriteProtectCodeArgs));
#else
EnsureDebuggedIOS(settings_);
#endif
#endif
#if TARGET_CPU_ARM
// Tell Dart in JIT mode to not use integer division on armv7
// Ideally, this would be detected at runtime by Dart.
// TODO(dnfield): Remove this code
// https://github.com/dart-lang/sdk/issues/24743
PushBackAll(&args, kDartDisableIntegerDivisionArgs,
fml::size(kDartDisableIntegerDivisionArgs));
#endif // TARGET_CPU_ARM
#endif // !OS_IOS || TARGET_OS_SIMULATOR
#endif // (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG)

if (enable_asserts) {
PushBackAll(&args, kDartAssertArgs, fml::size(kDartAssertArgs));
Expand Down

0 comments on commit c29c9bc

Please sign in to comment.