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

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

Issue 1838373002: Remove unnecessary isolate argument from some visitors (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanup Created 4 years, 8 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
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/verifier.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/symbols.h" 5 #include "vm/symbols.h"
6 6
7 #include "vm/handles.h" 7 #include "vm/handles.h"
8 #include "vm/handles_impl.h" 8 #include "vm/handles_impl.h"
9 #include "vm/hash_table.h" 9 #include "vm/hash_table.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 // 2. Knock out the symbol table and do a full garbage collection. 368 // 2. Knock out the symbol table and do a full garbage collection.
369 isolate->object_store()->set_symbol_table(Object::empty_array()); 369 isolate->object_store()->set_symbol_table(Object::empty_array());
370 isolate->heap()->CollectAllGarbage(); 370 isolate->heap()->CollectAllGarbage();
371 371
372 // 3. Walk the heap and build a new table from surviving symbols. 372 // 3. Walk the heap and build a new table from surviving symbols.
373 GrowableArray<String*> symbols; 373 GrowableArray<String*> symbols;
374 class SymbolCollector : public ObjectVisitor { 374 class SymbolCollector : public ObjectVisitor {
375 public: 375 public:
376 SymbolCollector(Thread* thread, 376 SymbolCollector(Thread* thread,
377 GrowableArray<String*>* symbols) 377 GrowableArray<String*>* symbols)
378 : ObjectVisitor(thread->isolate()), 378 : symbols_(symbols),
379 symbols_(symbols),
380 zone_(thread->zone()) {} 379 zone_(thread->zone()) {}
381 380
382 void VisitObject(RawObject* obj) { 381 void VisitObject(RawObject* obj) {
383 if (obj->IsString() && obj->IsCanonical()) { 382 if (obj->IsString() && obj->IsCanonical()) {
384 symbols_->Add(&String::ZoneHandle(zone_, String::RawCast(obj))); 383 symbols_->Add(&String::ZoneHandle(zone_, String::RawCast(obj)));
385 } 384 }
386 } 385 }
387 386
388 private: 387 private:
389 GrowableArray<String*>* symbols_; 388 GrowableArray<String*>* symbols_;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 RawObject* Symbols::GetVMSymbol(intptr_t object_id) { 687 RawObject* Symbols::GetVMSymbol(intptr_t object_id) {
689 ASSERT(IsVMSymbolId(object_id)); 688 ASSERT(IsVMSymbolId(object_id));
690 intptr_t i = (object_id - kMaxPredefinedObjectIds); 689 intptr_t i = (object_id - kMaxPredefinedObjectIds);
691 if ((i > kIllegal) && (i < Symbols::kMaxPredefinedId)) { 690 if ((i > kIllegal) && (i < Symbols::kMaxPredefinedId)) {
692 return symbol_handles_[i]->raw(); 691 return symbol_handles_[i]->raw();
693 } 692 }
694 return Object::null(); 693 return Object::null();
695 } 694 }
696 695
697 } // namespace dart 696 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698