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

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

Issue 18259014: Object ID Ring with tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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 "lib/mirrors.h" 10 #include "lib/mirrors.h"
11 #include "vm/code_observers.h" 11 #include "vm/code_observers.h"
12 #include "vm/compiler_stats.h" 12 #include "vm/compiler_stats.h"
13 #include "vm/dart_api_state.h" 13 #include "vm/dart_api_state.h"
14 #include "vm/dart_entry.h" 14 #include "vm/dart_entry.h"
15 #include "vm/debugger.h" 15 #include "vm/debugger.h"
16 #include "vm/heap.h" 16 #include "vm/heap.h"
17 #include "vm/heap_histogram.h" 17 #include "vm/heap_histogram.h"
18 #include "vm/message_handler.h" 18 #include "vm/message_handler.h"
19 #include "vm/object_store.h" 19 #include "vm/object_store.h"
20 #include "vm/parser.h" 20 #include "vm/parser.h"
21 #include "vm/port.h" 21 #include "vm/port.h"
22 #include "vm/simulator.h" 22 #include "vm/simulator.h"
23 #include "vm/stack_frame.h" 23 #include "vm/stack_frame.h"
24 #include "vm/stub_code.h" 24 #include "vm/stub_code.h"
25 #include "vm/symbols.h" 25 #include "vm/symbols.h"
26 #include "vm/thread.h" 26 #include "vm/thread.h"
27 #include "vm/timer.h" 27 #include "vm/timer.h"
28 #include "vm/visitor.h" 28 #include "vm/visitor.h"
29 #include "vm/object_id_ring.h"
29 30
30 namespace dart { 31 namespace dart {
31 32
32 DEFINE_FLAG(bool, report_usage_count, false, 33 DEFINE_FLAG(bool, report_usage_count, false,
33 "Track function usage and report."); 34 "Track function usage and report.");
34 DEFINE_FLAG(bool, trace_isolates, false, 35 DEFINE_FLAG(bool, trace_isolates, false,
35 "Trace isolate creation and shut down."); 36 "Trace isolate creation and shut down.");
36 DECLARE_FLAG(bool, trace_deoptimization_verbose); 37 DECLARE_FLAG(bool, trace_deoptimization_verbose);
37 38
38 39
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 deopt_fpu_registers_copy_(NULL), 409 deopt_fpu_registers_copy_(NULL),
409 deopt_frame_copy_(NULL), 410 deopt_frame_copy_(NULL),
410 deopt_frame_copy_size_(0), 411 deopt_frame_copy_size_(0),
411 deferred_boxes_(NULL), 412 deferred_boxes_(NULL),
412 deferred_object_refs_(NULL), 413 deferred_object_refs_(NULL),
413 deferred_objects_count_(0), 414 deferred_objects_count_(0),
414 deferred_objects_(NULL), 415 deferred_objects_(NULL),
415 stacktrace_(NULL), 416 stacktrace_(NULL),
416 stack_frame_index_(-1), 417 stack_frame_index_(-1),
417 object_histogram_(NULL), 418 object_histogram_(NULL),
419 object_id_ring_(NULL),
418 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) 420 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
419 reusable_handles_() { 421 reusable_handles_() {
420 if (FLAG_print_object_histogram && (Dart::vm_isolate() != NULL)) { 422 if (FLAG_print_object_histogram && (Dart::vm_isolate() != NULL)) {
421 object_histogram_ = new ObjectHistogram(this); 423 object_histogram_ = new ObjectHistogram(this);
422 } 424 }
423 } 425 }
424 #undef REUSABLE_HANDLE_INITIALIZERS 426 #undef REUSABLE_HANDLE_INITIALIZERS
425 427
426 428
427 Isolate::~Isolate() { 429 Isolate::~Isolate() {
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 return isolate->GetStatusStackFrame(frame_index); 1064 return isolate->GetStatusStackFrame(frame_index);
1063 } 1065 }
1064 } 1066 }
1065 1067
1066 // TODO(tball): "/isolate/<handle>/stacktrace/<frame-index>"/disassemble" 1068 // TODO(tball): "/isolate/<handle>/stacktrace/<frame-index>"/disassemble"
1067 1069
1068 return NULL; // Unimplemented query. 1070 return NULL; // Unimplemented query.
1069 } 1071 }
1070 1072
1071 1073
1074 void Isolate::set_object_id_ring(ObjectIdRing* ring) {
Ivan Posva 2013/07/10 01:10:13 If the code is this involved and not in the header
Cutch 2013/07/10 17:23:10 Done.
1075 ASSERT(heap_ != NULL);
1076 object_id_ring_ = ring;
1077 if (ring == NULL) {
1078 heap_->set_object_id_ring_table(NULL, 0);
1079 } else {
1080 heap_->set_object_id_ring_table(ring->table_, ring->capacity_);
1081 }
1082 }
1083
1084
1072 template<class T> 1085 template<class T>
1073 T* Isolate::AllocateReusableHandle() { 1086 T* Isolate::AllocateReusableHandle() {
1074 T* handle = reinterpret_cast<T*>(reusable_handles_.AllocateScopedHandle()); 1087 T* handle = reinterpret_cast<T*>(reusable_handles_.AllocateScopedHandle());
1075 T::initializeHandle(handle, T::null()); 1088 T::initializeHandle(handle, T::null());
1076 return handle; 1089 return handle;
1077 } 1090 }
1078 1091
1079 1092
1080 static void FillDeferredSlots(DeferredSlot** slot_list) { 1093 static void FillDeferredSlots(DeferredSlot** slot_list) {
1081 DeferredSlot* slot = *slot_list; 1094 DeferredSlot* slot = *slot_list;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 return func.raw(); 1208 return func.raw();
1196 } 1209 }
1197 1210
1198 1211
1199 void IsolateSpawnState::Cleanup() { 1212 void IsolateSpawnState::Cleanup() {
1200 SwitchIsolateScope switch_scope(isolate()); 1213 SwitchIsolateScope switch_scope(isolate());
1201 Dart::ShutdownIsolate(); 1214 Dart::ShutdownIsolate();
1202 } 1215 }
1203 1216
1204 } // namespace dart 1217 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698