Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Side by Side Diff: runtime/vm/weak_code.cc

Issue 1731743003: Move precompilation-related flags to flags list. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: make print_stop_message default false to fix build Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/stub_code_x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/weak_code.h" 5 #include "vm/weak_code.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 8
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
11 #include "vm/object.h" 11 #include "vm/object.h"
12 #include "vm/stack_frame.h" 12 #include "vm/stack_frame.h"
13 13
14 namespace dart { 14 namespace dart {
15 15
16 DECLARE_FLAG(bool, precompilation);
17
18 bool WeakCodeReferences::HasCodes() const { 16 bool WeakCodeReferences::HasCodes() const {
19 return !array_.IsNull() && (array_.Length() > 0); 17 return !array_.IsNull() && (array_.Length() > 0);
20 } 18 }
21 19
22 20
23 void WeakCodeReferences::Register(const Code& value) { 21 void WeakCodeReferences::Register(const Code& value) {
24 if (!array_.IsNull()) { 22 if (!array_.IsNull()) {
25 // Try to find and reuse cleared WeakProperty to avoid allocating new one. 23 // Try to find and reuse cleared WeakProperty to avoid allocating new one.
26 WeakProperty& weak_property = WeakProperty::Handle(); 24 WeakProperty& weak_property = WeakProperty::Handle();
27 for (intptr_t i = 0; i < array_.Length(); i++) { 25 for (intptr_t i = 0; i < array_.Length(); i++) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return false; 59 return false;
62 } 60 }
63 61
64 62
65 void WeakCodeReferences::DisableCode() { 63 void WeakCodeReferences::DisableCode() {
66 IncrementInvalidationGen(); 64 IncrementInvalidationGen();
67 const Array& code_objects = Array::Handle(array_.raw()); 65 const Array& code_objects = Array::Handle(array_.raw());
68 if (code_objects.IsNull()) { 66 if (code_objects.IsNull()) {
69 return; 67 return;
70 } 68 }
71 ASSERT(!FLAG_precompilation); 69 ASSERT(!FLAG_precompiled_mode);
72 UpdateArrayTo(Object::null_array()); 70 UpdateArrayTo(Object::null_array());
73 // Disable all code on stack. 71 // Disable all code on stack.
74 Code& code = Code::Handle(); 72 Code& code = Code::Handle();
75 { 73 {
76 DartFrameIterator iterator; 74 DartFrameIterator iterator;
77 StackFrame* frame = iterator.NextFrame(); 75 StackFrame* frame = iterator.NextFrame();
78 while (frame != NULL) { 76 while (frame != NULL) {
79 code = frame->LookupDartCode(); 77 code = frame->LookupDartCode();
80 if (IsOptimizedCode(code_objects, code)) { 78 if (IsOptimizedCode(code_objects, code)) {
81 ReportDeoptimization(code); 79 ReportDeoptimization(code);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Make non-OSR code non-entrant. 126 // Make non-OSR code non-entrant.
129 if (!code.IsDisabled()) { 127 if (!code.IsDisabled()) {
130 ReportSwitchingCode(code); 128 ReportSwitchingCode(code);
131 code.DisableDartCode(); 129 code.DisableDartCode();
132 } 130 }
133 } 131 }
134 } 132 }
135 } 133 }
136 134
137 } // namespace dart 135 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698