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

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

Issue 1953803003: Fix precompile build issue with IsString change. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-review-comments Created 4 years, 7 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
« runtime/vm/raw_object.h ('K') | « runtime/vm/raw_object.h ('k') | no next file » | 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 // 3. Walk the heap and build a new table from surviving symbols. 398 // 3. Walk the heap and build a new table from surviving symbols.
399 GrowableArray<String*> symbols; 399 GrowableArray<String*> symbols;
400 class SymbolCollector : public ObjectVisitor { 400 class SymbolCollector : public ObjectVisitor {
401 public: 401 public:
402 SymbolCollector(Thread* thread, 402 SymbolCollector(Thread* thread,
403 GrowableArray<String*>* symbols) 403 GrowableArray<String*>* symbols)
404 : symbols_(symbols), 404 : symbols_(symbols),
405 zone_(thread->zone()) {} 405 zone_(thread->zone()) {}
406 406
407 void VisitObject(RawObject* obj) { 407 void VisitObject(RawObject* obj) {
408 if (obj->IsString() && obj->IsCanonical()) { 408 if (obj->IsCanonical() && obj->IsStringInstance()) {
409 symbols_->Add(&String::ZoneHandle(zone_, String::RawCast(obj))); 409 symbols_->Add(&String::ZoneHandle(zone_, String::RawCast(obj)));
410 } 410 }
411 } 411 }
412 412
413 private: 413 private:
414 GrowableArray<String*>* symbols_; 414 GrowableArray<String*>* symbols_;
415 Zone* zone_; 415 Zone* zone_;
416 }; 416 };
417 417
418 SymbolCollector visitor(Thread::Current(), &symbols); 418 SymbolCollector visitor(Thread::Current(), &symbols);
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 RawObject* Symbols::GetVMSymbol(intptr_t object_id) { 771 RawObject* Symbols::GetVMSymbol(intptr_t object_id) {
772 ASSERT(IsVMSymbolId(object_id)); 772 ASSERT(IsVMSymbolId(object_id));
773 intptr_t i = (object_id - kMaxPredefinedObjectIds); 773 intptr_t i = (object_id - kMaxPredefinedObjectIds);
774 if ((i > kIllegal) && (i < Symbols::kMaxPredefinedId)) { 774 if ((i > kIllegal) && (i < Symbols::kMaxPredefinedId)) {
775 return symbol_handles_[i]->raw(); 775 return symbol_handles_[i]->raw();
776 } 776 }
777 return Object::null(); 777 return Object::null();
778 } 778 }
779 779
780 } // namespace dart 780 } // namespace dart
OLDNEW
« runtime/vm/raw_object.h ('K') | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698