OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "platform/address_sanitizer.h" | 5 #include "platform/address_sanitizer.h" |
6 #include "platform/memory_sanitizer.h" | 6 #include "platform/memory_sanitizer.h" |
7 #include "platform/utils.h" | 7 #include "platform/utils.h" |
8 | 8 |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 } | 1118 } |
1119 | 1119 |
1120 | 1120 |
1121 CodeLookupTable::CodeLookupTable(Thread* thread) { | 1121 CodeLookupTable::CodeLookupTable(Thread* thread) { |
1122 Build(thread); | 1122 Build(thread); |
1123 } | 1123 } |
1124 | 1124 |
1125 | 1125 |
1126 class CodeLookupTableBuilder : public ObjectVisitor { | 1126 class CodeLookupTableBuilder : public ObjectVisitor { |
1127 public: | 1127 public: |
1128 CodeLookupTableBuilder(Isolate* isolate, CodeLookupTable* table) | 1128 explicit CodeLookupTableBuilder(CodeLookupTable* table) : table_(table) { |
1129 : ObjectVisitor(isolate), | |
1130 table_(table) { | |
1131 ASSERT(table_ != NULL); | 1129 ASSERT(table_ != NULL); |
1132 } | 1130 } |
1133 | 1131 |
1134 ~CodeLookupTableBuilder() { | 1132 ~CodeLookupTableBuilder() { |
1135 } | 1133 } |
1136 | 1134 |
1137 void VisitObject(RawObject* raw_obj) { | 1135 void VisitObject(RawObject* raw_obj) { |
1138 uword tags = raw_obj->ptr()->tags_; | 1136 uword tags = raw_obj->ptr()->tags_; |
1139 if (RawObject::ClassIdTag::decode(tags) == kCodeCid) { | 1137 if (RawObject::ClassIdTag::decode(tags) == kCodeCid) { |
1140 RawCode* raw_code = reinterpret_cast<RawCode*>(raw_obj); | 1138 RawCode* raw_code = reinterpret_cast<RawCode*>(raw_obj); |
(...skipping 15 matching lines...) Expand all Loading... |
1156 ASSERT(thread != NULL); | 1154 ASSERT(thread != NULL); |
1157 Isolate* isolate = thread->isolate(); | 1155 Isolate* isolate = thread->isolate(); |
1158 ASSERT(isolate != NULL); | 1156 ASSERT(isolate != NULL); |
1159 Isolate* vm_isolate = Dart::vm_isolate(); | 1157 Isolate* vm_isolate = Dart::vm_isolate(); |
1160 ASSERT(vm_isolate != NULL); | 1158 ASSERT(vm_isolate != NULL); |
1161 | 1159 |
1162 // Clear. | 1160 // Clear. |
1163 code_objects_.Clear(); | 1161 code_objects_.Clear(); |
1164 | 1162 |
1165 // Add all found Code objects. | 1163 // Add all found Code objects. |
1166 CodeLookupTableBuilder cltb(isolate, this); | 1164 CodeLookupTableBuilder cltb(this); |
1167 vm_isolate->heap()->IterateOldObjects(&cltb); | 1165 vm_isolate->heap()->IterateOldObjects(&cltb); |
1168 isolate->heap()->IterateOldObjects(&cltb); | 1166 isolate->heap()->IterateOldObjects(&cltb); |
1169 | 1167 |
1170 // Sort by entry. | 1168 // Sort by entry. |
1171 code_objects_.Sort(CodeDescriptor::Compare); | 1169 code_objects_.Sort(CodeDescriptor::Compare); |
1172 | 1170 |
1173 #if defined(DEBUG) | 1171 #if defined(DEBUG) |
1174 if (length() <= 1) { | 1172 if (length() <= 1) { |
1175 return; | 1173 return; |
1176 } | 1174 } |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1425 | 1423 |
1426 | 1424 |
1427 ProcessedSampleBuffer::ProcessedSampleBuffer() | 1425 ProcessedSampleBuffer::ProcessedSampleBuffer() |
1428 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { | 1426 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { |
1429 ASSERT(code_lookup_table_ != NULL); | 1427 ASSERT(code_lookup_table_ != NULL); |
1430 } | 1428 } |
1431 | 1429 |
1432 #endif // !PRODUCT | 1430 #endif // !PRODUCT |
1433 | 1431 |
1434 } // namespace dart | 1432 } // namespace dart |
OLD | NEW |