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

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

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month 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/visitor.h ('k') | runtime/vm/weak_table.h » ('j') | 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"
(...skipping 14 matching lines...) Expand all
25 for (intptr_t i = 0; i < array_.Length(); i++) { 25 for (intptr_t i = 0; i < array_.Length(); i++) {
26 weak_property ^= array_.At(i); 26 weak_property ^= array_.At(i);
27 if (weak_property.key() == Code::null()) { 27 if (weak_property.key() == Code::null()) {
28 // Empty property found. Reuse it. 28 // Empty property found. Reuse it.
29 weak_property.set_key(value); 29 weak_property.set_key(value);
30 return; 30 return;
31 } 31 }
32 } 32 }
33 } 33 }
34 34
35 const WeakProperty& weak_property = WeakProperty::Handle( 35 const WeakProperty& weak_property =
36 WeakProperty::New(Heap::kOld)); 36 WeakProperty::Handle(WeakProperty::New(Heap::kOld));
37 weak_property.set_key(value); 37 weak_property.set_key(value);
38 38
39 intptr_t length = array_.IsNull() ? 0 : array_.Length(); 39 intptr_t length = array_.IsNull() ? 0 : array_.Length();
40 const Array& new_array = Array::Handle( 40 const Array& new_array =
41 Array::Grow(array_, length + 1, Heap::kOld)); 41 Array::Handle(Array::Grow(array_, length + 1, Heap::kOld));
42 new_array.SetAt(length, weak_property); 42 new_array.SetAt(length, weak_property);
43 UpdateArrayTo(new_array); 43 UpdateArrayTo(new_array);
44 } 44 }
45 45
46 46
47 bool WeakCodeReferences::IsOptimizedCode(const Array& dependent_code, 47 bool WeakCodeReferences::IsOptimizedCode(const Array& dependent_code,
48 const Code& code) { 48 const Code& code) {
49 if (!code.is_optimized()) { 49 if (!code.is_optimized()) {
50 return false; 50 return false;
51 } 51 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // Make non-OSR code non-entrant. 126 // Make non-OSR code non-entrant.
127 if (!code.IsDisabled()) { 127 if (!code.IsDisabled()) {
128 ReportSwitchingCode(code); 128 ReportSwitchingCode(code);
129 code.DisableDartCode(); 129 code.DisableDartCode();
130 } 130 }
131 } 131 }
132 } 132 }
133 } 133 }
134 134
135 } // namespace dart 135 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/visitor.h ('k') | runtime/vm/weak_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698