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

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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 return isolate->GetStatusStackFrame(frame_index); 1063 return isolate->GetStatusStackFrame(frame_index);
1062 } 1064 }
1063 } 1065 }
1064 1066
1065 // TODO(tball): "/isolate/<handle>/stacktrace/<frame-index>"/disassemble" 1067 // TODO(tball): "/isolate/<handle>/stacktrace/<frame-index>"/disassemble"
1066 1068
1067 return NULL; // Unimplemented query. 1069 return NULL; // Unimplemented query.
1068 } 1070 }
1069 1071
1070 1072
1073 void Isolate::set_object_id_ring(ObjectIdRing* ring) {
1074 ASSERT(heap_ != NULL);
1075 object_id_ring_ = ring;
1076 if (ring == NULL) {
1077 heap_->set_object_id_ring_table(NULL, 0);
1078 } else {
1079 heap_->set_object_id_ring_table(ring->table_, ring->capacity_);
1080 }
1081 }
1082
1083
1071 template<class T> 1084 template<class T>
1072 T* Isolate::AllocateReusableHandle() { 1085 T* Isolate::AllocateReusableHandle() {
1073 T* handle = reinterpret_cast<T*>(reusable_handles_.AllocateScopedHandle()); 1086 T* handle = reinterpret_cast<T*>(reusable_handles_.AllocateScopedHandle());
1074 T::initializeHandle(handle, T::null()); 1087 T::initializeHandle(handle, T::null());
1075 return handle; 1088 return handle;
1076 } 1089 }
1077 1090
1078 1091
1079 static void FillDeferredSlots(DeferredSlot** slot_list) { 1092 static void FillDeferredSlots(DeferredSlot** slot_list) {
1080 DeferredSlot* slot = *slot_list; 1093 DeferredSlot* slot = *slot_list;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 return func.raw(); 1207 return func.raw();
1195 } 1208 }
1196 1209
1197 1210
1198 void IsolateSpawnState::Cleanup() { 1211 void IsolateSpawnState::Cleanup() {
1199 SwitchIsolateScope switch_scope(isolate()); 1212 SwitchIsolateScope switch_scope(isolate());
1200 Dart::ShutdownIsolate(); 1213 Dart::ShutdownIsolate();
1201 } 1214 }
1202 1215
1203 } // namespace dart 1216 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/object_id_ring.h » ('j') | runtime/vm/object_id_ring.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698