Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 4674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4685 | 4685 |
| 4686 void ClassDictionaryIterator::MoveToNextClass() { | 4686 void ClassDictionaryIterator::MoveToNextClass() { |
| 4687 Object& obj = Object::Handle(array_.At(next_ix_)); | 4687 Object& obj = Object::Handle(array_.At(next_ix_)); |
| 4688 while (!obj.IsClass() && HasNext()) { | 4688 while (!obj.IsClass() && HasNext()) { |
| 4689 next_ix_++; | 4689 next_ix_++; |
| 4690 obj = array_.At(next_ix_); | 4690 obj = array_.At(next_ix_); |
| 4691 } | 4691 } |
| 4692 } | 4692 } |
| 4693 | 4693 |
| 4694 | 4694 |
| 4695 LibraryPrefixIterator::LibraryPrefixIterator(const Library& library) | |
| 4696 : DictionaryIterator(library) { | |
| 4697 MoveToNext(); | |
|
siva
2012/06/26 18:46:28
Your suggestion of 'Advance' in another context se
| |
| 4698 } | |
| 4699 | |
| 4700 | |
| 4701 RawLibraryPrefix* LibraryPrefixIterator::GetNext() { | |
| 4702 ASSERT(HasNext()); | |
| 4703 int ix = next_ix_++; | |
| 4704 Object& obj = Object::Handle(array_.At(ix)); | |
| 4705 MoveToNext(); | |
| 4706 LibraryPrefix& prefix = LibraryPrefix::Handle(); | |
| 4707 prefix ^= obj.raw(); | |
| 4708 return prefix.raw(); | |
| 4709 } | |
| 4710 | |
| 4711 | |
| 4712 void LibraryPrefixIterator::MoveToNext() { | |
| 4713 Object& obj = Object::Handle(array_.At(next_ix_)); | |
| 4714 while (!obj.IsLibraryPrefix() && HasNext()) { | |
| 4715 next_ix_++; | |
| 4716 obj = array_.At(next_ix_); | |
| 4717 } | |
| 4718 } | |
| 4719 | |
| 4720 | |
| 4695 void Library::SetName(const String& name) const { | 4721 void Library::SetName(const String& name) const { |
| 4696 // Only set name once. | 4722 // Only set name once. |
| 4697 ASSERT(!Loaded()); | 4723 ASSERT(!Loaded()); |
| 4698 ASSERT(name.IsSymbol()); | 4724 ASSERT(name.IsSymbol()); |
| 4699 StorePointer(&raw_ptr()->name_, name.raw()); | 4725 StorePointer(&raw_ptr()->name_, name.raw()); |
| 4700 } | 4726 } |
| 4701 | 4727 |
| 4702 | 4728 |
| 4703 void Library::SetLoadInProgress() const { | 4729 void Library::SetLoadInProgress() const { |
| 4704 // Should not be already loaded. | 4730 // Should not be already loaded. |
| (...skipping 5511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10216 const String& str = String::Handle(pattern()); | 10242 const String& str = String::Handle(pattern()); |
| 10217 const char* format = "JSRegExp: pattern=%s flags=%s"; | 10243 const char* format = "JSRegExp: pattern=%s flags=%s"; |
| 10218 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 10244 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
| 10219 char* chars = reinterpret_cast<char*>( | 10245 char* chars = reinterpret_cast<char*>( |
| 10220 Isolate::Current()->current_zone()->Allocate(len + 1)); | 10246 Isolate::Current()->current_zone()->Allocate(len + 1)); |
| 10221 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 10247 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
| 10222 return chars; | 10248 return chars; |
| 10223 } | 10249 } |
| 10224 | 10250 |
| 10225 } // namespace dart | 10251 } // namespace dart |
| OLD | NEW |