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

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

Issue 3006923002: Revised "Eliminate dependencies on assemblers and code stubs in precompiled runtime." (Closed)
Patch Set: Explicitly clear unbox_numeric_fields flag in PRODUCT builds Created 3 years, 3 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_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 if (code.raw() == weak_property.key()) { 53 if (code.raw() == weak_property.key()) {
54 return true; 54 return true;
55 } 55 }
56 } 56 }
57 return false; 57 return false;
58 } 58 }
59 59
60 void WeakCodeReferences::DisableCode() { 60 void WeakCodeReferences::DisableCode() {
61 Thread* thread = Thread::Current(); 61 Thread* thread = Thread::Current();
62 const Array& code_objects = Array::Handle(thread->zone(), array_.raw()); 62 const Array& code_objects = Array::Handle(thread->zone(), array_.raw());
63 #if defined(DART_PRECOMPILED_RUNTIME)
64 ASSERT(code_objects.IsNull());
65 return;
66 #else
63 if (code_objects.IsNull()) { 67 if (code_objects.IsNull()) {
64 return; 68 return;
65 } 69 }
66 ASSERT(!FLAG_precompiled_runtime); 70
67 UpdateArrayTo(Object::null_array()); 71 UpdateArrayTo(Object::null_array());
68 // Disable all code on stack. 72 // Disable all code on stack.
69 Code& code = Code::Handle(); 73 Code& code = Code::Handle();
70 { 74 {
71 DartFrameIterator iterator(thread, 75 DartFrameIterator iterator(thread,
72 StackFrameIterator::kNoCrossThreadIteration); 76 StackFrameIterator::kNoCrossThreadIteration);
73 StackFrame* frame = iterator.NextFrame(); 77 StackFrame* frame = iterator.NextFrame();
74 while (frame != NULL) { 78 while (frame != NULL) {
75 code = frame->LookupDartCode(); 79 code = frame->LookupDartCode();
76 if (IsOptimizedCode(code_objects, code)) { 80 if (IsOptimizedCode(code_objects, code)) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 code.DisableDartCode(); 126 code.DisableDartCode();
123 } 127 }
124 } else { 128 } else {
125 // Make non-OSR code non-entrant. 129 // Make non-OSR code non-entrant.
126 if (!code.IsDisabled()) { 130 if (!code.IsDisabled()) {
127 ReportSwitchingCode(code); 131 ReportSwitchingCode(code);
128 code.DisableDartCode(); 132 code.DisableDartCode();
129 } 133 }
130 } 134 }
131 } 135 }
136 #endif // defined(DART_PRECOMPILED_RUNTIME)
132 } 137 }
133 138
134 } // namespace dart 139 } // 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