Chromium Code Reviews| 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 "vm/isolate.h" | 5 #include "vm/isolate.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/json.h" | 9 #include "platform/json.h" |
| 10 #include "vm/code_observers.h" | 10 #include "vm/code_observers.h" |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 486 last_allocationprofile_accumulator_reset_timestamp_(0), | 486 last_allocationprofile_accumulator_reset_timestamp_(0), |
| 487 last_allocationprofile_gc_timestamp_(0), | 487 last_allocationprofile_gc_timestamp_(0), |
| 488 cha_(NULL), | 488 cha_(NULL), |
| 489 object_id_ring_(NULL), | 489 object_id_ring_(NULL), |
| 490 trace_buffer_(NULL), | 490 trace_buffer_(NULL), |
| 491 profiler_data_(NULL), | 491 profiler_data_(NULL), |
| 492 thread_state_(NULL), | 492 thread_state_(NULL), |
| 493 tag_table_(GrowableObjectArray::null()), | 493 tag_table_(GrowableObjectArray::null()), |
| 494 current_tag_(UserTag::null()), | 494 current_tag_(UserTag::null()), |
| 495 default_tag_(UserTag::null()), | 495 default_tag_(UserTag::null()), |
| 496 deoptimized_code_array_(GrowableObjectArray::null()), | |
| 496 metrics_list_head_(NULL), | 497 metrics_list_head_(NULL), |
| 497 next_(NULL), | 498 next_(NULL), |
| 498 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) | 499 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) |
| 499 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) | 500 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) |
| 500 reusable_handles_() { | 501 reusable_handles_() { |
| 501 set_vm_tag(VMTag::kIdleTagId); | 502 set_vm_tag(VMTag::kIdleTagId); |
| 502 set_user_tag(UserTags::kDefaultUserTag); | 503 set_user_tag(UserTags::kDefaultUserTag); |
| 503 } | 504 } |
| 504 | 505 |
| 505 Isolate::Isolate(Isolate* original) | 506 Isolate::Isolate(Isolate* original) |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1244 | 1245 |
| 1245 // Visit the current tag which is stored in the isolate. | 1246 // Visit the current tag which is stored in the isolate. |
| 1246 visitor->VisitPointer(reinterpret_cast<RawObject**>(¤t_tag_)); | 1247 visitor->VisitPointer(reinterpret_cast<RawObject**>(¤t_tag_)); |
| 1247 | 1248 |
| 1248 // Visit the default tag which is stored in the isolate. | 1249 // Visit the default tag which is stored in the isolate. |
| 1249 visitor->VisitPointer(reinterpret_cast<RawObject**>(&default_tag_)); | 1250 visitor->VisitPointer(reinterpret_cast<RawObject**>(&default_tag_)); |
| 1250 | 1251 |
| 1251 // Visit the tag table which is stored in the isolate. | 1252 // Visit the tag table which is stored in the isolate. |
| 1252 visitor->VisitPointer(reinterpret_cast<RawObject**>(&tag_table_)); | 1253 visitor->VisitPointer(reinterpret_cast<RawObject**>(&tag_table_)); |
| 1253 | 1254 |
| 1255 // Visit the deoptimized code array which is stored in the isolate. | |
| 1256 visitor->VisitPointer( | |
| 1257 reinterpret_cast<RawObject**>(&deoptimized_code_array_)); | |
| 1258 | |
| 1254 // Visit objects in the debugger. | 1259 // Visit objects in the debugger. |
| 1255 debugger()->VisitObjectPointers(visitor); | 1260 debugger()->VisitObjectPointers(visitor); |
| 1256 | 1261 |
| 1257 // Visit objects that are being used for deoptimization. | 1262 // Visit objects that are being used for deoptimization. |
| 1258 if (deopt_context() != NULL) { | 1263 if (deopt_context() != NULL) { |
| 1259 deopt_context()->VisitObjectPointers(visitor); | 1264 deopt_context()->VisitObjectPointers(visitor); |
| 1260 } | 1265 } |
| 1261 } | 1266 } |
| 1262 | 1267 |
| 1263 | 1268 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1441 set_user_tag(user_tag); | 1446 set_user_tag(user_tag); |
| 1442 current_tag_ = tag.raw(); | 1447 current_tag_ = tag.raw(); |
| 1443 } | 1448 } |
| 1444 | 1449 |
| 1445 | 1450 |
| 1446 void Isolate::set_default_tag(const UserTag& tag) { | 1451 void Isolate::set_default_tag(const UserTag& tag) { |
| 1447 default_tag_ = tag.raw(); | 1452 default_tag_ = tag.raw(); |
| 1448 } | 1453 } |
| 1449 | 1454 |
| 1450 | 1455 |
| 1456 void Isolate::set_deoptimized_code_array(const GrowableObjectArray& value) { | |
| 1457 deoptimized_code_array_ = value.raw(); | |
|
siva
2015/02/25 22:58:39
StorePointer(...);
I think we are missing this wi
Cutch
2015/02/26 18:44:40
Acknowledged.
| |
| 1458 } | |
| 1459 | |
| 1460 | |
| 1461 void Isolate::TrackDeoptimizedCode(const Code& code) { | |
| 1462 ASSERT(!code.IsNull()); | |
| 1463 const GrowableObjectArray& deoptimized_code = | |
| 1464 GrowableObjectArray::Handle(deoptimized_code_array()); | |
| 1465 if (deoptimized_code.IsNull()) { | |
| 1466 // Not tracking deoptimized code. | |
| 1467 return; | |
| 1468 } | |
| 1469 deoptimized_code.Add(code); | |
|
siva
2015/02/25 22:58:39
Can you add a TODO here that we will make this and
Cutch
2015/02/26 18:44:40
Done.
| |
| 1470 } | |
| 1471 | |
| 1472 | |
| 1451 void Isolate::VisitIsolates(IsolateVisitor* visitor) { | 1473 void Isolate::VisitIsolates(IsolateVisitor* visitor) { |
| 1452 if (visitor == NULL) { | 1474 if (visitor == NULL) { |
| 1453 return; | 1475 return; |
| 1454 } | 1476 } |
| 1455 MonitorLocker ml(isolates_list_monitor_); | 1477 MonitorLocker ml(isolates_list_monitor_); |
| 1456 Isolate* current = isolates_list_head_; | 1478 Isolate* current = isolates_list_head_; |
| 1457 while (current) { | 1479 while (current) { |
| 1458 visitor->VisitIsolate(current); | 1480 visitor->VisitIsolate(current); |
| 1459 current = current->next_; | 1481 current = current->next_; |
| 1460 } | 1482 } |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1700 serialized_message_, serialized_message_len_); | 1722 serialized_message_, serialized_message_len_); |
| 1701 } | 1723 } |
| 1702 | 1724 |
| 1703 | 1725 |
| 1704 void IsolateSpawnState::Cleanup() { | 1726 void IsolateSpawnState::Cleanup() { |
| 1705 SwitchIsolateScope switch_scope(I); | 1727 SwitchIsolateScope switch_scope(I); |
| 1706 Dart::ShutdownIsolate(); | 1728 Dart::ShutdownIsolate(); |
| 1707 } | 1729 } |
| 1708 | 1730 |
| 1709 } // namespace dart | 1731 } // namespace dart |
| OLD | NEW |