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

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

Issue 2683633005: Add exception handler cache to isolate (Closed)
Patch Set: Add unittest Created 3 years, 10 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/heap.h" 5 #include "vm/heap.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 if (BeginOldSpaceGC(thread)) { 395 if (BeginOldSpaceGC(thread)) {
396 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks); 396 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
397 RecordBeforeGC(kOld, reason); 397 RecordBeforeGC(kOld, reason);
398 VMTagScope tagScope(thread, VMTag::kGCOldSpaceTagId); 398 VMTagScope tagScope(thread, VMTag::kGCOldSpaceTagId);
399 TIMELINE_FUNCTION_GC_DURATION(thread, "CollectOldGeneration"); 399 TIMELINE_FUNCTION_GC_DURATION(thread, "CollectOldGeneration");
400 NOT_IN_PRODUCT(UpdateClassHeapStatsBeforeGC(kOld)); 400 NOT_IN_PRODUCT(UpdateClassHeapStatsBeforeGC(kOld));
401 old_space_.MarkSweep(invoke_api_callbacks); 401 old_space_.MarkSweep(invoke_api_callbacks);
402 RecordAfterGC(kOld); 402 RecordAfterGC(kOld);
403 PrintStats(); 403 PrintStats();
404 NOT_IN_PRODUCT(PrintStatsToTimeline(&tds)); 404 NOT_IN_PRODUCT(PrintStatsToTimeline(&tds));
405 // Some Code objects may have been collected so invalidate handler cache.
406 thread->isolate()->handler_info_cache()->Clear();
405 EndOldSpaceGC(); 407 EndOldSpaceGC();
406 } 408 }
407 } 409 }
408 410
409 411
410 void Heap::CollectGarbage(Space space, 412 void Heap::CollectGarbage(Space space,
411 ApiCallbacks api_callbacks, 413 ApiCallbacks api_callbacks,
412 GCReason reason) { 414 GCReason reason) {
413 Thread* thread = Thread::Current(); 415 Thread* thread = Thread::Current();
414 switch (space) { 416 switch (space) {
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 Dart::vm_isolate()->heap()->WriteProtect(false); 845 Dart::vm_isolate()->heap()->WriteProtect(false);
844 } 846 }
845 847
846 848
847 WritableVMIsolateScope::~WritableVMIsolateScope() { 849 WritableVMIsolateScope::~WritableVMIsolateScope() {
848 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); 850 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0);
849 Dart::vm_isolate()->heap()->WriteProtect(true); 851 Dart::vm_isolate()->heap()->WriteProtect(true);
850 } 852 }
851 853
852 } // namespace dart 854 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698