Skip to content

Commit 76a0050

Browse files
committed
[VM] Make us compile with debug-optimization-level=0 again
After [0] landed our debug builders managed to still compile, because the default debug-optimization-level allows the compiler to inline. This caused a "CanReload() const { return false; }" to be inlined and constant folded, so the call to ReloadSources() was eliminated. Compiling with debug-optimization-level=0 disables inlining and keeps the call, which gives us a linker error when building the dart_precompiled_runtime target. [0] https://codereview.chromium.org/2997243002 [email protected] Review-Url: https://codereview.chromium.org/3003383002 .
1 parent da2397a commit 76a0050

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

runtime/vm/isolate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,15 @@ class Isolate : public BaseIsolate {
283283
void DoneLoading();
284284
void DoneFinalizing();
285285

286+
#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
286287
// By default the reload context is deleted. This parameter allows
287288
// the caller to delete is separately if it is still needed.
288289
bool ReloadSources(JSONStream* js,
289290
bool force_reload,
290291
const char* root_script_url = NULL,
291292
const char* packages_url = NULL,
292293
bool dont_delete_reload_context = false);
294+
#endif // !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
293295

294296
bool MakeRunnable();
295297
void Run();

runtime/vm/service.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,6 +2559,7 @@ static const MethodParameter* reload_sources_params[] = {
25592559
};
25602560

25612561
static bool ReloadSources(Thread* thread, JSONStream* js) {
2562+
#if !defined(DART_PRECOMPILED_RUNTIME)
25622563
Isolate* isolate = thread->isolate();
25632564
if (!isolate->compilation_allowed()) {
25642565
js->PrintError(kFeatureDisabled,
@@ -2596,6 +2597,11 @@ static bool ReloadSources(Thread* thread, JSONStream* js) {
25962597
Service::CheckForPause(isolate, js);
25972598

25982599
return true;
2600+
#else // !defined(DART_PRECOMPILED_RUNTIME)
2601+
js->PrintError(kFeatureDisabled,
2602+
"This isolate cannot reload sources right now.");
2603+
return true;
2604+
#endif // !defined(DART_PRECOMPILED_RUNTIME)
25992605
}
26002606

26012607
void Service::CheckForPause(Isolate* isolate, JSONStream* stream) {

0 commit comments

Comments
 (0)